How to Prevent Windows Installer From Removing a File on Uninstall
Updated: 30 Oct 2007 | 5 comments
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:
- 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.
- 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:
- Determine which component contains the file in question; go to the Setup Editor and click on the Components tab.
- Locate the appropriate component, right-click on it and select Details.
- 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.
blog entry Filed Under:
The Endpoint Management Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the Endpoint Management community. Any authenticated Connect member can contribute to this blog.
Comments
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
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
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
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").
Re : Important: Add the value of 16
Thats perfect..
Wiseuser
Altiris Certified Professional
Would you like to reply?
Login or Register to post your comment.