Summary
This article will discuss one possible method of manually closing a Windows Service using a custom action.
Synopsis
This article will discuss one possible method of manually closing a Windows Service using a custom action.
Discussion
To manually stop a windows service create the following Custom Action:
Type: New EXE , Path referencing a directory
Working Directory: SystemFolder
File Name and Command Line: cmd.exe /c "[WindowsFolder]system32\sc.exe stop NAME_OF_SERVICE"
Return Processing: Synchronous (Check Exit code)
In-Script Execution: Immediate Execution
NOTE: Closing Windows Services will require elevated privileges, the MSI will not elevate itself until after the InstallValidate action. Therefore care should be taken to place this custom action after InstallValidate if using a single MSI release.
If this custom action must be placed before InstallValidate we can force the MSI to run with elevated priviledges from the outset by using a Setup Launcher.
Within the setup.exe tab of your release make sure that the "Required Execution Level" is "Administrator".
This will force the setup.exe to request Admin priviledges which are then carried over to the MSI allowing the custom action to run earlier than InstallValidate.
Additional Information
Further information regarding the SC tool including its parameters can be found in the following Microsoft article:
http://support.microsoft.com/kb/251192
Related Articles
Problem: Lost Connection to Custom Action Server Process. Attempting to Regenerate. 5Number of Views Passing Argument To Powershell Custom Action 6Number of Views Launch InstallAnywhere Without a UAC prompt 3Number of Views "Unknown Publisher" on UAC Prompt when Uninstalling from Add/Remove Programs with a Signed Installation Package 5Number of Views HOW TO: Launch a bat file from INSTALLDIR/SUPPORTDIR using Custom Action 24Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago