ingvarius
Posts: 6
Joined: Thu Jun 04, 2009 9:00 pm

Unable to run EXE when uninstalling

I want to run an EXE prior to uninstalling an application, with a certain parameter. This EXE resides in the application folder, where the program is installed.
I have added a predefined action under InstallExecuteSequence\Begin
Now - I can run it just fine when hard coding the "Command Line" property under General Properties, like this:
"c:\Program files\My Company\My Project\My Executable.exe" /MyArgument
What my problem is - no matter what variables i use, like [Appdir] with and without quotes, [#MyApplication.exe] etc., it simply won't work, the uninstaller cannot find the EXE-file.

How do I solve this?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Unable to run EXE when uninstalling

Hi,

Perhaps the command line is incorrect. Please note that you can use the "Edit" button to add references to files or folders. Also, in the dialog shown by this button you can right-click in the field and use the "Resolved Value" option to see the resolved command line.

For what you need you can try using a New Installed Custom Action scheduled under "InstallExecuteSequence" -> "CostFinalize". In the "Command Line" field from the "Custom Action Properties" pane you can specify only the arguments you want to pass to the EXE. Since the custom action runs during uninstall, it should use the condition:

Code: Select all

REMOVE = "ALL"
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ingvarius
Posts: 6
Joined: Thu Jun 04, 2009 9:00 pm

Re: Unable to run EXE when uninstalling

cosmin wrote:In the "Command Line" field from the "Custom Action Properties" pane you can specify only the arguments you want to pass to the EXE.
When I do this, I get a message telling me that Windows cannot find "/Uninstall"

This works during installing:
Command line: "[#MyApplication.exe]" /Install

This does not work during uninstalling:
Command line: "[#MyApplication.exe]" /Uninstall
Still we are not able to run an EXE-file in the directory we want to remove during uninstallation. It is crucial to run this applications, with the /Uninstall parameter. It is apparent that the unistaller does not find this executable (EXE-file), whereas it has no problems finding it during installation.
Any ideas are most welcome.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Unable to run EXE when uninstalling

Hi,

Did you try using an Installed custom action like I explained in my previous post? Please note that paths created by the installation process can be accessed only after the "CostFinalize" standard action, so you can try moving the custom action under "CostFinalize". If the problem persists, please send us the AIP you are using to support at advancedinstaller dot com so we can investigate it?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ingvarius
Posts: 6
Joined: Thu Jun 04, 2009 9:00 pm

Re: Unable to run EXE when uninstalling

Thanks,

CostFinalize is the right place to add an Installed Custom action in this case, yes.
By doing this, I am able to execute an application is the Application folder (the folder I am about to uninstall), before the uninstaller checks if any of the installed applications are running and starts to complain about this.

Return to “Common Problems”