I created a WiX package for my website, and it works fine, except that my newly created website doesn't start after installation. That's because my website is registered to use *:80. IIS by default has a website setup with the same binding.
Is there a way to remove default website (or at least stop it) before creating my new website binding? I can't seem to find any information for this on the internet, but it seems like a common problem.
I found how to do this, I thought I'd put an answer for any weary travelers:
<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>
My answer was based off this article: here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With