congnt92
Posts: 57
Joined: Wed Apr 16, 2014 7:53 am

Re: Uninstall Cleanup for registry

Hi,
Thanks for your quick reply, Eusebiu
I just want to remove "grub" folder in the rollback if batch file launch fail. If batch file work fine, the custom action which used to remove "grub" folder will not launch. Can I do that?
Beside, as I know, if batch file launch fail, the installer will stop. So the 2nd custom action (used to remove folder create by batch file) can't be run.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstall Cleanup for registry

Hi,

Exactly this will happen if you set the "During installation rollback" option for your custom action. It will be executed only when the installation fails, during the rollback execution time, otherwise, if the package is installed correctly, the custom action will not be executed.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
congnt92
Posts: 57
Joined: Wed Apr 16, 2014 7:53 am

Re: Uninstall Cleanup for registry

Hi,
Can u please help me check my project?
I change code of Make_dir.cmd file to make sure that it will run fail.
In my project, remove_dir.cmd file was not run in the rollback and result, grub folder was not remove.
Thanks
Attachments
Test.rar
(3.7 KiB) Downloaded 479 times
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstall Cleanup for registry

Hi,

Firstly, a rollback custom action should be placed before its related custom action that runs during the installation. This is because when a custom action fails the execution of all the rollback custom actions is done in revers (bottom-up in the Custom Actions page).

Secondly, sorry because I forgot this, but if an "immediately" custom action fails, the rollback custom actions are not triggered, the rollback is triggered only if a "deferred" or "commit" custom action fails.

So, if you want to create a folder, a TXT file and a registry entry and also remove them in case the installation fails you can create a custom action that creates them all set it to run as "deferred", then create another custom action that removes them, place it before the custom action that creates them and set it to run on "rollback".

If this is not what you want to achieve, please give me more information about your final goal, so I can try to suggest you the best approach from the beginning.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
congnt92
Posts: 57
Joined: Wed Apr 16, 2014 7:53 am

Re: Uninstall Cleanup for registry

Hi,
If custom actions set run "deferred" will be remove by the rollback, I will use custom action to add a registry vaule, make dir, ... I think that any custom action fail, the installer will stop. But as u say, I wrong.
And Uninstall Cleanup will remove anything which was not created by the installer ?
Summary, It means that I can completely remove my app even if it was setup successful or fail.
Thanks for your help, Eusebiu. I learned somethings from you. AI is marvelous tool, I will try to discover more and more.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstall Cleanup for registry

Hi,
And Uninstall Cleanup will remove anything which was not created by the installer ?
Yes, the "Uninstall Cleanup" feature can remove anything that was not created by the installer, but unfortunately, it cannot be executed during rollback.
Summary, It means that I can completely remove my app even if it was setup successful or fail.
Yes, you can achieve this only through your custom actions.
Thanks for your help, Eusebiu. I learned somethings from you. AI is marvelous tool, I will try to discover more and more.
You're welcome. It was my pleasure to help you. I'm glad you like Advanced Installer and I'm sure that as you will learn it better you will find it more useful and simple.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”