AppSearch and GAC
Posted 27 March 2009 - 20:12
I'm having a problem I hope someone can assist me with. I'm trying to detect one of our DLLs installed into the GAC and what version of the DLL is present.
The dll is part of a SharePoint solution installed via a WSP package, not through an MSI. We have several 4.0.X.X and 4.5.X.X versions in the wild and the main concern is the first two digits.
I've got an AppSearch set, with the following rows in the tables:
Signature: (Signature, fileName, MinVersion, MaxVersion)
gacsearch40 File.name.dll 4.0.0 4.5.0
gacsearch45 File.name.dll 4.5.0 4.6.0
DrLocator: (Signature, Path, Depth)
gacsearch40 [GlobalAssemblyCache] 1
gacsearch45 [GlobalAssemblyCache] 1
I've also tried using File.Name instead of File.Name.dll in the Signature table to no avail.
In both searches, the log shows several Note:1322 and Note:1325 values when the action is being performed and the found properties aren't created.
Any help is appreciated.
I welcome alternatives to the AppSearch approach as well, if anyone is familiar with detecting a SharePoint solution and its version via another means.
Posted 28 March 2009 - 06:54
But I'm not sure if AppSearch works for assemblies in the GAC. You may need to call some .NET function to query the GAC.
Posted 31 March 2009 - 18:23
In my above post, the Path entry is the one containing the [GlobalAssemblyCache] and the Parent column for those searches is null.
Do I need to enter a parent for the GAC search? My other searches for items use [CommonFilesFolder] with brackets in the Path column and have no parent, so I had hoped the GAC folder would be similar.
I'm loathe to add any custom actions that would require added overhead, but it's looking more like I may have to.
Has anyone worked this way with the GAC in the past and might be able to share some advice?
Edit: Submitted too soon, edited content.
Edited by BFealy, 31 March 2009 - 18:26.
Posted 03 April 2009 - 12:02
Posted 13 April 2009 - 17:09
I ended up having to write a custom action to iterate through the GAC and find our assembly. It then feeds the version back to the installer. The scope for the project had increased to support several older versions of our application, so we needed some additional logic.