1

We use WIX 3 to code our MSI installers. Besides our own dll's we ship quite a few third party dll's (including subdependencies). It has happened quite regularly that we need to downgrade one of those third party dlls.

With the default REINSTALLMODE "omus", these dll's magially disappeared when users ran the installers to update an existing application. Therefore we have changed the REINSTALLMODE to amus (default is omus) by using this XML-Element in WIX:

 <Property Id="REINSTALLMODE" Value="amus"/>

This solved the problem but now, the compiler spits out a warning: "warning LGHT1076: ICE40: REINSTALLMODE is defined in the Property table. This may cause difficulties." To us, it is not fully clear what this means.

I understand that REINSTALLMODE="amus" is problematic when you have shared dll's. Our product(s) are all selfcontained and none share any dll's (and the Installers only support Install/Uninstall/Update, No Repair).

To me it is not clear what these warnings now mean for our product. Is "amus" now safe? I have found some explanations, including a list of drawbacks:
File of a new component isn't installed because there was an old component with the same file

Most of the listed drawbacks only relate to shared files and dont apply to us, but some others are less clear:

can downgrade or wipe-out settings in non-versioned files and registry settings (note to self: test this again, there are complexities with component settings

Does anyone know about the pitfalls of setting REINSTALLMODE="amus" when there are no shared files? Or to put it differently, I would like to know if REINSTALLMODE="amus" is safe for MSI installers with no shared files.

Edit: Haven't found any new info but we found out that a self contained msi packages was instable when we switched to "Amus" in certain circonstances. It worked when we just ran the installer normally, but installation/update failed wen we ran it via command line (triggered by C# code). So for us switching to amus was not an option :-( From the answer below I take the problem was not amus itself but setting the REINSTALL mode at build time,which is not really supported. (No clue why, with my minimal understanding I would guess that something is generally more stable if it is set at build time and then never changed)

Dan
  • 630
  • 1
  • 6
  • 14

2 Answers2

2

The warning is not about the value "amus". The warning is about hardcoding the REINSTALLMODE property to any value. REINSTALLMODE is only meant to be set at runtime, not build time. Windows Installer (the code that installs your MSI) was not designed to handle the REINSTALLMODE property being defined in the MSI. The official documentation on this is https://learn.microsoft.com/en-us/windows/win32/msi/ice40.

Defining the REINSTALLMODE property in .msi file can lead to unexpected behavior. To fix this error, do not define this property.

Sean Hall
  • 7,629
  • 2
  • 29
  • 44
  • Thanks a lot for the answer. So then my next question would be how to set the REINSTALLMODE at runmode in a WIX package. Is this even possible or do I need a custom action? (Sorry im quite the newbie when it comes to msi and wix). – Dan Feb 24 '22 at 18:36
  • What are examples of issues that can be caused by setting REINSTALLMODE in the MSI? The error and docs are as vague as possible. I can't find anything googling. I've done it without issues before. – Vimes May 29 '22 at 02:53
1

I tried using Wix SetProperty element to set REINSTALLMODE property, it doesn't generate the warning. It creates Type 51 custom action to set a property at runtime. Wix adds the custom action to both InstallUISequence and InstallExecuteSequence tables. I schedule it as soon as possible in the sequences, in my case before FindRelatedProducts.

<SetProperty Id="REINSTALLMODE" Value="amus" Before="FindRelatedProducts" Sequence="first">NOT REINSTALLMODE</SetProperty>

The condition is useful if there is a requirement to allow changing the property from a command line. Sequence="first" attribute schedules the custom action in InstallUISequence or InstallExecuteSequence if the InstallUISequence is skipped at install time.

andrebroz
  • 176
  • 10