In Part 5 of this unintended series I provided complete details on how to create an Excel Automation Add-in using the COM Shim Wizard from Microsoft. It works for development, not for deployment. I’ve found that in the deployment system some registry keys are missing.
It seems to me that this is the fault of the COM Shim Wizard since that creates some of the registry entries. I did put in the fix documented by Andrew Whitechapel and I’m sure it will help, but without the right registry keys that specific fix won’t make this code work. It seems there is something I’m not adding to the Setup project. You’d think adding the Project Output from my code, and both shim projects would have done the trick, but something manual may still need to be added. In a comment to Part 5 a visitor says he needed to add Extensibility.DLL to his Setup project. Sure, I can try that, but I don’t believe that’s what’s causing the registry entries to get lost.
I’ve provided below a detailed list of the registry keys that are present, and I’ve highlighted the missing ones. I’m really hoping someone from Microsoft can take a look, maybe follow my instructions from Part 5, and tell us exactly what’s missing. I’ve masked the name of my executables and GUIDs, and some of the lines wrap in this page, but that shouldn’t make any difference for someone who knows how to read the registry.
; ok
[HKEY_CLASSES_ROOT\CLSID\{GUID-01}]
@="MyCode.UDF01"
[HKEY_CLASSES_ROOT\CLSID\{GUID-01}\ProgId]
@="MyCode.UDF01"
; ok – shows the shim code executed during Excel addin process
[HKEY_CLASSES_ROOT\CLSID\{GUID-01}\Programmable]
; missing
[HKEY_CLASSES_ROOT\CLSID\{GUID-01}\Implemented Categories]
; GUID-02 is all over source system – what is it?
[HKEY_CLASSES_ROOT\CLSID\{GUID-01}\Implemented Categories\{GUID-02}]
; Regarding this key:
[HKEY_CLASSES_ROOT\CLSID\{GUID-01}\InprocServer32]
; Following values are present, but they should not be:
; ThreadingModel=Apartment
; default=C:\Program Files\MyPath\ShimCode.dll
; following values should be present, not those above.
[HKEY_CLASSES_ROOT\CLSID\{GUID-01}\InprocServer32]
@="mscoree.dll"
"RuntimeVersion"="v2.0.50727"
"Class"="MyCode.UDF01"
"Assembly"="MyCode, Version=1.0.2905.24564, Culture=neutral, PublicKeyToken=mykey123abc"
"CodeBase"="C:\\Program Files\\MyPath\\MyCode.dll"
"ThreadingModel"="Both"
; missing
[HKEY_CLASSES_ROOT\CLSID\{GUID-01}\InprocServer32\1.0.2905.24564]
"Class"="MyCode.UDF01"
"Assembly"="MyCode, Version=1.0.2905.24564, Culture=neutral, PublicKeyToken=mykey123abc"
"CodeBase"="C:\\Program Files\\MyPath\\MyCode.dll"
"RuntimeVersion"="v2.0.50727"
; ok
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{GUID-01}]
@="MyCode.UDF01"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{GUID-01}\ProgId]
@="MyCode.UDF01"
; ok – shows the shim code executed during Excel addin process
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{GUID-01}\Programmable]
; missing
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{GUID-01}\Implemented Categories]
; missing
; GUID-02 is all over source system – what is it?
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{GUID-01}\Implemented Categories\{GUID-02}]
; missing
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{GUID-01}\InprocServer32\1.0.2905.24564]
"Class"="MyCode.UDF01"
"Assembly"="MyCode, Version=1.0.2905.24564, Culture=neutral, PublicKeyToken=mykey123abc"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///C:/MyDevelopmentPath/MyCode/bin/Release/MyCode.dll"
; Need to change Codebase for target platform?
; Regarding this key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{GUID-01}\InprocServer32]
; Following values are present, but they should not be:
; ThreadingModel=Apartment
; default=C:\Program Files\MyPath\ShimCode.dll
; following values should be present, not those above.
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="MyCode.UDF01"
"Assembly"="MyCode, Version=1.0.2905.24564, Culture=neutral, PublicKeyToken=mykey123abc"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///C:/ MyDevelopmentPath/MyCode/bin/Release/MyCode.dll"
; Need to change Codebase for target platform
; missing
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MyCode.UDF01]
@="MyCode.UDF01"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MyCode.UDF01\CLSID]
@="{GUID-01}"
That’s the news so far. My next step is to insert the missing keys into the target registry using a .reg file. If that works then I may be able to get away with manually adding the process to the Setup project. I’ll let you know…
Links to all articles in this series
2 Responses
tinymoth
16|Jan|2008 1Hi,
KB908002 (http://support.microsoft.com/kb/908002) seems to fix the problems, sort of.
I had the same problem you did. Plenty of simple examples that worked on the VS machine that failed to work on a target without any messages anywhere!
Although I haven’t tested the truth of it yet, the KB does state you need to run the patches for each user
Good luck,
Tim
Tony Gravagno
16|Jan|2008 2Holy Cow, that looks so promising! Thanks Tim, I’ll check it out within the next couple weeks (travelling).
Leave a reply
You must be logged in to post a comment.