Setting the 'AllUsers' option on Wix installer does not work

installation, windows-installer, wix

Solution

Instead of setting `ALLUSERS` explicitly, try setting the `InstallScope` of the `Package` element to `perMachine`. According to the documentation, this fact:

Set this value to declare that the package is a per-machine installation and requires elevated privileges to install. Sets the ALLUSERS property to 1.

So, it should do the required job under the hood.

Problem

I am using a WiX to install a service on test machine. But when I do that only the user who installed it on the machine is able to see in the 'Add/Remove Programs' control panel option. But I want to make it visible for every user on the machine. I did some research and realized that I am not setting the `AllUSERS` property while creating the installer in the .wxs file. So I updated my script with this line `<Property Id="AllUSERS" Value="1"/>` and created the installer. But still only the user who installed can see it in the Control Panel. Here is my script to create the installer. ``` <?xml version='1.0' encoding='windows-1252'?> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> <Product Name='Importer Service' Id='PUT-GUID-HERE' UpgradeCode='PUT-GUID-HERE' Language='1033' Codepage='1252' Version='$(var.version)' Manufacturer='Test'> <Package Id='*' Keywords='Installer' Description="Imports data" Manufacturer='Test' InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' /> <Media Id='1' Cabinet='ImporterWebService.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" /> <Property Id='DiskPrompt' Value="Importer Web Service 1.0 Installation [1]" /> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" /> <Property Id="AllUSERS" Value="1"/> <Directory Id='TARGETDIR' Name='SourceDir'> <Directory Id='ProgramFilesFolder' Name='PFiles'> <Directory Id='Test' Name='Test1'> <Directory Id='INSTALLDIR' Name='Importer Service'> <Component Id='MainExecutable' Guid='*'> <File Id='ImporterWindowsServiceEXE' Name='Importer.WindowsService.exe' DiskId='1' Source='Importer.WindowsService.exe' KeyPath='yes'> </File> <ServiceInstall Id="ImporterServiceInstaller" Type="ownProcess" Vital="yes" Name="Importer Service" DisplayName="Importer Service" Description="Imports data." Start="demand" Account="LocalSystem" ErrorControl="ignore" Interactive="no"> </ServiceInstall> <ServiceControl Id="StartService" Stop="both" Remove="uninstall" Name="Importer Service" Wait="yes" /> </Component> <Component Id='FileHelpersLibrary' Guid='*'> <File Id='FileHelpersDLL' Name='FileHelpers.dll' DiskId='1' Source='FileHelpers.dll' KeyPath='yes' /> </Component> <Component Id='CodeSmithDataLibrary' Guid='*'> <File Id='CodeSmithDataDLL' Name='CodeSmith.Data.dll' DiskId='1' Source='CodeSmith.Data.dll' KeyPath='yes' /> </Component> </Directory> </Directory> </Directory> <Directory Id="ProgramMenuFolder" Name="Programs"> <Directory Id="ProgramMenuDir" Name="Importer Service"> <Component Id="ProgramMenuDir" Guid="*"> <RemoveFolder Id='ProgramMenuDir' On='uninstall' /> <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' /> </Component> </Directory> </Directory> <Directory Id="DesktopFolder" Name="Desktop" /> </Directory> <Feature Id='Complete' Title='Importer Service' Description='The complete package' Display='hidden' Level='1' ConfigurableDirectory='INSTALLDIR'> <ComponentRef Id='MainExecutable' /> <ComponentRef Id='FileHelpersLibrary' /> <ComponentRef Id='CodeSmithDataLibrary' /> <ComponentRef Id='ProgramMenuDir' /> </Feature> <UIRef Id="WixUI_InstallDir" /> <UIRef Id="WixUI_ErrorProgressText" /> </Product> </Wix> ``` Could someone please look at the script and let me know what I am doing wrong. Thanks.

Original source