hsc
Posts: 106
Joined: Wed Mar 02, 2016 2:55 pm

COM EXE Server reister/unregister

Hi,

I find the information on registering a COM server a bit confusing. My situation is as follows: The program which the installer installs is an exe file which contains a COM server (and more). To register or unregister the server, the program must be launched with the /RegServer or /UnregServer command line option and under elevated rights. The installer should do that for me.

What I have tried: Right-click exe file -> properties -> registration, turn on "Auto register" -> Message "The selected file could not be registered"

I should add that I am doing this in a merge module project. The merge module is then imported in the main installer project.

Thanks
Hans
Catalin
Posts: 7528
Joined: Wed Jun 13, 2018 7:49 am

Re: COM EXE Server reister/unregister

Hello Hans,

If I understand correctly from your description, you should register the COM server using a custom action.

For instance, you could use a Launch File custom action that launches the EXE with the "/RegServer" command line passed to it.

Have you tried this and it did not work?
What I have tried: Right-click exe file -> properties -> registration, turn on "Auto register" -> Message "The selected file could not be registered"
The "Registration" tab is for DLL and OCX files, not quite sure if EXE files also work being registered there.
Screenshot_73.png
Screenshot_73.png (13.6 KiB) Viewed 484 times
Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hsc
Posts: 106
Joined: Wed Mar 02, 2016 2:55 pm

Re: COM EXE Server register/unregister

Hi Catalin, thank you for your reply. This does the trick. But how do I unregister the server during uninstallation?

Best
Hans
Catalin
Posts: 7528
Joined: Wed Jun 13, 2018 7:49 am

Re: COM EXE Server reister/unregister

Hello Hans,

You are always welcome! :D
But how do I unregister the server during uninstallation?
The same way, actually.

Just now, we have to keep in mind a few things:

1. the unregister should happen before the files are removed - this is because we need to call the EXE and we can not do that if it is removed first. This means before the "Remove Resources" action group.

2. this time, we have to schedule the custom action to only execute on "Uninstall"
Screenshot_74.png
Screenshot_74.png (4.12 KiB) Viewed 444 times

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”