This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- stopping services
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 03, 2012
03:38 PM
stopping services
Hi,
How do you stop various services and processes so you can update files using installscript or msi?
For example, I want to shutdown web services so I can update the assemblies.
Anybody know how to do stuff like that?
Thanks
GJ
How do you stop various services and processes so you can update files using installscript or msi?
For example, I want to shutdown web services so I can update the assemblies.
Anybody know how to do stuff like that?
Thanks
GJ
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 16, 2012
03:39 AM
'you can create an vbscript and call through an custom action
'you need to change the "NAME_OF_THE_SERVICE" to the internal service name not the service display name
'Stop Service
strServiceName = "NAME_OF_THE_SERVICE"
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name ='" & strServiceName & "'")
For Each objService in colListOfServices
objService.StopService()
Next
'you need to change the "NAME_OF_THE_SERVICE" to the internal service name not the service display name
'Stop Service
strServiceName = "NAME_OF_THE_SERVICE"
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name ='" & strServiceName & "'")
For Each objService in colListOfServices
objService.StopService()
Next