0
votes

I have an MSI installer built with Wix. It does not require elevated privileges, having ALLUSERS=2 and MSIINSTALLPERUSER=1. It works fine in the user unteractive mode, but fails when launched from a non-elevated command prompt in the silent (/qn) or passive (/passive) mode.

The error in the log appearing straight after "Action start: InstallFinalize":

Error 1925. You do not have sufficient privileges to complete this installation for all users of the machine.  Log on as administrator and then retry this installation.

Interestingly, if I run the installer from an admin command prompt in the silent mode, it succeeds. It installs into the per-user folder and writes registry to HKCU as expected, but when I uninstall it, it triggers the UAC elevation prompt, which suggests that there's some component there that has been installed per-machine, rather than per-user. Again, this does not happen if it was installed in the user-interactive mode.

Any help will be much appreciated.

1
Can you please provide some more information? On the Package element have you set the InstallPrivileges and InstallScope, to what? Which version of Windows Installer is used? - MOS
We would need full logs and / or sources to really say anything at all. However, what is your setting for InstallScope in the Package element? Are all your folders per-user? In the compiled MSI, what is the word count value? I don't have Orca available right now, but it should be in the Summary Information Stream. Are ALLUSERS and MSIINSTALLPERUSER defined in the property table? (just checking). What WiX GUI dialog set do you use? - Stein Åsmul
Thanks for looking into this! I don't set InstallScope on the Package element to anything because it sets ALLUSERS to either nothing or 1, but I need it to be 2 for the dual-purpose MSI. So I set ALLUSERS to 2 via a Property element. The InstallPrivileges attribute isn't set to anything either, so it defaults to 'elevated'. Otherwise, the user cannot choose to install per-machine. I use the WixUI_Advanced dialog set. - igorsp7

1 Answers

0
votes

It turned out that the problem was with the ALLUSERS property. I had a custom action that set its value either to 1 or nothing before FindRelatedProducts to match the scope of any previously installed version so that it can be properly upgraded. Then, there was another custom action that reset the value of ALLUSERS back to 2 and set MSIINSTALLPERUSER appropriately instead. The problem was with that second custom action - apparently you shouldn't reset the value of ALLUSERS to 2 in the InstallExecuteSequence, but it's fine to do so in InstallUISequence.