/build/static/layout/Breadcrumb_cap_w.png

Uninstall a service from within an MSI package

I will be upgrading JRE using GPO to deploy. However, due to problems with the JavaQuickStarterService, the installation hangs waiting for user input to stop it. One solution is to uninstall the existing service using the ServiceControlTable in the MSI (or in my custom MST) and this is what I'm trying to achieve.

The information provided on MSDN is sparse and complicated for the non-developer, but I've had a go anyway, but still can't understand what I need to do for the "component_" part of the table entry. This is what I have so far in the ServiceControl table:

[blockquote][font="courier new"]ServiceControl: JavaQuickStarterService
[font="courier new"]Name: JavaQuickStarterService
[font="courier new"]Event: 0x0008
[font="courier new"]Arguments: <null>
[font="courier new"]Wait: <null>
[font="courier new"]Component_: <<< What do I need to do here? >>>
[/blockquote]
Many thanks,
Steve

0 Comments   [ + ] Show comments

Answers (9)

Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
Hi Steve,

You need to associate the ServiceControl action with a component from the component table.. you could use an exising component or create a new one. If you are creating a new component, make sure you also link it to an appropriate feature in the FeatureComponent table.

You could alternatively use a custom action to stop or even remove the service.. use a VBScript or net stop or the sc command if you want to stop and to remove it... just make sure you build in some error checking.

Cheers,
Rob.
Posted by: anonymous_9363 15 years ago
Red Belt
0
Searching through past posts, I found this http://itninja.com/question/gnu,-freeware-and-shareware-programs-to-cloning1786&mpage=1&key=jqsꎈ
Posted by: essdeeay 15 years ago
Senior Yellow Belt
0
Thanks for that link to the other post. I think it contains the answer, but what I try, doesn't work. Taking information from that post:

The following entry already exists in the the 'CustomAction' table:
[blockquote][font="courier new"]Action Type Source Target
UninstallJQS 0x0c11 regutils.dll MSIUninstallJQS
[/blockquote]The following entry already exists in the 'InstallExecuteSequence' table:
[blockquote][font="courier new"]Action Condition Sequence
[font="courier new"]UninstallJQS MODE="U" 3173
[/blockquote]The poster was asked to: "Try creating a CA called, say, 'ForceUninstallJQS' as near the end of the Execute sequence as you can.and with more or less the same parameters except for the condition. Make the condition for 'ForceUninstallJQS' to be 'NOT Installed'."

This apparently worked but not for me, perhaps I'm not understanding it properly. This is what I've now added:

Property table
[blockquote][font="courier new"]Property Value
[font="courier new"]JQS 0
[/blockquote]InstallExecuteSequence table:
[blockquote][font="courier new"]Action Condition Sequence
[font="courier new"]ForceUninstallJQS JQS="0" 3184
[/blockquote] CustomAction table:
[blockquote][font="courier new"]Action Type Source Target
[font="courier new"]ForceUninstallJQS 0x0c11 regutils.dll MSIUninstallJQS
[/blockquote]
My intention here is to twofold:

(i) To prevent the JavaQuickStarterService from being installed
(ii) To uninstall it if it's already installed

Two things:

If the service is installed, it's not being removed (Ack!)
If the service is not installed, it's not being installed (Woohoo!)
...but then when I try to uninstall, it fails with an non-informative error (Ack!)

I've attached an image showing the transform table - is there anything I'm missing or doing wrong?

Many thanks again,
Steve



[blockquote]
[/blockquote]
Posted by: essdeeay 15 years ago
Senior Yellow Belt
0
Thanks for the tip Rob. I thought I'd give the other suggestion a try, and basically allow the MSI to uninstall the service itself (see later posts).

Cheers,
Steve :)
Posted by: anonymous_9363 15 years ago
Red Belt
0
I should have corrected my old post! That condition should be "Installed" or "REMOVE~ ="ALL"" because, of course, we're UNinstalling. Sorry, my bad.

