Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

How to Prevent Windows Installer From Removing a File on Uninstall

Updated: 30 Oct 2007 | 5 comments
WiseUser's picture
0 0 Votes
Login to vote

Here are a couple of approaches that'll keep that pesky Windows Installer away from files you don't want uninstalled when an uninstall script is run. Hope you find this info useful.

To modify the Component Table, follow these steps:

  1. Select the Component Table from the Tables tab in Setup Editor, and highlight the Attributes column of the component that is to be left on the machine during the uninstall.
  2. Change the value in the Attributes column to 16 for the component to keep during the uninstall. Press the Tab key to update the field.

To modify the Component details, follow these steps:

  1. Determine which component contains the file in question; go to the Setup Editor and click on the Components tab.
  2. Locate the appropriate component, right-click on it and select Details.
  3. In the Component Details dialog mark the "Leave installed on uninstall" check box.

Both of these approaches will leave the entire contents of a component installed after an uninstall. To leave just a single file installed after uninstall, you may need to create a new component (which would contain only the file in question) and follow the steps above to flag it as permanent.

Comments

R-Vijay's picture
30
Oct
2007
0 Votes 0
Login to vote

This is not the only case....

Hi buddy..

I guess this is not the only case..

Usually files remain on 2 instances after un-isntallation.

1. Run time logs and junk files
These files are created when the application in launched. These files need to be removed by writitng a CA.

2. File in use
Sometime there may be a service or a process which is related to the file which is not deleted. While installation, this process may still be runing and that file is not deleted. In this case, we write a CA to kill te process and remove the file.

Hope this is useful.

Cheers'
Viju

Microsoft MVP [Setup-Deploy]
Weblog: www.msigeek.com

WiseUser's picture
01
Nov
2007
0 Votes 0
Login to vote

Re: This is not the only case....

Hi Viju , Thats fine ,the explanation stands good for why installer leaves files during uninstall , but my topic is all about "How to Prevent Windows Installer From Removing a File on Uninstall "

Scenario : We may want to keep a file after uninstalling an application , may be a shared file or a component . We can usethe file as a merge module or we can follow the approach stated above.

Cheers
WiseUser

Wiseuser
Altiris Certified Professional

R-Vijay's picture
01
Nov
2007
0 Votes 0
Login to vote

Re : Re: This is not the only case....

HI WiseUser,

I understood your article..but keeping a file back should be done only for User related file, and your article covers that.

However, I added some points to explain why a file stays back. This is not for a userdata file.

Cheers'
Viju

Microsoft MVP [Setup-Deploy]
Weblog: www.msigeek.com

rpfenninger's picture
31
Oct
2007
0 Votes 0
Login to vote

Important: Add the value of 16

Be careful in directly editing the components table. Don't just put the value of 16 in it, if there's a value already, you need to add 16 to it. (ie. if there's already "8", change it to "24").

WiseUser's picture
01
Nov
2007
0 Votes 0
Login to vote

Re : Important: Add the value of 16

Thats perfect..

Wiseuser
Altiris Certified Professional