cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peterbi
Level 7

Make a file 'permanent' - not removed at uninstall?

Hi,

I am working on an existing InstallScript MSI project with IS2008. One change I made is to move database files from 'Program Folders' to 'ProgramData' folder on Vista.

The issue I am facing is that the db path is changed now from '[INSTALLDIR]Prod_name\DB' to 'some_new_path_to_programdata\Prod_name\DB', the original db files were marked as 'Permanent' so they won't be removed at uninstall. That holds with the previous install location, but once the install location is changed (in the middle of install scripts, not from IDE, IDE still holds the old location, but once Vista is detected, scripts will change overwrite it with new location), the db files are removed at uninstall.

Does anybody know how to overvome it?


Thanks,
Peter
Labels (1)
0 Kudos
(6) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The best solution to this would be to add the database file(s) to their own component and mark the component as permanent. Changing the destination of the component should have no effect on the permanent attribute.
0 Kudos
peterbi
Level 7

That issue is gone, but I am dealing with a very similar one now -

In the project, to change location of db files on Vista, I programatically copy the existing db files from 'Program File' to 'ProgramData' at upgrading. The problem is that at uninstall (after upgrading), the copied db files are removed, since the 'Permanent' mark only applied to the old db location ('Program Files'). How can I keep that mark ('permanent') after copying the files to the new location?


Thanks,
Peter
0 Kudos
datamagnet
Level 5

joshstechnij wrote:
The best solution to this would be to add the database file(s) to their own component and mark the component as permanent. Changing the destination of the component should have no effect on the permanent attribute.


I am kind of new to things. I am using InstallShield Express 2008

How do you make a file or folder a component and mark as permanent. I have an "uninstall uninstalls all files but leaves the folders" problem on my uninstalls. In short, have an exe that works with a DB. On uninstall, I want to keep the DB folder and its db file.



Right now what i do before an uninstall is to clone the entire app data folder structure so that I do not lose all my DB and other user files.

Could you point me in the right direction?


Thanks
0 Kudos
miky_iq
Level 2

Hi all!

I've the same problem than datamagnet. I've been searching for info all this morning and all I've found doesn't seemed to work.

My app has a folder with a DB and I want to keep it when uninstalling, because other programs do some queries in that DB and they would crash if the DB's folder it's not in place.

One of the things I've found could be perfect for my aim, but I can't find this option, can you help me?

pv7721 wrote:

If your properties files are created in an empty folder you create at install time, all you need to do is to check the option "Do Not Uninstall" on the folder.


Thanks in advance! 🙂
0 Kudos
miky_iq
Level 2

Hi there!

I've achieved it creating a Feature for the DB. In the features propierties set Required to 'Yes' and inside the Feature, all the Components need to have their Permanent property set to 'Yes'.

Hope it helps!
0 Kudos
datamagnet
Level 5

Here is how I am doing it.

Some caveats - If your user does an uninstall, the files makers as permanent will still be on his system, and if they were marked never overwrite, then if your user installs an updated version of your program, your new db will not install over the old one and your new program will be trying to work with the old database and its structure.

Also, if you want the new program to have the a new db distributed with it, you will have to manually delete the old db file that is left after you do an uninstall.
0 Kudos