Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Installer just changes my installation to ALLUSERS=1 behind my back

I'm seeing a strange issue with WiX 3.8 and Windows Installer.

I have created an Outlook plugin that I want end-users without admin permissions to be able to install on their machines.

Therefore, I carefully made sure

  • not to write to any system-level directory (like C:\program files etc.) during install
  • not to write to any system-level registry key (like HKEY_LOCAL_MACHINE)

and in my WiX script, I made sure to set ALLUSERS=0 and also set all other relevant properties I found to perUser or limited:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
  <Product Id="*" Name="MyAddin" Language="1033" Version="1.0.0" 
           Manufacturer="Me" UpgradeCode="-some-guid-" Codepage="1252">
    <Package InstallerVersion="200" Compressed="yes" 
             InstallScope="perUser" 
             Description="yada yada" Manufacturer="Me" Languages="1033" SummaryCodepage="1252" 
             InstallPrivileges="limited" 
             Comments="yada yada" />
    <Property Id="ALLUSERS" Value="0"/>

I had imagined that would work - but on my test system, with a normal standard user account (no admin privileges), my install fails miserably - with a message dialog telling me I have insufficient privileges to install this for all users....

WTF? I specifically wanted to install this for **just this* user - not all users on the machine!

Looking at the MSI logs, I see astonishing things:

MSI (c) (B0:B4) [18:08:08:543]: Note: 1: 2262 2: AdminProperties 3: -2147287038
MSI (c) (B0:B4) [18:08:08:543]: Machine policy value 'AlwaysInstallElevated' is 0
MSI (c) (B0:B4) [18:08:08:543]: User policy value 'AlwaysInstallElevated' is 0
MSI (c) (B0:B4) [18:08:08:543]: Running product '........' with user privileges: It's not assigned.
...
MSI (c) (B0:B4) [18:08:08:543]: PROPERTY CHANGE: Modifying ALLUSERS property. Its current value is '0'. Its new value: '1'.

*Why on earth is the Windows Installer deciding to just change the ALLUSERS property to 1 ?!?!? I never told it to!! Sheesh.......

Any ideas? Thoughts? Pointers?

like image 782
marc_s Avatar asked Oct 10 '14 16:10

marc_s


2 Answers

According to the MSI SDK documentation for ALLUSERS the correct way to create a per-user installation is to set ALLUSERS to "" (second bullet bolded below):

  • An ALLUSERS property value of 1 specifies the per-machine installation context.
  • An ALLUSERS property value of an empty string ("") specifies the per-user installation context.
  • If the value of the ALLUSERS property is set to 2, the Windows Installer always resets the value of the ALLUSERS property to 1 and performs a per-machine installation or it resets the value of the ALLUSERS property to an empty string ("") and performs a per-user installation. The value ALLUSERS=2 enables the system to reset the value of ALLUSERS, and the installation context, dependent upon the user's privileges and the version of Windows.

The value "0" is undefined so you get whatever undefined behavior the Windows Installer picks this (pick one of the following): week/month/year/operating system/service pack.

For more "behind the story" details behind this answer see this blog entry.

like image 180
Rob Mensching Avatar answered Nov 16 '22 11:11

Rob Mensching


Your InstallScope (and InstallPrivileges) should be enough to force a per user install. so I'd take out your explicit ALLUSERS=0 and see if you get a per user install. You'll still get security errors if the install tries to access restricted items, but that's a separate issue.

like image 1
PhilDW Avatar answered Nov 16 '22 12:11

PhilDW