How do you exclude files from being deleted during MSI removal?
Hi, I'm hoping one of you here can help me please.
Basically I'm new to app packaging and have been tasked with repackaging an app using an old Wise installer into MSI format.
I've done all that successfully, but a new requirement that's been raised has me stumped.
Basically the MSI installs the physical SQL2005 database files as well as all the program binaries, which I attach later via a custom VBScript.
When the package is uninstalled it acts as designed I guess and removes the database files from the volume, however, I've now been asked to make sure that these files are left behind when the package is uninstalled.
I'm looking at the MSI in Orca but can't see anywhere that would let me exclude files from being deleted during uninstallation? To be honest I can't really see anything about uninstallation in there.
Is there any way in a standard MSI to install a file but then leave it there if the package is ever uninstalled?
Thanks in advance for any tips or pointers on this one!
Basically I'm new to app packaging and have been tasked with repackaging an app using an old Wise installer into MSI format.
I've done all that successfully, but a new requirement that's been raised has me stumped.
Basically the MSI installs the physical SQL2005 database files as well as all the program binaries, which I attach later via a custom VBScript.
When the package is uninstalled it acts as designed I guess and removes the database files from the volume, however, I've now been asked to make sure that these files are left behind when the package is uninstalled.
I'm looking at the MSI in Orca but can't see anywhere that would let me exclude files from being deleted during uninstallation? To be honest I can't really see anything about uninstallation in there.
Is there any way in a standard MSI to install a file but then leave it there if the package is ever uninstalled?
Thanks in advance for any tips or pointers on this one!
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
aido
15 years ago
Posted by:
AngelD
15 years ago
You can do it in two different ways:
1. add the msidbComponentAttributesPermanent attribute bit to the component holding the resources (ex. files, registry...) you want to be left alone during uninstall.
2. remove the ComponentId column value in the Component table for the component you want resources to be left alone during uninstall.
I would recommend option 1, as for option 2 the component will not be recognized as installed meaning the component will not be repaired when one occur.
Make sure to only have these files one (or more) component as the components resources are handled as one.
If you're using wise then just select the details option while right-click on the component, then there should be a checkbox to prevent it from being deleted during uninstall.
1. add the msidbComponentAttributesPermanent attribute bit to the component holding the resources (ex. files, registry...) you want to be left alone during uninstall.
2. remove the ComponentId column value in the Component table for the component you want resources to be left alone during uninstall.
I would recommend option 1, as for option 2 the component will not be recognized as installed meaning the component will not be repaired when one occur.
Make sure to only have these files one (or more) component as the components resources are handled as one.
If you're using wise then just select the details option while right-click on the component, then there should be a checkbox to prevent it from being deleted during uninstall.
Posted by:
India_Repackaging
15 years ago
Hi aido,
Just building on Kim's reply, I completely agree to the solution provided and would like to add just one thing. In case you using Orca for this task all you got to do is to change the value in the 'Attribute' column in Component table to 16 in case it has a file keypath or to 20 in case it has registry keypath.
You may read about this from the 'msi.chm' file which is shipped along with WPS.
Note: Make sure you change the attributes of only those components whose resources you want to leave behind on the system after uninstall.
Cheers
Just building on Kim's reply, I completely agree to the solution provided and would like to add just one thing. In case you using Orca for this task all you got to do is to change the value in the 'Attribute' column in Component table to 16 in case it has a file keypath or to 20 in case it has registry keypath.
You may read about this from the 'msi.chm' file which is shipped along with WPS.
Note: Make sure you change the attributes of only those components whose resources you want to leave behind on the system after uninstall.
Cheers
Posted by:
aido
15 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.