rustyshelf
Posts: 6
Joined: Thu Mar 30, 2006 1:55 am

batch file question

Hi,

I have done some searching on this forum, and I understand that in order for an installed batch file to be run during the install phase, it must be set to 'deferred' so it can actually be there.

I'm trying to figure out how to run a batch file on uninstall. It seems that no matter which option I choose, it doesn't get run. Is that because it has been removed at this point? Is there any way to get around this?

thanks,

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

Hi,

You can put the BAT file to be executed on "Unistall" action by adding an "Exe with working dir" custom action. Use "Deferred" as an "Execution Options".

However you can also put the BAT file to be executed on "RemoveFiles" action.

You can add this on "Custom Actions" page by right clicking on "InstallExecuteSequence" and choose "Show Standard Action->Before File Instalation->RemoveFiles".

On "RemoveFiles" add "New custom action->Exe with Working Dir" and edit the "Full Path" ComboBox with the formatted path of your batch file (Ex: [#test.bat]).

Use the following options for the cutom action:

1. Synchronous execution, ignore return code.
2. Immediate execution, this means that this CA is executed immediately as it is encountered in the InstallExecuteSequence table.
3. Always Execute.
4. As a condition choose REMOVE="ALL", this means that this custom action runs only when the product is uninstalled.

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

Return to “Common Problems”