2014-11-06 63 views
3

我已經制作了一個具有一些先決條件的WiX-Bootstrapper捆綁包,每個示例IIS Express 8.0。 在虛擬機上安裝IIS很順利。 在下一步中,我想激活一些IIS功能。 所以我試圖在MSI項目的Product.wxs以下行:如何通過WiX-Bundle安裝後激活IIS功能?

<Product> 
    [...] 
    <Property Id="INSTALLIISPROP" 
       Value="C:\Windows\System32\dism.exe"></Property> 
    <CustomAction Id="InstallIISCA" 
        Return="check" 
        Property="INSTALLIISPROP" 
        Execute="deferred" 
        HideTarget="yes" 
        Impersonate="yes" 
        ExeCommand="/Online /Enable-Feature /FeatureName:IIS-WebServerRole /FeatureName:IIS-WebServer /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-StaticContent /FeatureName:IIS-DefaultDocument /FeatureName:IIS-RequestFiltering /FeatureName:IIS-IPSecurity [...]></CustomAction> 
    <InstallExecuteSequence> 
     <Custom Action="InstallIISCA" 
       Before="InstallFinalize"> 
      <![CDATA[NOT Installed AND IISMAJORVERSION]]> 
     </Custom> 
    </InstallExecuteSequence> 
</Product> 

但這沒什麼。 沒有任何IIS功能被激活。 我做錯了什麼?

在這裏,在最後的WXS文件的IIS的安裝:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
    xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> 
    <Fragment> 
     <util:RegistrySearch Root="HKLM" 
          Key="SOFTWARE\Microsoft\InetStp\Components" 
          Value="Install" 
          Variable="IisExpressX64" 
          Win64="yes"/> 
     <util:RegistrySearch Root="HKLM" 
          Key="SOFTWARE\Microsoft\InetStp\Components" 
          Value="Install" 
          Variable="IisExpressX86"/> 

     <PackageGroup Id="IisExpress_8_0"> 
      <MsiPackage Id="IisExpress8_0_X64" 
         Cache="yes" 
         Compressed="yes" 
         Permanent="yes" 
         Vital="yes" 
         SuppressSignatureVerification="yes" 
         SourceFile=".\Prerequisites\iis\iisexpress_8_0_RTM_x64_de-DE.msi" 
         InstallCondition="NOT IisExpressX86 AND VersionNT64"/> 

      <MsiPackage Id="IisExpress8_0_X86" 
         Cache="yes" 
         Compressed="yes" 
         Permanent="yes" 
         Vital="yes" 
         SuppressSignatureVerification="yes" 
         SourceFile=".\Prerequisites\iis\iisexpress_8_0_RTM_x86_de-DE.msi" 
         InstallCondition="NOT IisExpressX86 AND NOT VersionNT64"/> 
     </PackageGroup> 
    </Fragment> 
</Wix> 

而且它在Bundle.wxs引用:

<PackageGroupRef Id='IisExpress_8_0'/> 
+0

你有沒有嘗試在管理員模式下運行的MSI?它可能工作。我的建議是,您嘗試從引導程序中啓用IIS功能,而不是從msi – LeoN 2014-11-06 15:32:37

+0

