在Wix安装程序上设置'AllUsers'选项不起作用

kra*_*thi 12 installer windows-installer wix

我正在使用WiX在测试机器上安装服务.但是当我这样做时,只有在机器上安装它的用户才能在"添加/删除程序"控制面板选项中看到.但是我想让它对机器上的每个用户都可见.

我做了一些研究,并意识到我AllUSERS在.wxs文件中创建安装程序时没有设置属性.

所以我用这行更新了我的脚本<Property Id="AllUSERS" Value="1"/>并创建了安装程序.但仍然只有安装的用户可以在控制面板中看到它.

这是我创建安装程序的脚本.

<?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>
Run Code Online (Sandbox Code Playgroud)

有人可以看看剧本,让我知道我做错了什么.

谢谢.

Yan*_*nko 18

ALLUSERS尝试将元素设置为InstallScope,而不是显式设置.根据文档,这个事实:PackageperMachine

设置此值以声明程序包是每台计算机上的安装,并且需要提升权限才能安装.将ALLUSERS属性设置为1.

因此,它应该在引擎盖下完成所需的工作.

  • 这篇博文可能会给您更多想法:https://www.joyofsetup.com/2008/04/01/new-wix-feature-setting-package-installation-scope/ (2认同)