Permanent components removed during major upgrade
Posted 28 September 2011 - 11:49
Why is this happening? What causes Major Upgrade to remove "permanent-ness" of the component?
Posted 28 September 2011 - 14:35
Do you have some entry in the RemoveFiles table or a custom action which might delete those files? Does a log file of the major upgrade give any hints?
Posted 29 September 2011 - 06:33
Yes, there is a CA as commit action to completely clean up installation directory but these files are shown to be held during InstallValidate itself.
Why are these files permanent when we are removing them explicitly at the end? This is because we have a background process which has locked this file. So removing permanent attributed showed our process in FilesInUse which we will anyway be closing after InstallInitialize(to rollback and restart this process it if user cancels in between.)
The logs shows intended component has to be installed locally. I suppose this and InstallValidate option together are creating this issue.
Let me correct my statement - These components are shown in FilesInUse dialog even when they are marked permanent. Why is WI concerned about these files even before RemoveExistingProducts is run?
Edited by varunAdb, 29 September 2011 - 06:42.
Posted 29 September 2011 - 17:44
Posted 30 September 2011 - 15:50
I tried several ways with no success-
- Set condition for components which was always false. Then after Installvalidate i called MsiSetComponent on these components.
- Tried making these files read-only before InstallValidate as msdn documentation says that "Files marked read-only in a read-only location are never considered in use by the installer.". This also didn't help
Other methods i am thinking of are even dirtier so i won't clutter this space with them. I think many people may have had this issue.
Posted 01 October 2011 - 11:17
Posted 03 October 2011 - 15:33
Now i install the files at different location and move them to their actual location(where they should be actually installed).
This way we can fool the InstallValidate as now it will look at location where we are installing for any locked files but that not being the actual location helps us prevent the FilesInUse.