Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Stopping and Starting Services
 

Stopping and Starting Services

Hi,

I need to be able to stop a service at the beginning of my installation before copying files and then restart the service afterward. Can someone tell me how that can be accomplished? I'm new to installers and I'm finding the documentation to be unfriendly.

Thanks,

T

tjams  Tuesday, November 20, 2007 7:09 PM

There's no support in Visual Studio for either running code before the install or for controlling services using the built-in support in MSI. The "normal" way to do this is to just add the service name to the ServiceControl table with whatever method is offered by the tool'sIDE :

http://msdn2.microsoft.com/en-us/library/aa371634.aspx

that stops services early in the install and then restarts them after the files have been installed. Since Visual Studio does't support this you'd have to use Orca.

The documentation and associated utility here might help you see how it works:

http://www.installsite.org/pages/en/msi/tips.htm"Installing Services with Visual Studio".

PhilWilson  Tuesday, November 20, 2007 7:26 PM

There's no support in Visual Studio for either running code before the install or for controlling services using the built-in support in MSI. The "normal" way to do this is to just add the service name to the ServiceControl table with whatever method is offered by the tool'sIDE :

http://msdn2.microsoft.com/en-us/library/aa371634.aspx

that stops services early in the install and then restarts them after the files have been installed. Since Visual Studio does't support this you'd have to use Orca.

The documentation and associated utility here might help you see how it works:

http://www.installsite.org/pages/en/msi/tips.htm"Installing Services with Visual Studio".

PhilWilson  Tuesday, November 20, 2007 7:26 PM

You can use google to search for other answers

Custom Search

More Threads

• installation procedure
• Deploy DLL
• VS2005 Setup & Deployment Projects cannot build.
• Auto update
• Custom ClickOnce uninstall tasks
• ClickOnce prerequistes fail to install on Vista
• Conditional property in Windows Installer
• store only one version of the Clickonce application
• Smart Client build issue after reinstalling VS2005
• How to stop application execution before installation completes?