Richard B
Richard B

Reputation: 1581

HttpUrlReservation Failing with custom port

When using the new module in WiX 3.10.1 to reserve a port, if I reserve on :8080, it works fine, but when trying to reserve on a different port, say :444, it fails. running a full log of the installation from msiexec.exe, i'm getting the following that looks pertinent to the situation:

ExecFirewallExceptions:  Installing firewall exception2 xxx on port 444 , protocol 6
ExecFirewallExceptions:  Error 0x8000ffff: failed to set exception port
ExecFirewallExceptions:  Error 0x8000ffff: failed to create FwRule object
Action 15:49:57: WixRollbackHttpUrlReservationsInstall. Rolling back Windows HTTP Server configuration
Action 15:49:57: WixExecHttpUrlReservationsInstall. Configuring Windows HTTP Server
ExecHttpUrlReservations:  Adding reservation for URL 'http://+:444 /' with SDDL 'D:(A;;0x10000000;;;S-1-1-0)'
ExecHttpUrlReservations:  Error 0x80070057: Failed to add URL reservation: http://+:444 /, ACL: D:(A;;0x10000000;;;S-1-1-0)
ExecHttpUrlReservations:  Error 0x80070057: Failed to add reservation for URL 'http://+:444 /' with SDDL 'D:(A;;0x10000000;;;S-1-1-0)'
CustomAction WixExecHttpUrlReservationsInstall returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 15:49:57: InstallFinalize. Return value 3.
Action 15:49:57: Rollback. Rolling back action:
Rollback: Configuring Windows HTTP Server
Rollback: Rolling back Windows HTTP Server configuration
ExecHttpUrlReservations:  Removing reservation for URL 'http://+:444 /'
ExecHttpUrlReservations:  Error 0x80070057: Failed to remove URL reservation: http://+:444 /
ExecHttpUrlReservations:  Error 0x80070057: Failed to remove reservation for URL 'http://+:444 /'
CustomAction WixRollbackHttpUrlReservationsInstall returned actual error code 1603 but will be translated to success due to continue marking

In my example on the ports, the msi installer is setup to install to :8080 by default, and there is a custom dialog which allows users to provide a custom port. When they do, two things happen:

  1. I update an app.config file and set the updated port information from the user
  2. i try to use the UrlReservation and FirewallException tools from the wix toolset to do what is necessary to bring the application online.

This application hosts an owin self-hosted website, if that makes much difference.

my configuration is as follows to do this work:

  <Component Id="exe_Runtime" Guid="*" Directory="INSTALLFOLDER">
    <File Id="_exe_Runtime" KeyPath="yes" Source="..." />
    <File Id="_exe_Runtime_Config" Source="....config" />
    <util:XmlFile Id="SetConsolePort"
                  File="[#_exe_Runtime_Config]"
                  Action="setValue"
                  Name="value"
                  ElementPath="//configuration/appSettings/add[\[]@key=&quot;drey.configuration.consoleport&quot;[\]]"
                  Value="[CONSOLEPORT]" />

    <util:XmlFile Id="SetHordeDirectory"
                  File="[#_exe_Runtime_Config]"
                  Action="setValue"
                  Name="value"
                  ElementPath="//configuration/appSettings/add[\[]@key=&quot;WorkingDirectory&quot;[\]]"
                  Value="[FLDR_APPDATA]" />

    <!-- Opens the console port -->
    <http:UrlReservation Url="http://+:[CONSOLEPORT]/" HandleExisting="ignore">
      <http:UrlAce SecurityPrincipal="Everyone" Rights="all" />
    </http:UrlReservation>

    <!-- Opens the firewall for incoming connection(s) -->
    <fire:FirewallException Id="_exe_runtime_FWX1" 
                            Name="xxx" 
                            Port="[CONSOLEPORT]" 
                            Protocol="tcp"
                            IgnoreFailure="yes" 
                            Scope="any" 
                            Profile="all" />

    <ServiceInstall Id="_exe_runtime_ServiceInstall"
                    Name="S3Client"
                    DisplayName="xxxx"
                    ErrorControl="normal"
                    Start="auto"
                    Type="ownProcess"
                    Vital="yes" />

    <ServiceControl Id="_exe_runtime_ServiceControl"
                    Name="S3Client"
                    Start="install"
                    Stop="both"
                    Remove="uninstall"
                    Wait="yes" />
  </Component>

Upvotes: 1

Views: 759

Answers (1)

Sean Hall
Sean Hall

Reputation: 7878

It's failing because of the space in the port (http://+:444 /). It would be hard for WiX to automatically fix this.

Upvotes: 1

Related Questions