In a basic MSI project, how do I start a service during install phase and how do i stop the service when the user uninstalls the appl??
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
How do I start/stop a service?
Started by
YaI
, Feb 21 2007 11:51
4 replies to this topic
Posted 21 February 2007 - 14:14
Check out the ServiceInstall and ServiceControl tables. ServiceControl is used to control already installed services (start, stop, delete), ServiceInstall is used to install services.
Regards
-Stein Åsmul
-Stein Åsmul
Posted 22 February 2007 - 06:07
I've created a service in Control NT Services. I've set the value of UninstallStop and UninstallDelete to Yes. After uninstall, in the computer mangement window, I find the startup type of the service is disabled. The service is neither stopped nor removed from the list of services. The status of the service is still "Started". How do I remove the service??
Edited by YaI, 22 February 2007 - 06:11.
Posted 22 February 2007 - 08:54
I have seen this happen and when it does you need to do a reboot to check what the status of the service is afterwards. Did you enable the "Wait for operation to complete" feature? You must obviusly wait for a service to be stopped completely before it can be successfully deleted.
Regards
-Stein Åsmul
-Stein Åsmul
Posted 23 February 2007 - 03:16
in the installation sequences in Execute there is a Stop Services and Start Services standard actions you can use it and put some conditions. Or you can just make a custom action to start and stop services or you could simply add this to your code.
For example i will stop and start the spooler
ServiceStopService("Spooler");
Delay(5);
ServiceStartService("Spooler","")
Delay(5);
For example i will stop and start the spooler
ServiceStopService("Spooler");
Delay(5);
ServiceStartService("Spooler","")
Delay(5);