How do I activate IIS functionality after installing WiX-Bundle?

I created a WiX-Bootstrapper package with some preconditions, for example with IIS Express 8.0. On a virtual machine, the IIS installation goes well. In the next step, I want to activate some IIS functionality. So I tried the following lines in Product.wxs of the MSI project:

<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>

      

But that doesn't do anything. None of the IIS features are enabled. What I did wrong?

Finally, here is the WXS file for installing 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>

      

And this is stated in Bundle.wxs:

<PackageGroupRef Id='IisExpress_8_0'/>

      

+3


source to share


1 answer


To fix this problem, you need a second WXS file containing ExePackages, which will enable the IIS functionality. Then you need to implement another PackageGroupRef in the Bundle.

Here's a WXS with IIS features:

<?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>

      



And at least PackageGroupRef:

<PackageGroupRef Id='ActivateIisFeatures'/>

      

+4


source







All Articles