Hello all,

how do I have to handle an installed and (possibly) runnig background service,
when I install an update over it?

Is STOPping that service sufficient or does I also have to REMOVE this service,
then, at the end of the installation, re-install and re-start it?

My idea is this:

at that begin of the installation process I check for the service to run:

For being installed
Set Variable %SERVICE_IS_INSTALLED% to FUNCTION:Check Service ("MyServer") [Is Installed]

For also running:
Set Variable %SERVICE_IS_RUNNING% to FUNCTION:Check Service ("MyServer") [Is Running]

Now:
If %SERVICE_IS_INSTALLED% Equals "1" Then
If %SERVICE_IS_RUNNING% Equals "1" Then
Run Command Line ("SC STOP MyServer") [Wait] [Show or not]
END
Run Command Line ("SC QUIT KiKSOAPServer") [Wait] [Show]
END

... now do a lot of fiddlefaddle ...

and finally at the end of the script, in the [ Execute Programs ]-section,
restoer the service according to the values from the top:

If %SERVICE_IS_INSTALLED% Equals "1" Then ! it WAS installed when we entered this process
Run Command Line ("x:\MyServer.EXE /iss") [Wait] [Show or not]
END


If %SERVICE_IS_RUNNING% Equals "1" Then ! it WAS also running when we entered this process
Run Command Line ("SC START MyServer") [Wait] [Show or not]
END

Now the state of the service should be restored to the same conditions at
starttime of the update-install.

Is that a possible way to handle the installation over an installed / running service?

Thanks in advance!


Regards,
Wolfgang Orth
www.odata.de

Please note:
From time to time it happens, that I overlook a reply to my postings.
Please don't be angry.
In case of an emergency, try to contact me via mail.

Bitte beachten:
Von Zeit zu Zeit passiert es mir, dass ich Antworten auf meine Postings übersehe.
Bitte nicht böse sein.
Im Notfall bitte Kontakt per Mail versuchen.