Stopping a Service with a Type 34 Custom Action

1.1k Views Asked by At

I'm creating an installer using wix and I need to stop a service during uninstallation. Here's my type 34 custom action:

<CustomAction Id="StopNP" 
              Directory="SystemFolder" 
              Execute="commit" 
              Return="ignore" 
              ExeCommand="[SystemFolder]cmd.exe net stop RemindexNP"/>

This is simply opening cmd.exe without running the commands I gave. Does anyone know how to actually run the 'net stop ' command in command prompt?

I've also tried these two custom actions together, with the same result:

<CustomAction Id="SetPathToCmd" Property="Cmd" Value="[SystemFolder]cmd.exe"/>
<CustomAction Id="StopNP" Property="Cmd" ExeCommand="net stop RemindexNP"/>

Any suggestions would be greatly appreciated

0

There are 0 best solutions below