Generating GUIDs for Wix MSI files in Azure DevOps

2019-07-09 13:26发布

I am setting up a Wix installer for web server application and for a Sitecore front end application. My question is not specific to web server or Sitecore. My issues are with Wix and how to use it with continuous delivery.

1) Wix requires GUIDs for each file and the product itself. Do I need to update each GUID in the Wix file with every build? In a Git repo, that can potentially be a lot of changes.

2) If I have to update the GUIDs when each branch (dev, staging, and master) on my CD server (Azure DevOps) makes a build, how do I update the Wix file with new GUIDs in Azure DevOps?

What we really want is to be able to buid, release, deploy, and potentially rollback to last good version on each of our 3 servers (dev, staging, and master). I originally thought we would just copy the files during the deploy step, but instead I was mandated to build an MSI installer because it is cleaner and can rollback bad installs consistently easier. If you think Wix is the wrong tool or there is a better process, please also speak up. Wix really seems overly verbose: a component for basically every file with generated GUIDs for each one.

1条回答
祖国的老花朵
2楼-- · 2019-07-09 14:24

Product-, Package-, Upgrade Code: You can use WiX's auto-GUIDs for components (for most components). Using auto-GUIDs significantly reduces WiX source complexity. Is it safe?

The Product Code, and Upgrade Code you need to manage. For most purposes you would change Product Code and Package Code for each release. Package Code can be set to auto-generate on build. In fact product code can as well, if you use major upgrades only. Nice summary from Flexera on product, package and upgrade code.


Hello WiX: There is a WiX Visual Studio Hello World example here. It should show you the basics of compiling a working setup with WiX and Visual Studio. There are also a bunch of quick start tips for WiX here (many links to samples).


Auto-Magic: You can use WiX's auto-guid feature as described here: Syntax for guids in WIX?. You simply leave out the hard coded GUID for components where WiX is able to manage the GUIDs auto-magically.

Understanding Component GUIDs: This pragmatic description of how the component GUIDs are intended to work might help understand them better: Change my component GUID in wix?

Here are other sources of information:

Rob Mensching, WiX creator:

Flexera:


Azure DevOps: I don't work with this environment, but if you use auto-component GUIDs, then you generally only need to update the Product Code and Product Version for each build - I am probably forgetting something. You can se the Package Code to auto-generate on build since it is merely supposed to be unique for every file (new file created for each build, so just auto-generate). Many also set the product code to auto-generate since they only use major upgrades.

I have never actually needed it, but you should be able to pass values to compiler variables inside the WiX source which means you can just pass the new version and product code (or just the version) to candle.exe, light.exe. Also see link below (msbuild). Will try to dig up a better one soon.


Some Links:

查看更多
登录 后发表回答