Register-free using of COM-DLL within Team Developer

Discussion forum about all things Gupta, OpenText and the community.
JonasK
Germany
Posts: 8
Joined: 01 Feb 2019, 15:22
Location: Germany

Register-free using of COM-DLL within Team Developer

Post by JonasK » 13 Apr 2020, 10:02

Hello folks,

in our TD-application we are using some selfmade C#-DLL via COM (DLL is registered via regasm.exe). This works quite well, but since we need admin-rights for registering we are searchung for a register-free-method. I found some information on the web, it seems that the correct term is side-by-side-assemblies:
https://docs.microsoft.com/en-us/dotnet ... om-interop
viewtopic.php?f=6&t=62070&p=193438&hili ... st#p193438
viewtopic.php?f=12&t=67108&p=213239&hil ... st#p213239
https://developex.com/blog/using-com-wi ... istration/

I tried to implement a sample in Team Developer 6.2, but the register-free-method mentioned here doesn't work for me.
  1. create a simple C#-DLL with two function (return a string and a number value): RegFreeComDLL.dll
  2. register the DLL via regasm.exe, create the .tlb-file and create a corresponding TD-File: RegFreeComDLL.apl
  3. create a manifest-file for the DLL via mt.exe: RegFreeComDLL.manifest
  4. attached the manifest-file in the C#-project
  5. create a test-program for the DLL with a registered and an unregistered method -> registered works, unregistered not
  6. build an test-program-exe-file an edited the internal manifest via ressource hacker -->Side-by-Side-Configuration-Error, the created logfiles via systrace.exe didn't help
I have no clue what i'm doing wrong. Can you give me some tips? You can find the files in the attachments.

Regards,
Jonas
You do not have the required permissions to view the files attached to this post.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3522
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Register-free using of COM-DLL within Team Developer

Post by Dave Rabelink » 13 Apr 2020, 12:19

Unfortunately, UNICODE TD applications (exe's) seem to have a different resource header which is incompatible with the mt.exe tool.
When using mt.exe, the resulting executable is corrupt.

The only way to replace/add an manifest to TD applications seems to be one other tool named ResourceHacker.

We have implemented reg-free TD applications and it works flawlessly. But you need to be sure the existing TD manifest is added correctly to work.
I have created an enhancement request with Gupta to be able to add/change the default manifest within the TD IDE or supply the technical details how the TD compiler/builder is creating the resource header so I could create a custom tool for TD executables. But until now this info is not given.

For more info on register-free TD applications can be found here:

viewtopic.php?f=41&t=62071
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

JonasK
Germany
Posts: 8
Joined: 01 Feb 2019, 15:22
Location: Germany

Re: Register-free using of COM-DLL within Team Developer

Post by JonasK » 14 Apr 2020, 07:35

Hello Dave,

thanks for the quick response. The mt.exe is imho not the problem, cause i used it for generating the manifest for the C#-dll. I edited the TD.exe via ResourceHacker (http://www.angusj.com/resourcehacker/), but it didn't work. Surely im doing something wrong (e.g. wrong manifest-informations), but i can't figure out what. At the moment for proof-of-concept it would be fine if i need do manually edit the files.

Regards
Jonas

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3522
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Register-free using of COM-DLL within Team Developer

Post by Dave Rabelink » 14 Apr 2020, 08:50

JonasK wrote:
14 Apr 2020, 07:35
...but it didn't work.
Please clarify what does not work.

I would suggest to test your manifest having it as external file first instead of adding it to the TD.exe.
(change registry setting to enable external manifests mentioned in the forum link above. Do not forget to reboot after changing the registry value)

Use sxs trace to see errors in the manifest.

https://docs.microsoft.com/en-us/window ... s/sxstrace
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

JonasK
Germany
Posts: 8
Joined: 01 Feb 2019, 15:22
Location: Germany

Re: Register-free using of COM-DLL within Team Developer

Post by JonasK » 17 Apr 2020, 09:20

Hi Dave,

thanks for the rebooting hint, it seems to be essential after every update (not creation) of the registry-entry. I also have the impression that windows somehow caches the manifest informationen of an application (after multiple editings of the internal exe-manifest the changes had no effect --> rebooting necessary).

With following steps i can create an TD-Exe using an C#-DOM-DLL without registering and without an external manifest (so no need to edit the registry of the client-pc):
  1. Create a working C#-COM-DLL and a consuming TD-Application as usual
  2. Extract the manifest of the DLL via mt.exe (https://docs.microsoft.com/en-us/window ... scs/mt-exe)
  3. Add the manifest to the C#-project (right-click on the project --> add --> new item --> Application Manifest) and copy the extracted manifest-information into the new file
  4. Create the TD-Exe-file, open via Resource Hacker and add the "assembly identity" from the created manifest as "dependency" analog "Microsoft.VC90.MFC"
  5. This can be automated: ResourceHacker.exe -open RegFreeComTD.exe -save RegFreeComTDNew.exe -action addoverwrite -resource Manifest.txt -mask MANIFEST,1,
  6. Start the program, all COM-function work as usual without a registered COM-Class.
  7. On the developer-machine a registered DLL is necessary, but that is fine for me.
Regards
Jonas

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 2 guests