HttpUrlReservation使用自定义端口失败

时间:2016-02-11 21:01:22

标签: wix wix3.10

当使用WiX 3.10.1中的新模块预留端口时,如果我保留在:8080,它可以正常工作,但是当尝试在不同的端口上保留时,例如:444,它会失败。从msiexec.exe运行安装的完整日志,我得到以下与该情况相关的内容:

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

在我的端口示例中,msi安装程序默认安装为:8080,并且有一个自定义对话框,允许用户提供自定义端口。当他们这样做时,会发生两件事:

  1. 我更新了app.config文件并设置了用户的更新端口信息
  2. 我尝试使用wix工具集中的UrlReservationFirewallException工具来执行使应用程序联机所需的操作。
  3. 此应用程序托管一个owin自托管网站,如果这有很大不同。

    我的配置如下:

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

1 个答案:

答案 0 :(得分:1)

由于端口(http://+:444 /)中的空间而失败。 WiX很难自动解决这个问题。