0

我正在使用 WiX 3.10。我有一个特定的场景,其中在启动条件之前发生了一些自定义操作,因为在启动条件期间,我评估在这些自定义操作期间设置的某些属性。但是,在启动条件下,我还必须检查 .Net 框架的版本。问题是,如果我没有所需的 .Net Framework,自定义操作会在达到启动条件之前执行,并且不会向用户显示消息。

我可以按特定顺序执行启动条件,还是必须更改自定义操作才能在启动条件后执行?我需要帮助。不是 WiX 专家。

参考代码:

<!--Need to execute this first-->
    <PropertyRef Id="NETFRAMEWORK35" />
      <PropertyRef Id="WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED" />
      <Condition Message="This application requires .NET Framework 4.6. Please install the .NET Framework then run this installer again.">
        <![CDATA[Installed OR (NETFRAMEWORK35 = "#1" AND WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED)]]>
      </Condition>

<!--Need to execute this second.  It is execute first through custom action-->
      <PropertyRef Id="SQLSERVERMISSINGREQUIREDSERVICES"/>
      <Condition Message="Please install the following SQL Server services for the SQL Server instance: [SQLSERVERMISSINGREQUIREDSERVICES]. Then run this installer again.">
        <![CDATA[Installed or NOT SQLSERVERMISSINGREQUIREDSERVICES]]>
      </Condition>

<!--Need to execute this third. It is execute second through custom action-->
      <PropertyRef Id="SQLSERVERMAJORVERSION"/>
      <PropertyRef Id="SQLSERVERMINORVERSION" />
      <Condition Message="The GSL server requires a 2008 R2, 2012, or 2014 instance named 'GSLSQL' to be installed on the local server.">
        <![CDATA[Installed OR (SQLSERVERMAJORVERSION = "#10" AND SQLSERVERMINORVERSION >= "#50") OR SQLSERVERMAJORVERSION = "#11" OR SQLSERVERMAJORVERSION = "#12"]]>
      </Condition>
4

1 回答 1

2

按照 LaunchCondition 文档中的建议,对此类条件进行排序的一般方法是将启动条件替换为 19 类自定义操作。这与描述错误的错误表中的错误消息一起使用,并且 CA 本身以属性值为条件。

于 2018-08-27T19:05:26.417 回答