如何检查wix工具集中是否安装了IIS和.NET核心托管捆绑包?

如何检查wix工具集中是否安装了IIS和.NET核心托管捆绑包?,iis,.net-core,installation,wix,Iis,.net Core,Installation,Wix,如何检查WiX Toolset Installer中是否安装了IIS和.NET Core托管捆绑包?通过检测注册表项,您将发现IIS和.NET Core捆绑包是否已安装: <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\InetStp\Components" Value="W3SVC"

如何检查WiX Toolset Installer中是否安装了IIS和.NET Core托管捆绑包?

通过检测注册表项,您将发现IIS和.NET Core捆绑包是否已安装:

<util:RegistrySearch Root="HKLM"
                     Key="SOFTWARE\Microsoft\InetStp\Components"
                     Value="W3SVC"
                     Variable="WebServer"/>

<ExePackage Id='IIS_WebServer'
            DisplayName='Installing IIS: IIS-WebServer'
            PerMachine='yes'
            SourceFile='.\Resources\Dism.exe'
            InstallCondition='NOT WebServer'
            InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WebServer'>
</ExePackage>
$DotNETCoreUpdatesPath = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Updates\.NET Core"
$DotNetCoreItems = Get-Item -ErrorAction Stop -Path $DotNETCoreUpdatesPath
$NotInstalled = $True
$DotNetCoreItems.GetSubKeyNames() | Where { $_ -Match "Microsoft .NET Core.*Windows Server Hosting" } | ForEach-Object {
    $NotInstalled = $False
    Write-Host "The host has installed $_"
}
If ($NotInstalled) {
    Write-Host "Can not find ASP.NET Core installed on the host"
}