Reputation: 2750
I have an sc command that I would like to run using the Visual Studio 2012 InstallShield version in the "After Register Product" custom action. I have opted for "New Exe" for the executing action. I've selected "File Exists on Target Computer" for the source location. For the "File Location" I've entered "[SystemFolder]". For the "File Name and Command Line" I have, approximately,
sc.exe create ABC binPath= "[INSTALLDIR]abc.exe" DisplayName= "ABC Service" start= auto
. When I run the installer it fails. I'm at a loss as to the cause.
Upvotes: 1
Views: 4072
Reputation: 708
Had similar problems in the past. Solved in another way, CA type: Deferred execution in system context
, Working Directory SystemFolder
:
cmd.exe /c "[WindowsFolder]system32\sc.exe delete [SERVICENAME]"
Upvotes: 2