Control Service stop and delete not working.

Got a problem you cannot solve? Try here.
Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Control Service stop and delete not working.

Postby Frank » Wed Jul 21, 2010 6:59 am

I'm trying to stop two services which accompany our software. This must be done when the software is uninstalled.
This should happen in the Perform uninstallion region.

This region has two lines:

Code: Select all

Control Service OurFirstService: stop and delete on uninstall
Control Service OurSecondService: stop and delete on uninstall

followed by

Code: Select all

Apply Uninstall

The services are neither stopped nor removed (I can stop them from within the services console). What is going on?
Is this the 'wrong' region to put things? I've tried putting them in the First time installation expecting it to be a setting retained until the uninstall takes place, but that also didn't do it.

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Control Service stop and delete not working.

Postby bokkie » Wed Jul 21, 2010 8:35 am

Frank,

I've never had a problem stopping and uninstalling a service and I've done quite a few. As an idea, could you create a new project, one that does next to nothing but implements the control service to do the stop and uninstall? That way, you'll see if you're missing some important bit of code?

Also, I've had some spooks in the past where I had to reboot the machine and on one or two occasions I've had to search the registry and nuke any orphaned references to the service name, again with a reboot after. When you run your uninstall what happens if you try to start the service? If it throws an error, chances are your registry is spooked hence a bit of rape and pillage in the registry might be needed.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Re: Control Service stop and delete not working.

Postby Frank » Thu Jul 22, 2010 1:09 am

I've created a new project with just one task. Install the service. And it works 8).
Run the project again and it needs to stop and uninstall the service. It doesn't work :x

What it does is remove the executable which is the service, but when you look at it's status in the "Services" console, it's still there! It status is still "Started"!

If you try to restart the service you'll get a:

Code: Select all

Error 3: The system cannot find the path specified

Well duh! Even after rebooting the system the service is still in the "Services" console, but ofcourse it's not startable (see above)

If I wanted to find out if there are spooks in the registry, what/where/who/how would I be looking at? Because with frustration running high, there nothing like a bit of rape and pillage :)

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Control Service stop and delete not working.

Postby bokkie » Thu Jul 22, 2010 3:39 am

Frank, if you need to nuke your registry search for your sevice's display name as you've entered it in your IA project. Before you do that another idea to ponder upon comes to mind. I presume you've added a control service to your project? If so have you set the the pulldown in the lower half of the dialog (under the Control: label) to "Stop and delete the service on uninstall"? I created a new service about an hour a go and I got exactly the same symptoms as you described. Once I set it to that in the pulldown it uninstalled successfully. I think the default setting if you don't change it leave the service registration "installed". Is it as simple as that?
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Re: Control Service stop and delete not working.

Postby Frank » Thu Jul 22, 2010 5:49 am

Hi Peter,

Nope, not that simple I'm afraid. I'm using (see my first post) the correct option.
What I'm unsure of is when this option need to be applied.During installing a "Install Service" is followed by a "Control Service" with the option "Start the service on install". This gives the desired effect of the service actually running after installation.

Now if I uninstall I'm using "Control Service" with option "Stop and delete the service on uninstall". The stopping and deleting doesn't seem to happen which can mean two things:
1. It's not the correct usage of the "Control Service" command in the install/uninstall cycle (I also tried a "Apply Install" prior to calling "Control Service" with the "Delete" option, followed by "Apply Uninstall")
2. I should set "Control Service" once, not twice as I have now. See original post for regions involved.

I've tried item 2 and see no improvement. So I call during installing Control Service with 'Stop and delete the service on uninstall'. This will install my service, but not start it. Worst even, when uninstalling this service is not removed!!!

Enough to get foam around the mouth :evil:

Anyway! Since the "Install Service" is overwritten any previous service with the same name, it means that it's updated with every new version. But if the user uninstall he's left with some not existing service entries. Not the end of the world and for now I done fighting this...unless you have a brilliant new angle to approach this. 8)

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Control Service stop and delete not working.

Postby bokkie » Thu Jul 22, 2010 6:20 am

The last spontaneous thing that comes to mind, the service is installed and uninstalled using the same service name. Are your names truly identical, no hidden characters or other whitespace, that sort of thing?

If that holds true which it seems is the case, I'd be tempted to load six-rounds in your Yosemite Sam pistol and start blowing your registry to shreds (mind your feet). As I mentioned, you can search the registry for your service name and delete the items you're able to. I think most will be found in one of the ControlSets but that might differ OS-to-OS. The service management console usually caches the service descriptors initially on power-up, hence a reboot is often required after you've shot, ragged, bagged and shagged your registry. I'll be happy to zip up and post you my basic package that works on my laptop if that helps. I can only do that later this evening (UK time).
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Re: Control Service stop and delete not working.

Postby Frank » Thu Jul 22, 2010 7:40 am

I was under the impression that the Services Control Panel was 'realtime'. As soon as the service is installed, it appears (I deleted it using sc.exe delete [ServiceName]) and it updates it's status. So I hoped that it was the source of my problems, namely wrong assumptions based on Services Control Panel. It's not...

Pistol loaded. Commence firing...

I found some particular interesting stuff in there:
a) I'm testing with the test project holding one of the services as being used in the orginal project. To my surprise, there are still references to it (or rather were)
b) I can't delete a certain key (I've deleted everything else). HKLM\SYSTEM\ControlSet002\Enum\Root\LEGACY_HPCLIENT. Were HPClient is the service under scrutiny.

Now when I try to install the service again (with everything deleted from the registry except the key above. I get a "fatal error during installation" :(

This error is gone when rebooting the machine, so it might connected to the 'undeletable'. After that it's business as usual (so no stop/delete of the service on uninstall)

So, yes please, do post the package (maybe it can be attached to this post). That'll give me a benchmark. I'll move on from there (or shoot myself, my gun's loaded anyway :) )

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Control Service stop and delete not working.

Postby bokkie » Thu Jul 22, 2010 1:13 pm

Frank, I'll have to do that in the morning now as all my stuff is at work. I'll also review your thread and see if anything else comes to mind. I'm hopeful I'll be able to give you something that works out of the box as it can be frustrating dealing with "it works ok on my machine" scenarios. Until then, keep that pistol by your side and make sure you brush your red forked-beard before you turn in for the night.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Control Service stop and delete not working.

Postby bokkie » Fri Jul 23, 2010 1:34 am

Frank,

If the zip file makes its way to the forum for download, you'll find it contains a very simple .Net 2008 project and the IA9 R2 SP3 installation project. It's possible you can open it in the vanilla-flavoured IA9 R2 version but I don't know. I also use the Studio edition but I suspect you have that or the developer edition anyway? Either way, the project is basic. The .Net project contains the ready built .exe which I built using the 3.5 framework. I guess you have it installed but if not change it in the project properties to use an earlier one. By the way, restore the folder in the zip file into C:\Temp as that's where my IA project looks for the exe file.

Open and build the IA project and run it. It installs a blank service called ----> Test so you'll see it listed at the top of the services management console. For brevity you only need to look in the Services node. There, you'll see the service is installed and there's nothing maniacal about that. You'll also see two controller entries to start the service on installation and the other to stop and delete it on uninstallation. I've kept it as basic as possible so hopefully that'll give you a sort of base line to test your problem against. I hope it's of use when investigating your issue.
Attachments
TestService.zip
(358.19 KiB) Downloaded 436 times
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Re: Control Service stop and delete not working.

Postby Frank » Thu Jul 29, 2010 2:43 am

That's odd. I never received an e-mail that your reply with the demo code was in.
Oh well, probably deleted it by accident. :oops:

Anyway, thanks for this, I was on the forum to ask about it.
I'm going to have a go at it, but currently I'm pre-engaged with bugfixing the software and not the installer.
I'll let you know how it worked out for me.
Thanks again

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Control Service stop and delete not working.

Postby bokkie » Thu Jul 29, 2010 9:59 am

Okey-dokey, Frank.

While your're fixing bugs have a look for Shroedinbug and Heisenbug. They (and others) offer some funny but potentially unsettling insights into the development process. :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Re: Control Service stop and delete not working.

Postby Frank » Tue Aug 31, 2010 7:57 am

A sign of life! I've crawled from the depths of bugfixing to resurface :mrgreen:
Finally I was able to test your project. To cut it short, it fails :o

Although there is an obvious difference in what I was doing and what you are doing in you project, it still doesn't work.
The difference is the fact that you call both

Code: Select all

Control Service ----> Test: stop and delete on uninstall [wait for completion]
Control Service ----> Test: start on install [wait for completion]

from within the Region Perform First Time or Maintenance Installation
where as I called

Code: Select all

Control Service ----> Test: start on install [wait for completion]

from within the Region Perform First Time or Maintenance Installation
and

Code: Select all

Control Service ----> Test: stop and delete on uninstall [wait for completion]

from with the Region Perfrom Uninstall

But like I said, no difference in behaviour. It installs just fine, but when deinstalling it doesn't remove it from the services console (it does delete the c:\temp\testservice\bin\debug\testservice.exe). Even after a reboot the service is still in the services console. :(

I've tried running your testproject on Win XP x64 and Win XP 32.
The Win XP x64 suggests that it did it's job, but it didn't remove the service from the service console
The Win XP 32 freezes during deinstallation.

Unless this is a known bug in IA9 (I've got Build Moya.052409) I give up!
I still have to do the upgrade, but I don't expect anything from that...

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Control Service stop and delete not working.

Postby mills » Tue Aug 31, 2010 2:53 pm

The first thing to consider is that you will want to call the Control Service command before Apply Install instead of Apply Uninstall.

View Help (F1) index: "Setup Commands Preceding Apply Uninstall"
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Re: Control Service stop and delete not working.

Postby Frank » Wed Sep 01, 2010 8:26 am

Breakthrough! Well in a sense that Peter's project is now working... :lol:

I've installed IA9 (Build Moya.sp1.070409) and retried the project and finally, it's installing/deinstalling the service as requested.
I'll take Andy's remark into account while I try and debug my installer.

It would appear that my previous version (see this thread) had a bug or something.
Thanks for the support guys (and gals), I'll let you know how it worked out...

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Control Service stop and delete not working.

Postby bokkie » Wed Sep 01, 2010 10:25 am

That's great news Frank. Thanks for the attaboy slap on the shoulder.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 54 guests