【问题标题】:How to check are IIS and .NET Core Hosting Bundle installed in wix toolset?如何检查 IIS 和 .NET Core Hosting Bundle 是否安装在 wix 工具集中?
【发布时间】:2020-09-25 08:31:21
【问题描述】:

如何检查 IIS 和 .NET Core Hosting Bundle 是否安装在 WiX 工具集安装程序中?

【问题讨论】:

    标签: iis .net-core installation wix


    【解决方案1】:

    通过检测注册表项,您会发现是否安装了 iis 和 .net 核心包:

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

    下面是其他iis组件:

    Discover Installed Components

    另一种方法是您可以使用 Powershell 检查注册表项:

    $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"
    }
    

    How to determine ASP.NET Core installation on a Windows Server by PowerShell

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-30
      • 2013-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-12
      • 1970-01-01
      相关资源
      最近更新 更多