I have a Wix installer to deploy my application in IIS. I want to remove HTTP binding when it deploys.
Below is the cmd command that helps in removing the HTTP binding: “set site /site.name:"My Project Management" /-bindings.[protocol='http',bindingInformation='*:80:']”
I want the same thing happen via wix custom action.Something like below:
<CustomAction Name="RemoveHttp_Cmd" Schedule="Before" Reference="RemoveHttp" Condition="Installed">
<Definition Property="RemoveHttp" Execute="immediate" Value=""[WindowsFolder]system32\inetsrv\appcmd.exe" set site /name:"My Project Management" /-bindings:"http/*:80:"" />
</CustomAction>
<CustomAction Name="RemoveHttp" Schedule="Before" Reference="CreateAppPool" Condition="Installed">
<Definition BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" />
</CustomAction>
It should ideally remove the binding but actually, it is not. Please suggest the right way to do.
You might want to look at the IIS Rewrite module. It's been my experience that you can use a bootstrapper to install the module if it isn't present and with just a little bit of XML in your applications web.config set up a rule to rewrite http to https or rewrite it to a not supported page. No installer work beyond making sure the rewrite module is present should be needed.