【问题标题】:Can Wix3 check if a service exists?Wix3 可以检查服务是否存在吗?
【发布时间】:2011-10-03 16:44:16
【问题描述】:

Wix 3 是否有内置方法来检查服务是否存在?我能想到的最接近的猜测是使用 ServiceConfig 并尝试检测失败。

【问题讨论】:

  • 您可以检查注册表项。
  • 我也可以。我只是想知道是否有内置支持来检查服务。
  • 是的,我不知道。希望有。但是检查注册表项比 ServiceConfig 更容易。 :)
  • 你是对的。我想这就是我要做的。

标签: service installation wix wix3


【解决方案1】:

AppSecInc.社区 MSI 扩展有一个 Service_Exists 自定义操作。
http://msiext.codeplex.com

在线文档:
http://code.dblock.org/Source/msiext/1.2/Docs/_custom_actions_2_system_tools_2_service_impl_8h.html#a6fdcddc7b04a310a368c08726d3be6b3

<Binary Id="SystemTools" SourceFile="$(var.BinDir)\SystemTools.dll" />

<CustomAction Id="SetServiceName" Property="SERVICE_NAME" Value="Service1" />
<CustomAction Id="ServiceExists" BinaryKey="SystemTools" DllEntry="Service_Exists" Execute="immediate" Return="check" />

<InstallExecuteSequence>
     <Custom Action="SetServiceName" After="InstallFiles">NOT Installed</Custom>
     <Custom Action="ServiceExists" After="SetServiceName">NOT Installed</Custom>
</InstallExecuteSequence>

SERVICE_EXISTS 如果服务存在则设置为“1”,否则设置为“0”。

【讨论】:

    猜你喜欢
    • 2010-11-03
    • 1970-01-01
    • 1970-01-01
    • 2012-04-22
    • 1970-01-01
    • 2018-07-28
    • 2017-02-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多