仅在启动服务之前的自定义操作

时间:2013-01-30 04:56:56

标签: wix windows-installer custom-action

我正在尝试在启动服务之前运行自定义操作。

现在我正在这样做。

<Custom Action="Parameter7" Before="Action7">LANGUAGE = "United States - English"</Custom>
<Custom Action="Action7" Before="StartServices" >LANGUAGE = "United States - English"</Custom>

我有启动服务的代码

 <Component Id="START_SERVICE" Guid="13A5B40E-569D-49f5-A0DD-FDE659DAB11B">
        <ServiceControl Id="StartService" Start="install" Stop="both" Name="LRSAS" Wait="yes" />
 </Component>

我希望看到'Action7'在仅启动服务之前运行的结果(仅在安装时),但似乎卸载时也会运行Action 7。

对此有何想法?

2 个答案:

答案 0 :(得分:1)

从技术上讲,ServiceControl与Component绑定,只有在安装了Component时才会运行。如果你想要完全准确,你的条件也应该检查组件的动作状态。

未安装且$ START_SERVICE&gt; 2 AND LANGUAGE =“美国 - 英语”

答案 1 :(得分:0)

好的,我必须将我的代码更改为此。 :)

  <Custom Action="Parameter7" Before="Action7">NOT Installed AND LANGUAGE = "United States - English"</Custom>
  <Custom Action="Action7" Before="StartServices">NOT Installed AND LANGUAGE = "United States - English"</Custom>