shoaibmughal84
Posts: 3
Joined: Sat Aug 12, 2023 9:59 am

Custom Action Conditions

Greetings,

I am trying to run a batch file (fileA.bat) during the installation process and one batch file (fileB.bat) during the uninstall process. The purpose of the fileA.bat is to copy some files to the designated target folder; fileB.bat is to remove those files during uninstallation. Logically, I have placed fileA.bat after the 'Add Resources' sequence so that it's already on the target system before the Advance Installer can access it. fileB.bat is placed after the 'Preparation' stage so the Advance Installer can execute it and remove it from the system.

Now what I need is to check for the conditions that fileA.bat and fileB.bat are actually on the target system before the Advanced Installer can execute them. If not then it will throw an error and rollback the installation/uninstallation.

So far what I have understood is to put in the condition !MainFeature = 3. So it that a right assumption (I have added fileA.bat and fileB.bat as MainFeature files).
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action Conditions

Hello,

If the custom actions run during the "Deferred" stage and have the "Fail installation if custom action returns an error" option checked, please note that your desired behavior will be achieved by default.

However, please note that only deferred standard actions can be rolled back. If you have any custom action that does modify the system, then you'd need to create your own custom rollback action to revert the changes.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”