Wix3有没有内置的方法来检查服务是否存在?我能想到的最接近的猜测是使用ServiceConfig并尝试检测故障。
发布于 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
<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”。
https://stackoverflow.com/questions/7638027
复制相似问题