首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wix3可以检查服务是否存在吗?

Wix3可以检查服务是否存在吗?
EN

Stack Overflow用户
提问于 2011-10-04 00:44:17
回答 1查看 1.2K关注 0票数 3

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

EN

回答 1

Stack Overflow用户

发布于 2011-12-16 18:29:38

AppSecInc。Community 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

代码语言:javascript
复制
<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”。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7638027

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档