1

I'm quite new to Wix so maybe this question doesn't make any sense, but why is there no upgrade code for merge modules? I currently have a small application for which I made a regular MSI. Now I would also like to make a merge module for this application, so that it can be installed along with other applications (it will be shipped to clients as part of a bunch of related applications). I would like my merge module to detect if my application is already installed, and upgrade it if necessary, but there is no upgrade code for merge modules. Is there a way to achieve this?

What I want is a behavior like this: Suppose you could install Words, Excel, etc. all separately with their own MSI, but you could also install the whole Microsoft Office, which would include the MSMs for Words, Excel... Of course, if you isntall Excel from the MSI first and then you run the MSI for Office, then the MSM for Excel would detect that it is already installed and upgrade if necessary or do nothing if it is up to date.

Thanks all for your help

Carl
  • 1,224
  • 2
  • 19
  • 35

1 Answers1

3

Upgrades are handled at the level of an entire product. Merge modules are collections of related components that are included in products. So a merge module is the wrong place to specify upgrades.

However, for the scenario you describe, you don't need upgrades: Windows Installer will upgrade individual files when their version numbers go up. See "File Versioning Rules" in the MSI SDK for the full list of versioning rules.

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • Thanks for that. If there are around 20 files within this merge module, should they all follow this File Versioning scheme? Also, what could I do if 2 of those files are COM components that must be registered? Is there a way to re-register the file when it gets changed? – Carl Jul 29 '11 at 01:29
  • 1
    Yes, if a file is updated, its version number must change -- MSI inherently trusts the version number so if it doesn't change, MSI won't upgrade it. The same thing applies to COM registration: Put the registry entries in the same component as the file, increment the file's version number, and MSI will upgrade the file and write the registry values. – Bob Arnson Jul 29 '11 at 03:55
  • If I understand well, a merge module must hardcode the path where it installs files since it relies on file versioning for upgrade. If I let the MSI decide where to install the MSM, I might get mutliple copies of the files on multiple places on the system without even detecting it? – Carl Jul 29 '11 at 12:53
  • Usually, the merge module has to be authored to support being installed in arbitrary directories. When you have things like COM components that should be global, it's common to use directories like CommonFilesFolder. – Bob Arnson Jul 29 '11 at 13:05