Register an exe file as OLE server with Inno Setup

706 Views Asked by At

I want to register an EXE file as OLE server with Inno Setup. When I use my EXE file path with Regserver parameter in cmd, everything is correct.

But when I use the regserver flag in Inno Setup like this:

Source: "{src}\App\MyApp.exe"; DestDir: "{app}"; Flags: external regserver

I got this error

Unable to register the DLL/OCX: Regsvr32 failed with exit code 0x4.

What should I do?

1

There are 1 best solutions below

0
Martin Prikryl On BEST ANSWER

The regserver flag is for DLL/OCX files only. There's no standard way to register EXE files, so it cannot be handled natively by Inno Setup, the same way you cannot use regsvr32 with an EXE file.

If your EXE file has a custom command-line parameter for the registration, use it in Inno Setup in the Run section:

[Run]
Filename: "{app}\MyApp.exe"; Parameters: "Regserver"