【问题标题】:How can I disable the WebSite action in Wix when no web features are selected?未选择 Web 功能时,如何禁用 Wix 中的网站操作?
【发布时间】:2010-12-15 12:03:46
【问题描述】:

Wix 网站操作 has to be specified outside of a Component 如果您想安全地使用默认网站(安全地我的意思是安装程序不会在卸载时删除默认网站)。

<Fragment>
    <iis:WebSite Id="DefaultWebSite" Description="Default Web Site" Directory="INSTALLDIR">
        <iis:WebAddress Id="AllUnassigned" Port="80" />
    </iis:WebSite>
</Fragment>

我的安装程序有很多功能,其中一些仅在安装 IIS 时才启用。禁用基于条件的功能可以正常工作,并且不会创建虚拟目录或站点,但在安装过程中 MSI 仍会由于 WebSite 操作而尝试联系 IIS,并且在未安装 IIS 的计算机上失败:

"Cannot connect to Internet Information Server. (-2137221164      )"

我发现了一些关于 SKIPCONFIGUREIIS 的信息,但这似乎在 Wix 3 中不起作用。

【问题讨论】:

    标签: iis wix windows-installer


    【解决方案1】:

    这让我免于许多悲伤!只是想补充一点,无论安装状态如何,上述内容都会在卸载时跳过 IIS 配置。 IE。如果安装了该功能,则卸载时不会从 IIS 中删除虚拟目录。

    这似乎对我有用:

    <InstallExecuteSequence>
        <!-- Disable ConfigureIIS if we don't need it: -->
        <Custom Action="ConfigureIIs" After="InstallFiles"><![CDATA[&Web=3 OR !Web=3]]></Custom>
    </InstallExecuteSequence>
    

    【讨论】:

      【解决方案2】:

      我设法在 Wix 3 中使用 InstallExecuteSequence 中的自定义操作条件支持解决了这个问题。此示例假定“Web”功能是唯一需要我们执行 IIS 操作的功能:

      <InstallExecuteSequence>
          <!-- Disable ConfigureIIS if we don't need it: -->
          <Custom Action="ConfigureIIs" After="InstallFiles">(&amp;Web = 3)</Custom>
      </InstallExecuteSequence>
      

      【讨论】:

      • 啊,Wix 的无限奥秘。
      • 未解决对“产品:*”部分中符号“CustomAction:ConfigureIIS”的引用。
      • @NineTails 它区分大小写,所以它的 ConfigureIIs 不是 ConfigureIIS
      【解决方案3】:

      我刚刚查看并发现,在 WIX 生成的 MSI 中,条件 NOT SKIPCONFIGUREIIS AND VersionNT &gt; 400 与 InstallExecuteSequence 表中的 ConfigureIis 行相关联。

      换句话说,您也可以像这样使用自定义操作:

      <InstallExecuteSequence>
        <!-- Disable the ConfigureIIs action if we don't need it: --> 
        <Custom Action="CA.SkipConfigureIIs" 
                After="InstallFiles">NOT &amp;F.IisFeature = 3</Custom>
      </InstallExecuteSequence>
      
      
      <CustomAction Id="CA.SkipConfigureIIs"
                    Property="SKIPCONFIGUREIIS"
                    Value="1"
                    Return="check" />
      

      【讨论】:

      • 谢谢,我认为 SKIPCONFIGUREIIS 位适用于 Wix 2?
      • 它仍在我的 MSI 中,我使用的是 3.0.5419.0。
      猜你喜欢
      • 1970-01-01
      • 2011-03-24
      • 1970-01-01
      • 2010-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-07
      相关资源
      最近更新 更多