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

标签 service installation wix wix3

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

最佳答案

AppSec Inc.社区 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”。

关于service - Wix3可以检查服务是否存在吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7638027/

相关文章:

javascript - AngularJS ui-router 无法解析服务调用

angular - Angular 2 服务何时初始化

installation - 如何安排使用MSI在下次重新启动时进行安装?

go - 如何为Golang程序配置服务守护程序文件

java - 如何让 Android 服务保持 phonegap 用户界面的活力

windows - 适用于 Windows 8 安装程序的适当图标

installation - 自动构建 inno 设置错误

installation - 如何使用 Inno Setup 安装程序升级 MSI 安装?

wix - wixpdb 文件有什么用?是否需要部署?

wix - wix主要升级未安装所有文件