我为我的网站创建了一个WiX软件包,它运行正常,只是我新创建的网站在安装后没有启动.那是因为我的网站注册使用*:80.默认情况下,IIS具有相同绑定的网站设置.
有没有办法在创建我的新网站绑定之前删除默认网站(或至少停止它)?我似乎无法在互联网上找到任何相关信息,但这似乎是一个常见的问题.
我找到了如何做到这一点,我想我可以为任何疲惫的旅行者提供答案:
<CustomAction Id="RegisterCommand"
Property="RegisterPowerShellProperty"
Execute="immediate"
Value=""C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy ByPass -NoLog -InputFormat None -NoProfile -command "Remove-IISSite -Name 'Default Web Site' -Confirm:$false""/>
<CustomAction Id="RegisterPowerShellProperty"
BinaryKey="WixCA"
DllEntry="CAQuietExec64"
Execute="deferred"
Return="check"
Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="RegisterCommand" After="CostFinalize">NOT Installed</Custom>
<Custom Action="RegisterPowerShellProperty" After="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
Run Code Online (Sandbox Code Playgroud)
我的回答基于这篇文章: 这里
| 归档时间: |
|
| 查看次数: |
783 次 |
| 最近记录: |