wixwix3.5

WiX: how to install created patch in REINSTALL=ALL by default?


I have generated a patch.msp file using wix tools and the when I install it via command line using the following command, all components of my app get updated.

Install patch.msp file via command line works perfect!

msiexec.exe /p patch.msp /l*vx patch.log /qb REINSTALL=ALL REINSTALLMODE=omusa

but when a user installs the patch.msp file using Windows Explore (basically double clicking on the file). it installs fine (NO Errors generated, also get displayed in Installed Updates) but my dlls and .exe files do not get updated.

so how can i make this install with REINSTALL=ALL? is there a command i can add to the patch.wxs file?

thanks in advance

Edit

<CustomAction Id="PatchInstall" Property="PATCH" Value="REINSTALL" />
<InstallExecuteSequence>
  <Custom Action="PatchInstall" Before="InstallInitialize">REINSTALL="ALL"</Custom>
</InstallExecuteSequence>

Update on this - 2012/09/27

The suggested method did not work but the problem with my solution is the file version did not change therefore the installer displays warning message advising that files have not changed. i found this in the log when installing the patch:

MSI (s) (48:F4) [17:32:34:025]: File: C:\Muzi_Test_Installer\ACME.dll;  Won't Overwrite;    Won't patch;    Existing file is of an equal version

so i'm going to update the file version and re-run the test.

Final Update okay just to confirm this was a file versioning issue! just by updating the file version the MSP installs fine with no problem.


Solution

  • You can try to set REINSTALL property to ALL if the patch is being installed.

    So you need to modify your new package and add a new custom action which changes REINSTALL value conditioned on PATCH property.

    Edit: You want your custom action to work this way:

    if (PATCH) {
        REINSTALL = "ALL";
    }
    

    So in WiX, it looks as:

    <CustomAction Id="PatchInstall" Property="REINSTALL" Value="ALL" />
    <InstallExecuteSequence>
        <Custom Action="PatchInstall" Before="InstallInitialize">PATCH</Custom>
    </InstallExecuteSequence>