PDA

View Full Version : SelfService - how to kill the 'removed' service from the process list?



NewsArchive
12-20-2013, 06:58 AM
Hallo all,

I wrote a Service and a ServiceManager, which is intended to "Install & Start"
and "Remove" also.

The part "Install & Start" work okay.

When it comes to "Remove", I see in services.msc that the Service is
deactivated and the service is still listed in the Task-Manager.

That means, that I can't replace my MyService.EXE during an update, without
having rebooted before. After reboot the service is gone, both from the Service
Manager and the Process List.

I have not digged into Setupbuilder for the automatisms of removing and
re-installing, but I have concerns in case some manual maintainance is
neccessary on the remote machine.

Is there somenthing I have overlooked?

Regards,
Wolfgang Orth
www.odata.de

NewsArchive
12-20-2013, 06:58 AM
Hi Wolfgang,

This is a windows limitation (only rebooting removes it from the list).
However, you can still replace the physical exe if the service is disabled.

Geoff

NewsArchive
12-20-2013, 06:59 AM
>This is a windows limitation (only rebooting removes it from the list).

Glad to know that this was not my fault.

Maybe you add a hint into you docs, to ease poor souls like me? <g>

>However, you can still replace the physical exe if the service is disabled.

This seems to work......

I also experimented with batch-files like STOP.BAT and START.BAT, calling those
with RUN().

STOP.BAT
SC STOP MyServiceName

START.BAT
SC START MyServiceName

Works okay too. SC stands for ServiceConsole.

The advantage here is, that the window, which holds the SelfService-buttons,
does not get closed automatically.
I simply press the STOP-button, do some fiddling and press the START-button and I am done.

Thanks for your reply, Geoff!

bye,
Wolfgang

Regards,
Wolfgang Orth
www.odata.de

NewsArchive
12-20-2013, 07:09 AM
Wolfgang,

> I also experimented with batch-files like STOP.BAT and START.BAT, calling
> those with RUN().
>
> STOP.BAT
> SC STOP MyServiceName
>
> START.BAT
> SC START MyServiceName
>
> Works okay too. SC stands for ServiceConsole.

If you have to update the service from within the installer, you can simply
use the "Edit Service..." function. And "Check Service..." can be used to
detect installed/active services.

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

--Helping You Build Better Installations
--SetupBuilder "point. click. ship"
--Create Windows 8 ready installations in minutes
--Official COMODO Code Signing and SSL Certificate Partner

NewsArchive
12-20-2013, 07:09 AM
> If you have to update the service from within the installer, you can
> simply
use the "Edit Service..." function. And "Check Service..." can be used to
detect installed/active services.

I concur. This feature of SB works really well in our application.

Geoff

NewsArchive
12-20-2013, 07:12 AM
This is what we distribute with the application.

Written with Setupbuilder.

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.

NewsArchive
12-20-2013, 07:12 AM
Jeff, That is very cool. Would you care to share the code?

Regards,
Mike

NewsArchive
12-20-2013, 07:13 AM
I would be happy to, but it's not mine to share.

Nothing fancy. Just plain ol' setupbuilder.

I've attached a screenshot of the script. I'm sure that would help a
little.

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.

NewsArchive
12-20-2013, 07:14 AM
> This is what we distribute with the application.

I use a similar technique in a heartbeat app to stop/start services via a
SB quiet installer.
--

Mark Riffey
http://www.rescuemarketing.com
Now featured by Visa Small Business
If Guy Kawasaki, the staff of the Wall Street Journal,
Fast Company, US Bank, Marketing Profs & Business Week read it,
maybe you should too.

NewsArchive
12-20-2013, 07:14 AM
This app is usually used by System Admins when (if) there's ever a
problem. Usually, the users needn't concern themselves.

It's a lot easier than having them load up the services window and
dork around. Some admins are less adminny than others.

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.

NewsArchive
12-20-2013, 09:41 AM
Thank you. That should get me started.

Michael Melby

NewsArchive
12-20-2013, 09:41 AM
> It's a lot easier than having them load up the services window and
> dork around. Some admins are less adminny than others.

Yep. In this case, the heartbeat constantly monitors 2 URLs to see if the
HTTP service can be reached. An external URL monitoring service also
watches them and texts me if failures occur.

If the heartbeat app cant reach the http URLs, it uses the SB silent
installers to stop and restart the http service.

If after 3 minutes, none of that stuff worked and the http URLs are still
unreachable, a different SB silent installer forces a server reboot. This
server's only purpose in life is to run the http service, so thats ok.

Meanwhile, I get text messages throughout that process.
--

Mark Riffey
http://www.rescuemarketing.com
Now featured by Visa Small Business
If Guy Kawasaki, the staff of the Wall Street Journal,
Fast Company, US Bank, Marketing Profs & Business Week read it,
maybe you should too.