>Hi Wolfgang,
>
>What about using the built-in "Edit Service..." script function to stop and
>restart the service?
>

Seems simpler, have not seen these (I think)

Is STOP and and RESTART sufficient? No need to REMOVE?

The process of running a service is a Windows OS thing, the installation is one
thing on its own by SB, so its independent. When the service is stopped, then
SB can stop the EXE from running, replace that file with the new version,
restart the EXE and _then_ advise the OS restart that service again, which is
actually the new EXE. This Services.MSC does not care, if an EXE is replaced,
while that service is stopped? Because Service.MSC does nothing more than
watching a list of services.

An INSTALL SERVICE puts an EXE onto that list.
A START SERVICE - well, yes, starts it, but can do only, if is was set onto the
list before.
A STOP SERVICE - aehh, well, aehh, yes - stops it. However, the EXE is still
running, because I can see it in the TaskManager. But SB takes care of that. SB
removes the running EXE, replaces it with the new from the installer, runs this
new EXE and then issues a START, which is nothing but telling the OS to
activate this EXE as a service again. Services.MSC looks on its list, sees my
EXE been listed and says "Oh yeah, the EXE is known to me, its running, lets
make it a service again!"

Is my impression correct?


>Detect an installed service. If it is installed and running, stop the
>service (give it a few seconds to close down, check again if it is running),
>then replace the service file(s) and restart it.

Like

LOOP ! with no limits or with some iterations
Set Variable %SERVICE_IS_RUNNING% to FUNCTION:Check Service ("MyService") [Is Running]
SET counter
IF %SERVICE_IS_RUNNING% = 0 ! then its not running anymore
BREAK LOOP
ELSE
some counter eval to issue a break, before the morning dawns
END
END

If I choose iterations, how many do you suggets? Is it based on
(milli/hundreths-)Seconds or just a raw number?

Number of Iterations
[in] Executes Number of Iterations times.
This can be a numeric constant, a compiler
variable or a runtime variable. Leave this
field empty if you wish the Loop to run
continuously. In such cases, you plan to
Break Loop based on some condition you
expect to always happen.

So, how fast is one LOOP-cycle, how long does it take between two cycles of a loop?


Sounds reasonable and actually what I wanted to achive. There are actually too
many options to pick from the right hand menu! <g>



Ich hab echt ein schlechtes Gewissen, dich zu löchern, denn Du solltest
eigentlich aufm Sofa liegen....

Ach, und wo ich grade dabei bin, ist meine Mail letzte Woche durchgekommen?

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.