installshieldwindows-installerbasic-msi

dual purpose package and MajorUpgrade


I'm trying to make a dual purpose package and I have problems with the upgrade.

by default my property are ALLUSERS=2 and MSIINSTALLPERUSER=1

on the dialog readyToInstall if the "install for all users" is checked, I use SetProperty to put ALLUSERS=1 and MSIINSTALLPERUSER={} (just to be sure).

that part work fine, the registry are set in HKLM and the files in Program Files.

during upgdrade however ... I have a custom action that check after the AppSearch if the keys are in HKLM it set ALLUSERS=1 and MSIINSTALLPERUSER={}.

if I make a minor update, the files are upgraded correctly.

if I make a major update, the registries are still in the HKLM but the files switch to LocalAppData (it follows the default value in fact), ignoring the fact that I force the ALLUSERS to 1 after the AppSearch. (I even try to force it after the migrate feature state just to mimic the UI but it didn't worked either).

is there a way to make a major upgrade with dual purpose package?


Solution

  • Based on the following excerpt, it seems that you're facing scenario B:

    Major Upgrades can Fail
    If you use the Upgrade code feature of Windows Installer to perform a major upgrade the detection of the existing software will fail if: (a) the original software was installed with ALLUSERS=”” and the new software has ALLUSERS=1 in its Property table or passed on the command line or (b) the original software was installed with ALLUSERS=1 and the new software has ALLUSERS=”” or ALLUSERS is not defined in the Property table or on the command line.

    For more info: https://shieldmaster.wordpress.com/2012/05/03/understanding-per-user-or-per-machine-context-for-application-setup-packages/