How to keep old directory 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!

Davidoff
Posts: 6
Joined: Tue Jun 08, 2010 9:11 am

How to keep old directory during upgrade

Hi,

I'm newbie in Advanced installer and I'm solving one problem. I need to create new package, which doesn't contain some old feature. But is user has already old version installed, so I need to keep one directory from old version, where feature is.
My idea is create custom action, which will do these steps:
1) During install new package rename the directory with temporary name
2) uninstall old version
3) Install new
4) Rename the directory back

Of course, I need detect if install is fresh or upgrade. So, if have any idea how to do it, example of script will be the best. Or any other idea?
I'm not able to find some more help about custom actions.

Thank you
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: How to keep old directory during upgrade

Hello,

Detecting whether an upgrade or a fresh install is occuring is easy:
- in the already installed package, when it is automatically uninstalled because of an upgrade, the UPGRADINGPRODUCTCODE property is set
- in the newer package that upgrades the older one, the OLDPRODUCTS property is set when doing an upgrade.

Check the values of these two properties to determine whether an upgrade is in progress.

Regarding your approach, it is a valid approach. However you can try using the Persistent User Data wizard from the top menu which already does this for you.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Davidoff
Posts: 6
Joined: Tue Jun 08, 2010 9:11 am

Re: How to keep old directory during upgrade

Thanks for answer. But I can't find Persistent User Data wizard. I have AI version 6.9.1, is this feature already in?

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

Re: How to keep old directory during upgrade

Hello,

This feature was introduced in Advanced Installer 7.0.
Many features have been added since version 6.9, you may want to renew your maintenance plan.

Should you feel there is no need to upgrade, you can implement the behavior yourself using the properties I mentioned earlier.

I hope this helps.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to keep old directory during upgrade

Just wanted to let you know that 9.5 was released and the support to preserve folders too is now available.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”