Creating an Install Condition for a GAC assembly - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Brian S
Posts: 1
Joined: Wed Oct 31, 2007 7:05 pm

Creating an Install Condition for a GAC assembly

I'm creating an installer which requires the Office Primary Interop Assemblies (PIA). I've added the .msi file from Microsoft to the Prerequisites, but I only want to install the program if the assemblies aren't already installed on the client machine already (they could have been installed with one of the Office editions).

How can I test for the presense of the PIA assemblies in the GAC?

I've tried the following but none of these work:

Criteria = "File Version"
File To Find = "[WindowsFolder]assembly\Microsoft.Office.Interop.Excel.dll"
Search Depth = 2
(doesn't seem to find the file)

Criteria = "File Version"
File To Find = "[WindowsFolder]assembly\GAC\Microsoft.Office.Interop.Excel\11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll"
(doesn't seem to find the file)

Criteria = "Registry value exists"
Registry Value = "HKCL\Installer\Assemblies\Global\Microsoft.Office.Interop.Excel,Version="11.0.0.0000",Culture="neutral",PublicKeyToken="71e9bce111e9429c",FileVersion="11.0.5530.0""
(get the error Please select a registry value containing a string!)
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
How can I test for the presence of the PIA assemblies in the GAC?
I'm afraid that you cannot search into the GAC in order to find out if an assembly is installed or not.

You should try finding a resource (registry entry or file) that is always installed by the assembly and use it as a detection criteria. Please note that Windows Explorer does not allow you to see the file structure in the "assembly" folder (you can use the command line).

For example you can use this criteria:

Code: Select all

Criteria = "File Version"
File To Find = "[WindowsFolder]assembly\GAC\Microsoft.VisualStudio.Shell.Interop\7.1.40304.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.Interop.dll"
Search Depth = 4 
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”