jeffg22
Posts: 13
Joined: Thu Oct 28, 2004 5:34 pm

Persistent Files

Is there a way to include a file (in my case, a database file) in the installation so that it is not deleted when the application is uninstalled??

Thanks.

- Jeff
Cata
Posts: 638
Joined: Thu Apr 10, 2003 7:37 am
Contact: Website

In the Organization page, check the file's component Permanent attribute.

However, as a general observation, it is a bad idea to install a file and then modify it to store user's data inside.

It is usually better to create a NEW file, using the installed one as a template. The new file will be in the user's documents or wherever and it will store all the new data. Of course, it won't be uninstalled.

Hope that helps,
Cata
Catalin Rotaru - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sharon
Posts: 1
Joined: Thu Jun 02, 2005 7:25 pm

I'm another user with a similar question...

How do I use the file as a template? If I install in the app folder, then copy it to "My Documents folder", that would work. Is this what you mean? If so, then can that copy be done by the installer on the first install, but not on updates? Is this possible with the Freeware version?

Many thanks,
Sharon
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi Sharon,

To use a file as a template you could use a custom action that copies the install file to another location. Then your application could use that copy to save it's data. To prevent the copying to happen on updates the custom action could check first if the destination file exists. If so, it should abort the copying.

This can only be done with the Professional version, since the Freeware version does not have Custom Action support.

A better solution would be that your application does that internally. It opens the template file, merges the read data with the user data and saves this to another file.

Hope this helps,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

The overwriting of a file is decided according to the file versioning rules. For more details, please visit:

http://msdn.microsoft.com/library/defau ... _rules.asp

Starting with the 3.3 you can use AI to set the version of the files in the upgrade to a smaller version but this is not a long-term solution.

Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”