1

当使用 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工具来执行使应用程序联机所需的操作。

此应用程序托管一个 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>
4

1 回答 1

1

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

于 2016-02-11T21:17:42.047 回答