Re: can't get regtypelib to work

43 views
Skip to first unread message

Eivind Bakkestuen

unread,
Jul 6, 2021, 9:00:18 PM7/6/21
to inno...@googlegroups.com
Is there anything in the log when running installer with /LOG parameter?

On Wed, Jul 7, 2021 at 4:18 AM dma...@gmail.com <dma...@gmail.com> wrote:

Hi all. I have an install that requires registering a type library for a custom DLL. This works fine on my PC where I have full admin privileges, but I can't get it to work on other machines, even when I set 'PrivilegesRequired=admin'.

I've tried multiple approaches. The first two definitely work on my machine but don't work on other folks machines, even when they seem to have admin rights. Would appreciate any ideas or guidance!

1. use 'regtypelib' in the files section (example):
Source: "C:\MyDLL.tlb"; DestDir: "{app}"; Flags: regtylelib ignoreversion

2. Adding the following the to [Run] section:
Filename: {reg:HKLM\SOFTWARE\Microsoft\.NETFramework,InstallRoot}\v4.0.30319\RegAsm.exe; Parameters: MyDLL.dll /codebase; WorkingDir: {app}; StatusMsg: Registering controls...; Flags: runhidden runascurrentuser;
Filename: {reg:HKLM\SOFTWARE\Microsoft\.NETFramework,InstallRoot}\v4.0.30319\RegAsm.exe; Parameters:  MyDLL.dll /tlb:SES_Tools.tlb; WorkingDir: {app}; StatusMsg: Registering type library...; Flags: runhidden runascurrentuser;

2. Adding the following to the [Code] section:
RegisterTypeLibrary(Is64BitInstallMode, ExpandConstant('{app}\ MyDLL.tlb '));

--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/4da37fb0-2608-4eb7-8973-5a9084972b5dn%40googlegroups.com.

Eivind Bakkestuen

unread,
Jul 6, 2021, 9:01:14 PM7/6/21
to inno...@googlegroups.com
DLL has dependencies on other DLLs not on the target machines?
Message has been deleted

dma...@gmail.com

unread,
Jul 7, 2021, 4:20:34 PM7/7/21
to innosetup
The problem isn't dependencies on other DLLs, but I think I've narrowed things down.

I'm using {reg:HKLM\SOFTWARE\Microsoft\.NETFramework,InstallRoot} to figure out if I should be using the 32 or 64-bit version of RegAsm.exe. When I look into the registry at that key, it shows:

c:\windows\microsoft.net\framework64\

But, when I run the install script, the value it's using is:

c:\windows\microsoft.net\framework\  <---NOT THE 64-bit framework

So what's happening is, the DLL type library is successfully registering (I compiled it to run on any PC), but using the 32-bit RegAsm.exe. But then it doesn't work in a 64-bit context. If I manually register it (on the target machine), using the RegAsm.exe in the framework64 folder, it succeeds, and then everything works perfectly.

So the problem is that Inno is getting the wrong folder information from {reg:HKLM\SOFTWARE\Microsoft\.NETFramework,InstallRoot}. I'm pretty stumped at this point. Has anyone else run into this?

dma...@gmail.com

unread,
Jul 7, 2021, 4:52:13 PM7/7/21
to innosetup
OK, I figured it out. I feel a little silly for not catching this earlier. What I needed to do to make it work was specify HKLM64 with a IsWin64 check and add a corresponding line with HKLM32 with a "not IsWin64" check for 32-bit installs.

Seems to work now!

Eivind Bakkestuen

unread,
Jul 7, 2021, 11:26:02 PM7/7/21
to inno...@googlegroups.com
The

[Registry] section


part of the documentation explains how to explicitly access the 32 or 64 bit registry hives. Check if that helps?


Reply all
Reply to author
Forward
0 new messages