Custom Action problem - cleaning appdir during upgrade - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ywrik
Posts: 2
Joined: Fri Sep 18, 2009 9:54 am

Custom Action problem - cleaning appdir during upgrade

Hi all,

I'm using AI version 6.7.1. I would appreciate some help in following scenario:

- application is instaled with msi package version lets say 1.0.0.
- unfortunatelly, this app has some built in actualization mechanism, it checks and downloads on start some new files to appdir without any installer related scripts or packages, just plain copying
- I need to upgrade it then with new package, lets say vesion 2.0.0. so I build new msi file with new product code
- this new version first uninstall old package , BUT the newly downloaded files are still left there in appdir, because they arent referenced anywhere
- therefore, i assume i need to make custom action, that calls some .bat file to clear appdir or remove it completely before version 2.0.0 package installs new one.

Im stuck in the last step, as up to now im not able to embedd to package some .bat script to my version 2.0.0 package unless I install it to appdir that i dont want to, because it has to be deleted...can someone supply some clues for solution?

Thnx, Ywrik
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Custom Action problem - cleaning appdir during upgrade

Hello and welcome to Advanced Installer Forums,

Please note that there is no need for a .bat file to achieve this. Advanced Installer has a feature called Uninstall Cleanup. Simply right click your "Application Folder" on "Files and Folders" page and select "Uninstall Cleanup" from the context menu. Upon finishing the wizard that displays, your package will be set up to delete all the files in the "Application Folder" even if they are not registered with Windows Installer.

Note that this setup should be done on your package version 1.0.0 so it properly uninstalls, making room for a fresh install of version 2.0.0. Your version 2.0.0 should not be responsible with the proper uninstallation of version 1.0.0

If your application version 1.0.0 has already been deployed, then your version 2.0.0 will unfortunately be responsible for properly cleaning up. You can follow our guide on "How to remove a file or folder during installation". Do not forget this time to set your application version 2.0.0 to properly uninstall itself by cleaning up all the remaining files using "Uninstall Cleanup".

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
ywrik
Posts: 2
Joined: Fri Sep 18, 2009 9:54 am

Re: Custom Action problem - cleaning appdir during upgrade

Hello Gabriel,

Thanks for quick answer, unfortunatelly, the version of Advanced Installer 6.7.1 I was using doesnot have this feature yet (Uninstall Cleanup) - thats why I was trying the custom action first, now as I upgraded to version of AI 7.2 I see that day is probably saved - the Uninstall Cleanup is there, as you write in context menu when i rightclick on application folder. Thank you again for hint, and the link for guide how to remove a file during installation, im studying it (just for case) right now.

bye, have a nice day, Ywrik

Return to “Common Problems”