TomGarrett
Posts: 25
Joined: Fri Nov 16, 2007 12:44 pm

Uninstalling nested exe

Hello there,

I know that nested installations are not recommended, but in this project we need to ensure that a particular configuration has been chosen in the parent installer. So, if the user is installing a "Complete" installation, we'll launch a child installer.

The child installer is an exe because it itself has prerequisites such as the .NET 2.0 Framework.

So, I have no problem launching the child installer (Custom Action in InstallFinalize, Asynchronous, don't wait for return). Launched by calling an EXE with working dir, with [#childInstaller.exe].

The problem I'm getting is on uninstall, I want to remove the child installation if a complete installation is currently installed, and it's now being uninstalled (conditions: "REMOVE="ALL" AND COMPLETE_INSTALLED).
So, I have a "Search" which finds a registry key that only exists on Standalone installations. However, because my child installer is set to basic user interface, launching the exe again won't work. So, I tried to use "MsiExec.exe /X{143C93BE-DC76-4D13-80E7-D7CF6D33DB85} /qn" but that gives me an error. Using "MsiExec.exe /X[#childInstaller.exe] /qn" won't work either because I don't expect the temporary file to survive until the time of uninstall.

Help!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please note that the custom action which launches the uninstall of the child installation must be set under the "InstallExecuteSequence" -> "InstallFinalize" standard action. Also, this custom action must have the condition REMOVE="ALL" in order to be executed only during Uninstall.

Note that the standard actions in the "Custom Actions" page are also present in the uninstall process. Therefore the "InstallFinalize" of the installation is distinguished from the "InstallFinalize" of the uninstall process by the condition of the custom action (Not Installed or REMOVE="ALL").

Let me know if the problem persists even with the custom action scheduled under "InstallFinalize".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
TomGarrett
Posts: 25
Joined: Fri Nov 16, 2007 12:44 pm

Hi,

I had already taken all of those steps, but funnily enough, at the same time as your reply I finally fixed it.
The silent install through basic interface was a red herring, as was a malfunctioning condition check...it transpires that the problem was a lot more trivial than that.

I am using "Exe with working directory" and I had chosen the working dir as "Tempfolder/Auxiliary"...the mistake here was that "Tempfolder/Auxiliary" doesn't exist! So, I switched it for "Tempfolder" and it's now working!

Well, thanks anyway!

P.S. In case this isn't clear to other users, I added the exe to the files and folder, then added two actions "Exe with Working Directory and path given by a Formatted" for both the child install and uninstall.
Both of these actions live under "InstallFinalize".
Both are launched "Asynchronously" with no return.
Install only if "Not Installed", by simply calling the installer exe.
Uninstall if 'REMOVE="ALL"' by calling MsiExec.exe /X [ProductCode]

Return to “Common Problems”