Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Permanent components removed during major upgrade


6 replies to this topic

varunAdb

varunAdb
  • Full Members
  • 18 posts

Posted 28 September 2011 - 11:49

I have some components marked permanent. Though they behave as expected during uninstall, but if i run Major Upgrade, these components are also removed.
Why is this happening? What causes Major Upgrade to remove "permanent-ness" of the component?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 28 September 2011 - 14:35

Major Upgrade runs uninstall of the old version. So if the files were maked as permanent in the old version, and uninstalling the old versin leaves them behind, then this should also work in a Major Upgrade. (Marking them as permanent in the new version is not sufficient)

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?

varunAdb

varunAdb
  • Full Members
  • 18 posts

Posted 29 September 2011 - 06:33

These components are permanent in old version and still remains permanent.

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.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 29 September 2011 - 17:44

If the files are held in use/locked by some process, then Windows Installer also couldn't update them. I guess that's the reason why they are listed in the files in use box.

varunAdb

varunAdb
  • Full Members
  • 18 posts

Posted 30 September 2011 - 15:50

But there should be some way to bypass this. I want it to be handled during uninstall and not in InstallValidate before RemoveExistingProducts.

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.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 October 2011 - 11:17

This has been discussed in the past and if I recall correctly there was no real solution. Could you stop the process that holds those files before the InstallValidate action?

varunAdb

varunAdb
  • Full Members
  • 18 posts

Posted 03 October 2011 - 15:33

I have come up with solution which isn't encouraging. But yes, it works.
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. wink.gif