2013-07-26 160 views
8

我正在使用WiX在測試機器上安裝服務。但是當我這樣做時,只有安裝在機器上的用戶才能在「添加/刪除程序」控制面板選項中看到。但是我想讓它對機器上的每個用戶都可見。在Wix安裝程序中設置'AllUsers'選項不起作用

我做了一些研究,並意識到我沒有在.wxs文件中創建安裝程序時設置AllUSERS屬性。

所以我用這一行更新了我的腳本<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> 

有人請看看腳本,讓我知道我做錯了什麼。

謝謝。

+0

WiX有着悠久的歷史,使構建Windows Installer軟件包變得越來越簡單。互聯網上有很多精美的教程和例子,但他們往往無法跟上WiX的發展。您仍然可以從中學習,但一定要檢查當前文檔(包括XML模式,例如通過IntelliSense)並運行WiXCop工具,以便您在新安裝程序上的工作是最新的。 –

+0

嘗試ALLUSERS而不是AllUSERS –

回答

13

而不是明確設置ALLUSERS,請嘗試將Package元素的InstallScope設置爲perMachine。根據該文件,這樣一個事實:

將此值來聲明包是每臺機器 安裝需要提升的權限才能安裝。將 ALLUSERS屬性設置爲1.

因此,它應該在引擎蓋下完成所需的工作。

相關問題