Problem deploying VSTO addin in 64 bit Windows Terminal Server environment

timetracer
timetracer used Ask the Experts™
on
Hi,

We are having a problem deploying a VSTO 2005 Second Edition Add-In and would appreciate any help with this.

We previously successfully deployed this add-in onto a 32bit Windows 2003 terminal service environment. By default VSTO installs on a per-user basis. But we got around this limitation by creating a custom CASPOL script which we ran after installation. This script removes the per user permissions and replaces them with per machine permissions.

I have included an example of this script below.

The client has now moved to a 64bit terminal services environment and our add-in is no longer working. The add-in is available but will not load, so our suspicions are that the problem is with the CASPOL script that it is no longer working.

We have tried editing our script so that it targets the Framework64 folder instead of Framework etc. without success.

Example script

%windir%\Microsoft.NET\Framework\v2.0.50727\caspol.exe -u -q -rg "OurDll.a5376b32-bs02-4f7f-897e-025bd33c0fb8"

%windir%\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -q -rg "OurDll.a5374b32-bf02-4f7f-897e-025re33c0fb8"

%windir%\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -q -ag My_Computer_Zone -url "OurUrl\*" Nothing -n " OurDll..a5374b32-bblas-4f7f-897e-025bd33c0fb8" -d "Code Group for Our App"

....etc...
 
I'd appreciate whatever help anyone can offer.

 Thanks,

Peter Evans
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
First thing I would try is to run your app on a regular, non TS, 64-bit 2008 Server. Does it work?
If it does, the issue may be on the TS side of things.
In this case, try opening a command prompt before running the app and typing CHANGE USER /INSTALL. Now run it. Does it work?
Also, does it work if I am a member of the local administrators group? If it does, the issue is permissions and you can track the issue using Process Monitor from Microsoft (free).

Cláudio Rodrigues
Microsoft MVP - RDS
Citrix CTP
Miguel OzSenior Software Engineer
Top Expert 2009
Commented:
VSTO 2005 Second Edition only works in 32 bits OS. You can not use it in 64 bit OS. (Notice that Office 2003 /2007 are 32 bit Windows programs too)
The way we deploy in Windows 64 bit machines is in 32-bit compatible mode, but I have not use TS 64-bit before.

Author

Commented:
I'm setting up a Windows Server 2003 x64 testing environment without Terminal Server running at the moment.  I'll test the addins in that environment to see if the problem is with TS.

I've also tried running as a local admin and a domain admin account but it still doesn't work.

Thanks,

Peter Evans
Miguel OzSenior Software Engineer
Top Expert 2009

Commented:
In your windows server 2003 x64:
 Did you install Office and Add-in in compatible mode?
The location c:\program files(x86)
is the location where all 32-bit applications are installed in a windows 2003/2008 server.
Note: c:\program files is the location for 64 bit applications

Also your addin needs to target 32 bit only (x86 or any cpu will do). No reference must be made to any 64 bit library.

Author

Commented:
Hi everyone,


Thanks for the advice. After setting up a new testing environment I discovered that the problem was with the registration entry file I had created. I had not taken into account the fact that certain registry keys are redirected for 32 bit applications in 64 bit Windows. http://msdn.microsoft.com/en-us/library/aa384253%28VS.85%29.aspx

Having updated the Reg file, the problem is now resolved.

I think next time I'll set up the testing environment BEFORE rolling out to a client! :)

Below is an example of the Reg files I had been using to install out VSTO addin in a Windows Server 2003 32 bit Terminal Services environment and the equivalent script used to install in a 64 bit Terminal Services environment.


32 Bit Example:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}]
@="OurWordAddin  -- an addin created with VSTO technology"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}\InprocServer32]
@=hex(2):25,00,43,00,6f,00,6d,00,6d,00,6f,00,6e,00,50,00,72,00,6f,00,67,00,72,\
  00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,4d,00,69,00,63,00,\
  72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,53,00,68,00,61,00,72,00,65,00,64,\
  00,5c,00,56,00,53,00,54,00,4f,00,5c,00,38,00,2e,00,30,00,5c,00,41,00,64,00,\
  64,00,69,00,6e,00,4c,00,6f,00,61,00,64,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
  00,00,00
"ThreadingModel"="Both"
"ManifestLocation"="C:\\Program Files\\OurWordAddin"
"ManifestName"="OurWordAddin.dll.manifest"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}\ProgID]
@="OurWordAddin"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}\Programmable]

[HKEY_CURRENT_USER\Software\Classes\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}\VersionIndependentProgID]
@="OurWordAddin"

[HKEY_CURRENT_USER\Software\Classes\OurWordAddin]
@=""

[HKEY_CURRENT_USER\Software\Classes\OurWordAddin\CLSID]
@="{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}"


[HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\OurWordAddin]
"Manifest"="C:\\Program Files\\OurWordAddin\\OurWordAddin.dll.manifest"
"FriendlyName"="OurWordAddin"
"Description"="OurWordAddin  -- an addin created with VSTO technology"
"LoadBehavior"=dword:00000003
"CommandLineSafe"=dword:00000001



64 Bit Example

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}]
@="OurWordAddin  -- an addin created with VSTO technology"

[HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}\InprocServer32]
@=hex(2):25,00,43,00,6f,00,6d,00,6d,00,6f,00,6e,00,50,00,72,00,6f,00,67,00,72,\
  00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,4d,00,69,00,63,00,\
  72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,53,00,68,00,61,00,72,00,65,00,64,\
  00,5c,00,56,00,53,00,54,00,4f,00,5c,00,38,00,2e,00,30,00,5c,00,41,00,64,00,\
  64,00,69,00,6e,00,4c,00,6f,00,61,00,64,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
  00,00,00
"ThreadingModel"="Both"
"ManifestLocation"="C:\\Program Files (x86)\\OurWordAddin"
"ManifestName"="OurWordAddin.dll.manifest"

[HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}\ProgID]
@="OurWordAddin"

[HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}\Programmable]

[HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}\VersionIndependentProgID]
@="OurWordAddin"

[HKEY_CURRENT_USER\Software\Classes\OurWordAddin]
@=""

[HKEY_CURRENT_USER\Software\Classes\OurWordAddin\CLSID]
@="{0DA740AD-63F3-478D-BA96-E3C36E57RDC6}"


[HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\OurWordAddin]
"Manifest"="C:\\Program Files (x86)\\OurWordAddin\\OurWordAddin.dll.manifest"
"FriendlyName"="OurWordAddin"
"Description"="OurWordAddin  -- an addin created with VSTO technology"
"LoadBehavior"=dword:00000003
"CommandLineSafe"=dword:00000001



Thanks again for your help.


Regards,

Peter Evans


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial