DPenney
Posts: 36
Joined: Thu Feb 19, 2015 2:58 pm

SharedLegacyFile Parameter

Good day,

TLDR: I am trying to create a MergeModule with files that have the SharedLegacyFile parameter set. This is something that I can do from within VIsualStudio using the MSI/MSI Installer Extensions provided by Microsoft. That flag (SharedLegacyFile) sets the msidbComponentAttributesSharedDllRefCount component flag (https://msdn.microsoft.com/en-us/librar ... s.85).aspx) for the file(s) that have it set. I can not find any option in AdvancedInstaller to achieve the same result. Am I missing something?

What I am trying to achieve, design wise, is a MergeModule that only uninstalls after all of it's 'parents' have been uninstalled, regardless of version.

For example (with Advanced Installer):
- Create a Merge Module Test.MSM includes a C:\Program Files\Common Files\Test\Test.exe app and set it's version parameter/field 1.0.
- Build Product_1v1.0.msi that includes the above Test.MSM;
- Build Product_2v1.0.msi that includes the above Test.MSM;
- Install Product_1v1.0.msi and the file shows up in the proper location (C:\Program Files\Common Files\Test\Test.exe) and I can check it's properties to see it is v1.0;
- Install Product_2v1.0.msi and the file is still in the proper location (C:\Program Files\Common Files\Test\Test.exe) and I can check it's properties to see it is still v1.0;
- I create an update of the Test.MSM Merge Module to contain a fix for the Test.exe app (App version is now 1.1) and set theversion parameter/field is now to v1.1 for this new Test.MSM;
- I then build Product_2v1.1,msi with this new version of the MSM;
- Install (either uninstall/install or upgrade) Product_2v1.1.msi the Merge Module Test.exe file is still in the proper location (C:\Program Files\Common Files\Test\Test.exe) and I can check it's properties to see the version of Test.exe has changed to v1.1 as I expect;
- Unexpeced Behaviour: If i uninstall either Product_1v1.0 or Product_2v1.1 the Merge Module component is removed (Test.exe no longer exists (C:\Program Files\Common Files\Test\Test.exe);
- Expeced Behaviour: If I do this same process with the msidbComponentAttributesSharedDllRefCount set on Test.exe (I open the MSM with Orca, find Test.exe in the Component table and set it's attribute from 256 to 264 (setting the 0000 1000 bit) for each of the MSM files), repeat the above steps and then uninstall either Product_1v1.0 or Product_2v1.1 the Merge Module component remains until the last 'parent' is removed (ie: both Product_1v1.0 and Product_2v1.1 need to be uninstalled);

Is there a way to do this in AdvancedInstaller or do I have to revert to using the Visual Studio MSI/MSM Installer extension to build this (Test.MSM) Merge Module?
DPenney
Posts: 36
Joined: Thu Feb 19, 2015 2:58 pm

Re: SharedLegacyFile Parameter

Bah! I see it!

It is in the Package Definition -> Organization -> TargetFeature -> Component Properties as Shared DLL Reference Count (a check box).

Is there a way to set this flag on the command line? Ie: I am using AdvancedInstaller -edit test_msm.aip /AddFolder to add the Test.exe (and other) files. Is there a way I can set that flag that does not involve me having to do a search/replace on the attribute parameter in the COMPONENT section of the .aip XML?
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: SharedLegacyFile Parameter

Hi,

I'm glad you found the option you need. In order to set it for a component from the command line, you can proceed as described in the "Set Component Attribute Command Option" article.

Let me know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”