mweintr
Posts: 10
Joined: Mon Sep 22, 2008 7:58 pm

Backup files within program directory during upgrade

My application writes all files to a single folder, c:\mycompanyname\. When the installer does an upgrade from an old version to the new, it erases everything in c:\mycompanyname\ and writes everything into it. That's fine and good behavior, however, there is data in that folder I need to have saved (as well as a MySQL database residing in there), or backed up (and then put back) at the start of the upgrade process.

Is there a way to run a script before the file-changing aspects of the installer, so I can put the commands I need the installer to run in before it destructively erases the data? I know I can get around this problem by having my users manually run the backup script before I have them run the installer program, but that seems counter-productive.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Backup files within program directory during upgrade

Hi,

What you need can be done by using custom actions for the backup and restore of the files. Please note that the User Guide contains the Preserve File on Install how-to which may help you.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”