Book a Demo

Author Topic: Addin registration HKLM at 64bit OS  (Read 6617 times)

coatie

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Addin registration HKLM at 64bit OS
« on: September 25, 2014, 02:03:23 am »
Hello,

I am trying to get an EA addin running while it is registered under HKEY_LOCAL_MACHINE in Windows7 64Bit. EA realizes it should run my plugin (it is there in the "Manage Add-Ins" dialog) but reports "Error-Missing (0x800401f3)".

Deleting the HKLM entry (leaving DLL untouched) and adding following key: "HKEY_CURRENT_USER:\Software\Sparx Systems\EAAddins" the plugin is available via the extensions menu as it should be.

For HKLM I use following key: HKLM:\Software\Wow6432Node\Sparx Systems\EAAddins
DLL is compiled to be 32bit (C#, platform target x86).
Regasm is called using the 32bit version and using parameter /codebase: C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe  my_ea_addin.dll /codebase

So how to get the plugin running when registering for HKLM?

Best Regards,
Markus
« Last Edit: September 25, 2014, 02:03:46 am by coatie »

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Addin registration HKLM at 64bit OS
« Reply #1 on: September 25, 2014, 10:08:56 am »
Just a guess, but can you please confirm that the value of your registry key under HKLM is identical to the one under HKCU?  It sounds like the values you have specified may be different and when reading the HKLM entry EA is searching for the wrong assembly name, resulting in the the "Error - Missing" message.

coatie

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Addin registration HKLM at 64bit OS
« Reply #2 on: September 25, 2014, 03:54:49 pm »
I am using powershell script and it looks like this:
Code: [Select]
$RegistryPlugin = "CoatiesAddin"

function getEaRegistryKeyForLocalMachine
{
      $RegistryEa32BitMachine = "HKLM:\Software\Sparx Systems\EAAddins"
      $RegistryEa64BitMachine = "HKLM:\Software\Wow6432Node\Sparx Systems\EAAddins"

      if ((Get-WmiObject -Class Win32_OperatingSystem -ComputerName $env:computername -ea 0).OSArchitecture -eq '64-bit') {
            return $RegistryEa64BitMachine
      } else {
            return $RegistryEa32BitMachine
      }
}

function getEaRegistryKeyForCurrentUser
{
  return "HKCU:\Software\Sparx Systems\EAAddins"
}

#############################
#here to switch between HKLM and HKCU, manually for testing
#############################
$RegistryEa = getEaRegistryKeyForLocalMachine  #getEaRegistryKeyForCurrentUser
$RegistryFullPath = $RegistryEa + "\" + $RegistryPlugin

if (-not (test-path $RegistryFullPath)) {new-item -path $RegistryEa -name $RegistryPlugin -force}
# set the default value of the key
Set-Item -Path $RegistryFullPath -Value "CoatiesEaExtensions.Main"

Some more scripting follows, leading to call of 32 bit regasm:
Calling:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe   .\CoatiesEaExtensions.dll /codebase

Microsoft .NET Framework Assembly Registration Utility version 4.0.30319.18408
for Microsoft .NET Framework version 4.0.30319.18408
Copyright (C) Microsoft Corporation.  All rights reserved.

Types registered successfully


So name of object should be the same.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Addin registration HKLM at 64bit OS
« Reply #3 on: September 26, 2014, 11:17:20 am »
I'm not really familiar with Powershell scripts, but I assume that it is supposed to result in one of the following registry keys being created (depending upon your environment and options):

[HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins\CoatiesAddin]
@="CoatiesEaExtensions.Main"

[HKEY_LOCAL_MACHINE\SOFTWARE\Sparx Systems\EAAddins\CoatiesAddin]
@="CoatiesEaExtensions.Main"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Sparx Systems\EAAddins\CoatiesAddin]
@="CoatiesEaExtensions.Main"

Please run regedit.exe to visually confirm that the values of these registry keys under HKCU and HKLM are all identical.

coatie

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Addin registration HKLM at 64bit OS
« Reply #4 on: September 26, 2014, 05:55:57 pm »
It does. Using regedit.exe I did copy the key names to clipboard and created the key set under HKCU using the clipboard values. Then I removed HKLM started EA and the addin was available again.

Could it be that this is an issue of EA10?

On another machine I just installed EA11 and there it is working fine.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Addin registration HKLM at 64bit OS
« Reply #5 on: September 28, 2014, 08:12:16 pm »
Quote
I'm not really familiar with Powershell scripts, but I assume that it is supposed to result in one of the following registry keys being created (depending upon your environment and options):

[HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins\CoatiesAddin]
@="CoatiesEaExtensions.Main"

[HKEY_LOCAL_MACHINE\SOFTWARE\Sparx Systems\EAAddins\CoatiesAddin]
@="CoatiesEaExtensions.Main"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Sparx Systems\EAAddins\CoatiesAddin]
@="CoatiesEaExtensions.Main"

Please run regedit.exe to visually confirm that the values of these registry keys under HKCU and HKLM are all identical.

I had the same issue when trying to register addin for all users (Local_Machine). The error means that the addin is recognized under HKEY_LOCAL_MACHINE, but the code could not be found.

I changed the addin code from debug mode to release mode, then the code was found.

Do you try to register the addin manually or by an installer?
« Last Edit: September 28, 2014, 08:12:32 pm by avoda234 »