PDA

View Full Version : Preventing certain files from being uninstalled



na_narayanan
06-30-2004, 03:19 PM
Hi

I am relatively new to Installshield so kindly excuse if this is a obvious issue:

For one of my components (MSI project), I have set the properties as "Never overwrite" and "Shared - No", because certain files in this component MAY be already present in the target system. If files are already present new files are not overwritten, that is exactly what I want. fine. But during uninstall all the files of the component (the ones which were already present) are also removed. I was expecting that installshield will not remove the files it has not copied. I understand that if I set the property to be "permanant" then the files would never be removed, which is something i don't want. What can I do to uninstall only the files that are copied during install?

Thanks,
Narayan.

Buildmaster
07-01-2004, 01:26 AM
Hello Narayan,

first I must say that I have only experience with InstallScript projects, not MSI.

You can set "shared" to yes. If all installations which install these files do this, a reference counter is used to detect whether the file has to be removed during uninstallation. But this works only if all installation programms install these files as shared.
If you are the only one who installs them as shared, the counter decrements to zero at your deinstallation and the files will be removed.

Hope this helps you.

Regards,
Buildmaster

na_narayanan
07-01-2004, 09:22 AM
Hi,

My problem is that, the file that may already be present in the target machine MAY not have been installed by an install shield script, it could have been just copied by the user by other means. Precisely, my company was not using Install shield in the past, they were just distrinuting binaries in zip format.

Anyways I tied with having shared as 'yes' and that did not solve my problem.

Thx,
Narayan.

Buildmaster
07-01-2004, 09:37 AM
Hi,

another approach to this problem could be that you never uninstall these files. In my InstallScript project it´s possible to set "Uninstall" to "no" for a component.
Now you have to look at the beginning of your installation whether some files are already installed. This information can be recorded in your own logfile using the LogWriteCustomNumber(..) function.
At uninstallation time you look into your logfile whether you had installed this file. If yes, delete it with DeleteFile() manually.

It´s a lot of work, but this is the only solution I know for this problem.

Regards,
Buildmaster

na_narayanan
07-01-2004, 10:30 AM
I am looking for a list of 20 files, may be it's not all that bad. I can also use 'LogWriteCustomString' right ?

Thank you very much for the information. I appreciate it.

-Narayan.