Author Topic: 64-bit add-in with logging window in EA V16.1.1628  (Read 11457 times)

blaisephilip

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
64-bit add-in with logging window in EA V16.1.1628
« on: April 09, 2024, 06:09:49 pm »
I'm developing a document generator add-in with installer package to distribute it over our organization. So far I came to the following results:

1. There is no chance to get this done via WiX due to heat.exe's poor support for 64-bit libraries currently.

2. The Setup Project template of Visual Studio 2022 V17.9.4 fails to add registry entries properly. EA, from whatever unfortunate reason, expects the first (Default) key value to be filled with the library's main namespace value and class name. (namespace_name.class_name format) The Setup Project installer adds the first value as empty, and creates a second (Default) with the proper value. So, totally unusable for EA during startup. Automated custom actions (usable in Setup Project template of VS) during install fail to fix this due to the nature of the (Default) key.
Still, after manual fix, the add-in loads, operations are performing as expected, but... it cannot load a logging subwindow to EA that I use for feedback towards users.

When the library is registered via regasm for debugging, the subwindow interaction is correct. So I think the registering of the library is the issue to COM.
Possible options for library registering in the Setup Project for the library, and results:
a) vsdrpCOMSelfReg  --> Build error: The assembly 'xyz.dll' in project output group 'Primary output from MainNamespaceName(Release x64)' cannot be self-registered.
b) vsdrpCOM or vsdrpCOMRelativePath --> The add-in is installed, I correct the false registry entries manually, operations work - but the log window still not shows up..
I cannot roll out an add-in without any feedback on the UI about what is happening and how far a triggered process is done in the end-user's EA instance.

So, this is a pretty messy system integration possibility for 64-bit EA currently. Does anyone knows a patch or workaround for this issue? Thanks in advance.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13233
  • Karma: +553/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: 64-bit add-in with logging window in EA V16.1.1628
« Reply #1 on: April 09, 2024, 06:30:49 pm »

blaisephilip

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: 64-bit add-in with logging window in EA V16.1.1628
« Reply #2 on: April 30, 2024, 11:01:42 pm »
Hi Geert

Just as an update:
I got it working with the Setup Project template of Visual Studio.

COM-Visibility option for the main library: vsdrpCOMRelativePath
Important was the proper setting of registry keys via VBScript in the Custom Actions of the Setup Project:

Custom action for Commit:
Code: [Select]
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\SOFTWARE\Sparx Systems\EAAddins64\specialnewtoolbox\", "specialnewtoolbox.mainclassname", "REG_SZ"
Set WshShell = Nothing

Custom action for Uninstall:
Code: [Select]
Set WshShell = CreateObject("WScript.Shell")
addinKey = "HKEY_CURRENT_USER\SOFTWARE\Sparx Systems\EAAddins64\specialnewtoolbox\"
WshShell.RegDelete addinKey
Set WshShell = Nothing

Both actions shall have the option Run64Bit on True, for 64-bit installer.

Same changes from a C# executable failed to handle the proper registry keys, it created (Default) duplicates. Similar problem was also addressed in this article: https://forums.ivanti.com/s/article/Updating-default-registry-value-in-Windows-actions-creates-duplicate?language=en_US

The original issue is now resolved.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13233
  • Karma: +553/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: 64-bit add-in with logging window in EA V16.1.1628
« Reply #3 on: April 30, 2024, 11:24:32 pm »
Weird, I don't have any custom action in my setup project.

I do produce two different installers, one for 64 bit and one for 32 bit, but everything is handled by wix.

The main crux is this part of the wix file:

Code: [Select]
<?if $(var.Platform) = x64 ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?define EAAddinRegistryKey = "SOFTWARE\Sparx Systems\EAAddins64\" ?>
<?else?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?define EAAddinRegistryKey = "SOFTWARE\Sparx Systems\EAAddins\" ?>
<?endif?>
So when my VS mode is in "x64" then it builds a 64 bit installer. When in "Any CPU" is builds a 32 bit installer.

Geert