This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Getting the reference count on files in a shared component
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 24, 2009
09:58 AM
Getting the reference count on files in a shared component
I understand that a reference count on some files is maintained in [HKEY_LOCAL_MACHINE]\SOFTWARE\Microsoft\Windows\Current Version\SharedDLLs
I've noted that only the files that happen to be in a subfolder of a folder referenced by my components are showing up in the list. Looking at the corresponding components in the component table I can see that they are the only ones that have a value other than null for their KeyPath field.
Files that are referenced directly (not in a subfolder) are not present in that SharedDLLs list and don't have anything in their KeyPath field.
This is peculiar to me because they must be reference counted somewhere (they are uninstalled at the correct time when the last package using them is removed). I need to be able to somehow acquire the reference count on these files in order to ensure that all my upgrade scenarios are covered correctly (to make a long story short).
If anyone can shed some light on where the reference count is maintained on components without a corresponding KeyPath value, it would be greatly appreciated.
I've noted that only the files that happen to be in a subfolder of a folder referenced by my components are showing up in the list. Looking at the corresponding components in the component table I can see that they are the only ones that have a value other than null for their KeyPath field.
Files that are referenced directly (not in a subfolder) are not present in that SharedDLLs list and don't have anything in their KeyPath field.
This is peculiar to me because they must be reference counted somewhere (they are uninstalled at the correct time when the last package using them is removed). I need to be able to somehow acquire the reference count on these files in order to ensure that all my upgrade scenarios are covered correctly (to make a long story short).
If anyone can shed some light on where the reference count is maintained on components without a corresponding KeyPath value, it would be greatly appreciated.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 25, 2009
08:35 AM
I'll assume you're using a Basic MSI, since you've referenced keypaths.
Windows Installer tracks components itself, by the GUID of the component. Files in a component are removed on uninstall if no other MSI has installed them, and if they have a zero reference count in the SharedDLLS key.
That key is actually a legacy entry to allow for applications that use a file but are not installed by Windows Installer. As I understand it, if you don't mark a component as "shared", Windows Installer doesn't increase the count for that key.
Windows Installer tracks components itself, by the GUID of the component. Files in a component are removed on uninstall if no other MSI has installed them, and if they have a zero reference count in the SharedDLLS key.
That key is actually a legacy entry to allow for applications that use a file but are not installed by Windows Installer. As I understand it, if you don't mark a component as "shared", Windows Installer doesn't increase the count for that key.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2009
09:04 AM
Thank you very much for your reply.
You're correct in assuming this is a part of a "Basic MSI" project. The story behind it is we've distributed merge modules with shared components packaged in a couple different "Basic MSI" projects. We're releasing a new version which is a "minor upgrade" from the previous version. The issue is, I want to be able to warn the user if another package is using the old shared component.
I noted that you said it removes on uninstall "if no other MSI has installed them". Is there any way of determining this by using InstallScript?
You're correct in assuming this is a part of a "Basic MSI" project. The story behind it is we've distributed merge modules with shared components packaged in a couple different "Basic MSI" projects. We're releasing a new version which is a "minor upgrade" from the previous version. The issue is, I want to be able to warn the user if another package is using the old shared component.
I noted that you said it removes on uninstall "if no other MSI has installed them". Is there any way of determining this by using InstallScript?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2009
12:27 PM
There's always the MSI function call MsiEnumClients()...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 02, 2009
02:34 PM
According to the description this appears to be what I'm looking for.
That function doesn't appear to be available inside installscript. Do I need to make this a different kind of custom action that resides in its own MSI dll?
That function doesn't appear to be available inside installscript. Do I need to make this a different kind of custom action that resides in its own MSI dll?