ps
Posts: 14
Joined: Wed Mar 14, 2007 2:25 pm

Pre-requisite Removal

Hi,

I have two installation packages, the first is hosted on our site and downloaded by our customers. when this installer runs it has a pre-requisite that downloads another component from one of our vendors and installs it. I would like to enforce the same logic when the product is uninstalled, in other words I would like it to remove the third party package first before uninstalling our component.

Is this possible?

Thanks,

ps.
ps
Posts: 14
Joined: Wed Mar 14, 2007 2:25 pm

On a somewhat related note, how do I stop a running service? I see how to add it as a Standard Action but I'm not sure what to associate with it. I guess I'll probably find it if I keep searching the site but any help would certainly be appreciated....
ps
Posts: 14
Joined: Wed Mar 14, 2007 2:25 pm

Never mind regarding the service - there's a lot to learn but it's starting to come together. Some concept guides would be nice, nothing too verbose, just enough to cover the processing flow etc...

Still curious about the uninstalling product dependencies though...
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The only way to do that is with a custom action. But this is not a good practice since a prerequisite is not always installed (may already exist on the target computer) what you do in this case?

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
ps
Posts: 14
Joined: Wed Mar 14, 2007 2:25 pm

Gigi,

If we had our way the two packakges would be installed as one, the problem is that we're not legally allowed to distribute the first package because it contains code from another company. The compromise that we came up with was to place the third party code up on their ftp site which can be accessed from our installer. This package is a customized version of their product that would not be installed for any other reason than to support our package.

Or, in other words, we want to enforce the removal of the package since we're certain that it should not be used once our product is uninstalled.

How would I go about creating that custom action?

Thanks,

ps
ps
Posts: 14
Joined: Wed Mar 14, 2007 2:25 pm

Hey Gigi,

Sorry to seem impatient, I'm actually trying to put together a case to acquire the tool, this seems to be the last hurdle. The sooner I have something working, the sooner I can proceed.

Thanks again,

ps.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

If the package is a MSI package then you can use a custom action like this:

In the "Custom Actions" page "Add Predefined Custom Action ->Launch File or Open URL" type of custom action under "InstallFinalize" standard action (use "Show Standard Action" toolbar option to make it visible) and use following options for it:

Command Line: msiexec /x {E475FAAC-06CB-41B7-AE67-F8BD0E526DE1} /qn
Execution Properties: Asynchronous execution, do not wait for return
Execution Condition: (REMOVE="ALL")

Where {E475FAAC-06CB-41B7-AE67-F8BD0E526DE1} is the ProductCode of the package in question. You can find it (in the Property table) by opening the package with ORCA (tool that comes with Platform SDK). "/qn" parameter means the the uninstallation will be completely silent.

Hope this helps.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
ps
Posts: 14
Joined: Wed Mar 14, 2007 2:25 pm

Gigi,

Thank you, that worked well. I just have two small concerns;

(a) The Action required me to use a fully qualified path, which on my machine is c:\windows\system32\msiexec.exe, to the executable. I'm concerned about what will happen if windows is installed elsewhere. I tried changing the path in the window but it is disabled.

(b) This package gets its installation directory from the pre-requisite package as a registry search. If the user manually uninstalls the first package first, I will not be able to uninstall the second package. Can I prevent the first package from being uninstalled if the second package is not removed first?

Thanks again,

ps
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
Can I prevent the first package from being uninstalled if the second package is not removed first?
You can condition the uninstallation of the first package with the existence of the second one. To do that you can create a search (file or registry) in oder to detect if the second package is installed. Now in the first package you can create an "Error Message" custom action under "InstallValidate" standard action and use following execution condition:

Code: Select all

(REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE) AND SEARCH_RESULT)
Where SEARCH_RESULT is the property that keeps the result of the search. If this property is not empty then you can not uninstall the package.

If you encounter any problem please let me know.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”