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

Reference count wrong after Nullsoft->MSI upgrade


4 replies to this topic

davekr

davekr
  • Full Members
  • 2 posts

Posted 15 June 2010 - 21:23

We have a product that was being installed using a Nullsoft installer for past releases. For our latest release we have gone to an MSI-based installer. In order to handle upgrades, if I detect that a previous version is installed, I silently run the Nullsoft uninstall just after InstallInitialize. This needs to be run in Deferred Mode w/ System Context to support restricted user upgrades.

The problem that I have is that prior to the Nullsoft uninstall being executed, the MSI determines that "another" application has already installed the files that it includes, so later on when it writes the registry information it gives all of these files a reference count of 2. This obviously causes a problem when you uninstall the MSI since it simply decrements the ref count to 1 and doesn't remove any files.

Just to outline, I have the following scenario:

Run MSI.
Detect Nullsoft installation.
MSI sees existing files from Nullsoft install and thinks another application is using them.
Silently execute Nullsoft uninstall (removing the files).
MSI writes registry entries including SharedDLLs ref counts set to 2.
Uninstalling the MSI results in no files being removed.

Does anyone have any ideas on how to get around this?

Thanks!

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 16 June 2010 - 07:39

Move the uninstall action to the top of the sequence, conditioned appropriately.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 16 June 2010 - 11:53

QUOTE
Move the uninstall action to the top of the sequence, conditioned appropriately.
That would require that you elevate the whole install (e.g. setup.exe) not just the Execute sequence between Installnitialize and InstallFinalize.

Did Nullsoft create the ShareDll ref count with a value of 1? If it didn't (and your only problem is the existance of the files, not the ShredDLL count registry entries) then you could work around this by not setting the msidbComponentAttributesSharedDllRefCount attribute of the component.

davekr

davekr
  • Full Members
  • 2 posts

Posted 16 June 2010 - 15:35

These files are actually shared with another application that we make, so they are reference counted by Nullsoft. Also, they need to be marked as shared in the MSI so they don't get uninstalled if the other application is also using them.

I'm starting to think that my only option is going to be to make a custom action that decrements the reference counts of these files by 1 at the end of the upgrade.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 17 June 2010 - 08:15

Not sure if moving the Nullsoft uninstall to the end of the install sequence would work (so that Nullsoft decrements the count after Windows Installer has incremented it).