View Full Version : Uninstaller removing modified files

06-29-2006, 12:05 PM
I use the Basic MSI project in IS12. The uninstaller seems to work too well :D in that it removes the files that have been modified since the installation (their Modify and Creation dates are now different).

Is there a way to tell the uninstaller not to remove those files? And if not, what would be a good work-around in order to keep those modified files? I've also seen the "Permanent" option at the Component level, but I wouldn't want to have to leave them always around unnecessarily.

My application needs to install with some sample documents in the application folder (I know about the user's My Documents and all, but for various reasons we have to ship them in the applicaton folder) and it would be unfortunate if a user would work on those samples and then loose their changes when they uninstall the application.

06-30-2006, 04:27 AM
Perhaps, you can take a look at uninstallation log (with /l*v switch) and determine why modified files are getting removed.

06-30-2006, 10:52 AM
Hm, I did do this and here's what I've got:

MSI (s) (80:24) [11:21:56:309]: Executing op: SetTargetFolder(Folder=C:\MyApp\)
MSI (s) (80:24) [11:21:56:309]: Executing op: FileRemove(,FileName=MyModifiedFile.txt,,ComponentId={37D6FE91-DC91-4635-AE66-981E4D791E07})
MSI (s) (80:24) [11:21:56:371]: Verifying accessibility of file: MyModifiedFile.txt
MSI (s) (80:24) [11:21:56:371]: Executing op: ProgressTotal(Total=5,Type=1,ByteEquivalent=175000)

This doesn't seem to be saying much. It doesn't look like it checks to see if the file has changed or anything. Is there something in particular that I should be looking for in that log?

06-30-2006, 12:54 PM
The behavior sounds correct; I believe the "modified" characteristic is only relevant to upgrade scenarios of unversioned files. Such files will generally not be overwritten, but they will still be removed at uninstall.

I suspect it may be easier to solve this from another direction. Users can also be surprised if uninstalling a program doesn't remove the application's folder. Would it be easier to have your application block saving the files in its folder, or for your install to mark these files Read Only so the user finds it harder to change them?

06-30-2006, 01:15 PM
Unfortunately, for historical and deep programatic reasons, the users have to modify document files like these, installed in the application's folder. This is a wide spread legacy application and we cannot change its behavior at this point.

I was kind of suspecting that this is the "correct" behavior, especially since I couldn't find any Property similar to the REINSTALL one that would specify under which conditions these files are removed.

Is there a way I could run a custom action or something on Uninstall to at least notify the user and give them the option to back up those files if they were changed? I've only found in IS conditions and actions that are executed during installation and it feels like the uninstall process is completely automated... :(

06-30-2006, 10:41 PM
If you have not, please refer to Installation and Uninstallation Conditions (http://www.installshield.com/news/newsletter/0212-articles/msiconditions.asp) by Robert Dickau

10-02-2006, 11:02 AM

Did you get anywhere with this? I too need to have my modified files spared from uninstallation.