tags:

views:

1826

answers:

1

I have a .NET assembly that contains classes to be registered as ServicedComponent through EnterpriseServices (COM+) and invoked through COM RPC by a third-party application. Therefore, I need to both add it to the GAC and add a registry entry under HKEY_CLASSES_ROOT\CLSID\{clsid}\CodeBase with the path to the assembly DLL within the GAC folder. (I can't rely on regsvcs to do it, because this is a 32-bit assembly --- it relies on 32-bit third-party components --- and the third-party application I referred to before cannot see classes in Wow6432Node)

So the question is:

Are paths to assemblies to be created in the GAC, or at least the path to the GAC folder itself, available in Windows Installer as properties that can be used in values of registry keys etc.?

+2  A: 

If you have a component per file, which you should anyway, the KeyPath of the component points to the location where the file gets installed (in this case the GAC). You can use the component key as a token in the value field of the entry in the Registry table in your MSI.

Assuming you have an assembly with a File key in the File table of "assmb.dll" and its corresponding component, also "assmb.dll". You can set the value field in the Registry table to register your assembly to [$assmb.dll], and it will get resolved to the install location of the assembly. If this directory is the GAC, it will be resolved to the location of the GAC.

You can find more information about Formatted fields in an MSI here.

Curro