Wix 3 是否有内置方法来检查服务是否存在?我能想到的最接近的猜测是使用 ServiceConfig 并尝试检测故障。
最佳答案
AppSec Inc.社区 MSI 扩展具有 Service_Exists 自定义操作。
http://msiext.codeplex.com
<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/