To prevent its installation, find the component which "contains" the service (or find the feature, if it's self-contained within a feature) and add an impossible-to-meet condition (I typically use '0=1') to that component or feature's installation.
Posted by: essdeeay 15 years ago
Senior Yellow Belt
0
Thanks again VBScab - I have followed your advice but I don't think I know where jqs.exe is being installed as a service from. I've had to use Orca to search the MSI as InstEd will only let you search on a per table basis, and this is what I've found (see below). Can oyu see where/how it's being installed in the first place? Perhaps the .exe file is installing itself as a service upon first run? I don't know.

I do appreciate your help - thank you.

Steve
[font="courier new"]
[blockquote][font="courier new"]TABLE: CustomAction

[font="courier new"]Action Type Source Target
UninstallJQS 3089 regutils.dll MSIUninstallJQS

[font="courier new"]TABLE: Directory

[font="courier new"]Directory Directory Parent DefaultDir
ff jqs ff
[font="courier new"]jqs deploy jqs
[font="courier new"]ie jqs ie

[font="courier new"]TABLE: InstallExecuteSequence

[font="courier new"]Action Condition Sequence
UninstallJQS MODE="U" 3173

TABLE: [font="courier new"]RemoveFile

[font="courier new"]FileKey Component FileName DirProperty InstallMode
[font="courier new"]jqs jz jqs 2
[font="courier new"]filejqs jz * jqs 2
[font="courier new"]jqsnotify.exe jz jqsnot* bin 2
[font="courier new"]jqs.exe jz jqs.exe bin 2
[/blockquote]
Posted by: anonymous_9363 15 years ago
Red Belt
0
The RemoveFile table shows you that JQS.EXE is part of the 'jz' component. Unfortunately, there's other stuff in there too, although that stuff may all be connected with the service.

- Switch to 'Setup Editor' view
- Go to the 'Component' table
- Find the 'jz' component
- Right-click it and select 'Details'
- In the 'Condition' field, enter '0=1' (without the quote marks, obviously)
- Test the install to see whether the service gets installed.
- Test with a Java app to make sure we haven't screwed with anything else.
Posted by: essdeeay 15 years ago
Senior Yellow Belt
0
As it's starting to get complicated, I went back to the old saying... "the simplest way that works", and I've succeeded. All that I *needed* to do was to make sure the 'JavaQuickStarterService' service was stopped before an upgrade took place. I did that by adding just one line to the ServiceControl table in the end, like so (I picked the jz component as that's the one where jqs.exe seems to live... don't know if it matters which component I pick):

[blockquote][font="courier new"]ServiceControl Name Event Arguments Wait Component_
[font="courier new"]StopJavaQuickStarterService JavaQuickStarterService 2 jz
[/blockquote]
I've tested multiple times installing update 10, seeing the JavaQuickStarterService running, even testing Java in a browser, then when I run the MSI for update 13, with an MST containing the entry above in the ServiceControl table, it updates flawlessly... and uninstalls correctly too.

One more question... the 'Event' entries for the ServiceControl table, are they stackable, eg. 2 = stop service during install, 32 = stop service during uninstall. Can I use 34 = stop service during both install and uninstall?

Many thanks again for your help (each of you) - this MSI stuff seems like a bit of a black art, I wouldn't mind being pointed to some "How to learn MSI" guides...?

Steve :)
Posted by: anonymous_9363 15 years ago
Red Belt
0
don't know if it matters which component I pick)You've added a Service Control element to the 'jz' component. I would have created a new component, e.g.:

Component,ComponentId,Directory_,Attributes,Condition,KeyPath
StopJS,{7E2B0C9F-DAB4-4BA9-B11D-43BD86F954D8},ProgramFilesFolder,0,"",""

Use a GUID generator to produce the 'ComponentId'. The Component name, in this case 'StopJS' would then go where you've used 'jz'.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