Can't register a type library in my install script

172 views
Skip to first unread message

dma...@gmail.com

unread,
Jul 6, 2021, 2:19:42 PM7/6/21
to innosetup

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:MyDLL.tlb; WorkingDir: {app}; StatusMsg: Registering type library...; Flags: runhidden runascurrentuser;

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

Gavin Lambert

unread,
Jul 11, 2021, 6:49:54 PM7/11/21
to inno...@googlegroups.com
On 7/07/2021 6:19 am, 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!

Bear in mind that by default Inno assumes that you are installing a
32-bit app and components; this means that the registry entries will
appear in the 32-bit registry and not the 64-bit registry.

This means that if you're using regedit to verify if the entries are
there, then you need to look in a different place (under the
Wow6432Node). It will be visible only to 32-bit applications.

If your component is actually 64-bit instead, then you should either
flag it as such individually if the app is still 32-bit, or put the
entire setup into 64-bit mode if the app is 64-bit too.
Reply all
Reply to author
Forward
0 new messages