Closed abskulkarni closed 1 month ago
That's correct. But why is it a problem?
project.GUID
is used to auto-generate all required MSI identities of your product. It is used as a seed value. Thus once you assign your GUID you don't need to change it ever. If you are building a setup for a new product version, WixSharp will ensure that the UpgradeCode stays the same but the ProductId is incremented.
So if you prefer to set these identities manually and update them every time you build a new setup version and rely on your memory to not forget to do then :) ... then you can start setting ProductId and Upgrade code manually.
You can read more about that here: https://github.com/oleg-shilo/wixsharp/wiki/Deployment-scenarios#identities-and-naming
But, of course, if you find a problem with the algorithm then I can have a look at it.
I am not sure I got the concept of various IDs used and their purposes. May be an example of some product like Notepad++ with whole cycle of installing, upgrading may help.
But we figured out that we need explicit product id to be set to a defined value so that future MSIs will be able to know if product is already installed or not.
Any code sample from the samples library has IDs set correctly. This one even shows how to build two versions of MSI as part of the upgrade.
In a nutshell the messy MSI ID concept is handled in WixSharp transparently:
v1.0.0
var project = new ManagedProject(...);
project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
project.Version = new Version("1.0.0");
. . .
v2.0.0
var project = new ManagedProject(...);
project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
project.Version = new Version("2.0.0");
. . .
v2.0.0 and v1.0.0 MSIs have the same upgrade code but different product ID. Exactly as it is supposed to be. You can always check the generated IDs from the build output:
But we figured out that we need explicit product id... Most likely the problem you are dealing with is not caused by that. But of course, I have no evidence of that. :)
Anyway, you can set the ids directly to the project object if you are not happy with the default approach.
project.ProductId
project.UpgradeCode
Hi @oleg-shilo I am trying to set a fixed product code for my product in wix sharp script.
I am using project.GUID = new Guid("DD3E7EFF-26F7-4A16-A905-F21A36D0C66B");
But I see this GUID has been assigned as its upgrade code in WXS file and project's ID is newly generated GUID with difference in its minor part as seen in below screen shots.
WXS changed to below : (GUID given in script becomes its upgrade code & it generates a project ID on its own from somewhere with difference in minor part of GUID given in script)
If you see MSI properties in ORCA tool, you can see these two properties: