2016-02-11 84 views
0

当在WiX 3.10.1中使用新模块来保留端口时,如果我保留在:8080上,它可以正常工作,但是当试图在另一个端口上保留时,比如444,它会失败。运行一个完整的日志从msiexec.exe的安装,我得到的是看起来相关的情况如下:HttpUrlReservation自定义端口失败

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. 我尝试使用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> 

回答

1

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

+0

很快。关闭找出我是否可以修剪自定义字段中的空格,除非你对此有什么建议? –