Does Wix 3 have a built in way to just check whether a service exi开发者_如何学编程sts? The closest guess I can come up with is using ServiceConfig and trying to detect a failure.
The AppSecInc. Community MSI Extensions has a Service_Exists custom action.
http://msiext.codeplex.com
Online Documentation:
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 is set to "1" if service exists, "0" otherwise.
精彩评论