Start and stop a service on upgrade.
Posted: Thu Feb 24, 2011 4:21 pm
Hi,
I have a simple installer, that installs a service and starts it when it is done.
To this end i have a run program set for "after install"
$windir$\net.exe
paramaters
start myservice
I also have a run program "Before uninstall"
$windir$\net.exe
paramaters
stop myservice
These run fine if you have clicked on the installer package and are installing or uninstalling the package. My problem is these commands are not run if I provided an updated installer and get the user to run it. What I need to happen is
1) stop old service
2) uninstall old service
3)install new service
4) start new service
The files are updated but because the "Run Program" events have not fired, the running version is still the old version. Is there a way to achieve what I need?
Steven
I have a simple installer, that installs a service and starts it when it is done.
To this end i have a run program set for "after install"
$windir$\net.exe
paramaters
start myservice
I also have a run program "Before uninstall"
$windir$\net.exe
paramaters
stop myservice
These run fine if you have clicked on the installer package and are installing or uninstalling the package. My problem is these commands are not run if I provided an updated installer and get the user to run it. What I need to happen is
1) stop old service
2) uninstall old service
3)install new service
4) start new service
The files are updated but because the "Run Program" events have not fired, the running version is still the old version. Is there a way to achieve what I need?
Steven