Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 424
kranthi Avatar asked Jul 26 '13 10:07

kranthi


People also ask

How do I run as administrator in WiX Installer?

Setup tab > Run after execution input: your msi file name. Advanced tab > Mark Request Administrative access option checkbox.

What is Allusers property in MSI?

The value of the ALLUSERS property, at installation time, determines the installation context. 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.


1 Answers

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.

like image 86
Yan Sklyarenko Avatar answered Oct 14 '22 21:10

Yan Sklyarenko