謝謝LeoN!我正在嘗試使用另一個文件,該文件將在必備文件(請參閱http://stackoverflow.com/questions/24439602/wix-burn-install-iis-if-not-yet-安裝)。 – 2014-11-07 08:21:04

回答

4

要解決這個問題,你需要一個第二包含ExePackages的WXS文件,它將激活IIS功能。 然後你必須在Bundle中實現另一個PackageGroupRef。

這裏WXS與IIS的功能:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Fragment> 
     <PackageGroup Id='ActivateIisFeatures'> 
      <ExePackage Id='IIS_WebserverRole' 
         DisplayName='Installing IIS: IIS-WebServerRole' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WebServerRole'> 
      </ExePackage> 
      <ExePackage Id='IIS_WebServer' 
         DisplayName='Installing IIS: IIS-WebServer' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WebServer'> 
      </ExePackage> 
      <ExePackage Id='IIS_CommonHttpFeatures' 
         DisplayName='Installing IIS: IIS-CommonHttpFeatures' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-CommonHttpFeatures'> 
      </ExePackage> 
      <ExePackage Id='IIS_StaticContent' 
         DisplayName='Installing IIS: IIS-StaticContent' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-StaticContent'> 
      </ExePackage> 
      <ExePackage Id='IIS_DefaultDocument' 
         DisplayName='Installing IIS: IIS-DefaultDocument' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-DefaultDocument'> 
      </ExePackage> 
      <ExePackage Id='IIS_DirectoryBrowsing' 
         DisplayName='Installing IIS: IIS-DirectoryBrowsing' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-DirectoryBrowsing'> 
      </ExePackage> 
      <ExePackage Id='IIS_HttpErrors' 
         DisplayName='Installing IIS: IIS-HttpErrors' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-HttpErrors'> 
      </ExePackage> 
      <ExePackage Id='IIS_HttpRedirect' 
         DisplayName='Installing IIS: IIS-HttpRedirect' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-HttpRedirect'> 
      </ExePackage> 
      <ExePackage Id='IIS_ApplicationDevelopment' 
         DisplayName='Installing IIS: IIS-ApplicationDevelopment' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment'> 
      </ExePackage> 

      <!--NetFx4Extended-ASPNET45--> 
      <!--Some features like IIS-NetFxExtensibility, IIS-NetFxExtensibility45, IIS-ASPNET, IIS-ManagementService and WAS-NetFxEnvironment are dependent from this one.--> 
      <ExePackage Id='NetFx4Extended_ASPNET45' 
         DisplayName='Installing IIS: NetFx4Extended-ASPNET45' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:NetFx4Extended-ASPNET45'> 
      </ExePackage> 

      <ExePackage Id='IIS_NetFxExtensibility' 
         DisplayName='Installing IIS: IIS-NetFxExtensibility' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-NetFxExtensibility'> 
      </ExePackage> 
      <ExePackage Id='IIS_NetFxExtensibility45' 
         DisplayName='Installing IIS: IIS-NetFxExtensibility 4.5' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-NetFxExtensibility45'> 
      </ExePackage> 
      <ExePackage Id='IIS_ISAPIExtensions' 
         DisplayName='Installing IIS: IIS-ISAPIExtensions' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ISAPIExtensions'> 
      </ExePackage> 
      <ExePackage Id='IIS_ASP' 
         DisplayName='Installing IIS: IIS-ASP' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ASP'> 
      </ExePackage> 
      <ExePackage Id='IIS_ISAPI_Filter' 
         DisplayName='Installing IIS: IIS-ISAPI-Filter' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ISAPIFilter'> 
      </ExePackage> 
      <ExePackage Id='IIS_ASPNET' 
         DisplayName='Installing IIS: IIS-ASP.NET' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ASPNET'> 
      </ExePackage> 
      <ExePackage Id='IIS_ASPNET45' 
         DisplayName='Installing IIS: IIS-ASP.NET45' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ASPNET45'> 
      </ExePackage> 
      <ExePackage Id='IIS_HealthAndDiagnostics' 
         DisplayName='Installing IIS: IIS-HealthAndDiagnostics' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-HealthAndDiagnostics'> 
      </ExePackage> 
      <ExePackage Id='IIS_HttpLogging' 
         DisplayName='Installing IIS: IIS-HttpLogging' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-HttpLogging'> 
      </ExePackage> 
      <ExePackage Id='IIS_LoggingLibraries' 
         DisplayName='Installing IIS: IIS-LoggingLibraries' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-LoggingLibraries'> 
      </ExePackage> 
      <ExePackage Id='IIS_RequestMonitor' 
         DisplayName='Installing IIS: IIS-RequestMonitor' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-RequestMonitor'> 
      </ExePackage> 
      <ExePackage Id='IIS_HttpTracing' 
         DisplayName='Installing IIS: IIS-HttpTracing' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-HttpTracing'> 
      </ExePackage> 
      <ExePackage Id='IIS_CustomLogging' 
         DisplayName='Installing IIS: IIS-CustomLogging' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-CustomLogging'> 
      </ExePackage> 
      <ExePackage Id='IIS_Security' 
         DisplayName='Installing IIS: IIS-Security' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-Security'> 
      </ExePackage> 
      <ExePackage Id='IIS_WindowsAuthentication' 
         DisplayName='Installing IIS: IIS-WindowsAuthentication' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WindowsAuthentication'> 
      </ExePackage> 
      <ExePackage Id='IIS_RequestFiltering' 
         DisplayName='Installing IIS: IIS-RequestFiltering' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-RequestFiltering'> 
      </ExePackage> 
      <ExePackage Id='IIS_IPSecurity' 
         DisplayName='Installing IIS: IIS-IPSecurity' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-IPSecurity'> 
      </ExePackage> 
      <ExePackage Id='IIS_Performance' 
         DisplayName='Installing IIS: IIS-Performance' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-Performance'> 
      </ExePackage> 
      <ExePackage Id='IIS_HttpCompressionStatic' 
         DisplayName='Installing IIS: IIS-HttpCompressionStatic' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-HttpCompressionStatic'> 
      </ExePackage> 
      <ExePackage Id='IIS_WebServerManagementTools' 
         DisplayName='Installing IIS: IIS-WebServerManagementTools' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WebServerManagementTools'> 
      </ExePackage> 
      <ExePackage Id='IIS_ManagementConsole' 
         DisplayName='Installing IIS: IIS-ManagementConsole' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ManagementConsole'> 
      </ExePackage> 
      <ExePackage Id='IIS_ManagementScriptingTools' 
         DisplayName='Installing IIS: IIS-ManagementScriptingTools' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ManagementScriptingTools'> 
      </ExePackage> 
      <ExePackage Id='IIS_ManagementService' 
         DisplayName='Installing IIS: IIS-ManagementService' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:IIS-ManagementService'> 
      </ExePackage> 
      <ExePackage Id='WAS_WindowsActivationService' 
         DisplayName='Installing IIS: WAS-WindowsActivationService' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:WAS-WindowsActivationService'> 
      </ExePackage> 
      <ExePackage Id='WAS_ProcessModel' 
         DisplayName='Installing IIS: WAS-ProcessModel' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:WAS-ProcessModel'> 
      </ExePackage> 
      <ExePackage Id='WAS_NetFxEnvironment' 
         DisplayName='Installing IIS: WAS-NetFxEnvironment' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:WAS-NetFxEnvironment'> 
      </ExePackage> 
      <ExePackage Id='WAS_ConfigurationAPI' 
         DisplayName='Installing IIS: WAS-ConfigurationAPI' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:WAS-ConfigurationAPI'> 
      </ExePackage> 
      <ExePackage Id='IIS_NetFx3' 
         DisplayName='Installing IIS: NetFx3' 
         PerMachine='yes' 
         SourceFile='.\Resources\Dism.exe' 
         InstallCommand='/Online /Enable-Feature /FeatureName:NetFx3'> 
      </ExePackage> 
     </PackageGroup> 
    </Fragment> 
</Wix> 

而且至少PackageGroupRef:

<PackageGroupRef Id='ActivateIisFeatures'/>