PDA

View Full Version : Stopping Windows Services



NewsArchive
10-07-2008, 01:44 AM
Hi Friedrich,

I remember that SB could stop a window service before installing/overwrite
it. Suddenly (cannot remember when) this does not work anymore so the user
is prompted to reboot when installing an update of the service. I am not
even sure if it ever worked?! Do I miss something obvious?

Script and/or install available - just le me know

Regards,
Hanspeter Stutz
ARCO Software AG

NewsArchive
10-07-2008, 01:45 AM
Hi Hanspeter,

Nothing changed in that area for more than 18 months now, so whatever it is,
it's not caused by SetupBuilder <g>.

You can try the "Service.sb6" demo. It installs, starts, then stops and
removes a service.

Hope this helps.

Friedrich

NewsArchive
10-07-2008, 01:45 AM
Hi Hanspeter,

BTW, there is also a "Check Service..." function to see if the service is
still running.

And I would suggest to check the error code values returned from stop/remove
service.

Friedrich

NewsArchive
10-07-2008, 01:46 AM
Hi Friedrich,

Ok got it - I inserted a message showing the errorcode right after "Stop
service". This display 0 BUT rest of the install went fine (no reboot
required). So I insert a sleep call instead of the message and that is also
working fine. I suppose some timing problem....

OTOH, I stop the service right before I install the files. What'd be the
correct location in the script to do it (didn't find your example)?

Thanks again
Hanspeter

NewsArchive
10-07-2008, 01:47 AM
Hi Hanspeter,

> Ok got it - I inserted a message showing the errorcode right after "Stop
> service". This display 0 BUT rest of the install went fine (no reboot
> required). So I insert a sleep call instead of the message and that is
> also working fine. I suppose some timing problem....
>
> OTOH, I stop the service right before I install the files. What'd be the
> correct location in the script to do it (didn't find your example)?

The script makes use of the "What You See Is What Get" method. So you can
handle it wherever you want (before the service update). Right after the
"Display Setup Progress Dialog" function, or before the first "Install
File(s)..." function or right before the service file.

See attached source screenshot. It stops the service and after that checks
if it is still active. If this is the case, it "sleeps" for 2 seconds to
give the service some time. Then it checks again (for a maximum of three
loops).

Does this help?

BTW, the service example is in the Example Projects package:
http://www.lindersoft.com/downloads_licensed.htm
http://www.lindersoft.com/sb6_Examples.exe

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
10-07-2008, 01:48 AM
Hi Friedrich,

> See attached source screenshot. It stops the service and after that
> checks
> if it is still active. If this is the case, it "sleeps" for 2 seconds to
> give the service some time. Then it checks again (for a maximum of three
> loops).
>
> Does this help?

That's perfect, thank you!!!
Hanspeter