Search code examples
registryinno-setuptlb

Can I register multiple *.tlb files at once in Inno Setup?


When I try to register all the *.tlb files using a wildcard:

RegisterTypeLibrary(Is64BitInstallMode, ExpandConstant('{app}') + '\TLB\*.tlb');

I get the runtime error 0x80029C4A.

Does it mean that I have to register all the files one by one? Is there a way to register a folder?


Solution

  • You cannot use a wildcard for registering the .tlb file. See the documentation:

    Prototype: procedure RegisterTypeLibrary(const Is64Bit: Boolean; const Filename: String);

    e.g. RegisterTypeLibrary(Is64BitInstallMode, ExpandConstant('{sys}\stdole2.tlb'));

    Also check the correct platform: Is64BitInstallMode() has nothing with .tlb bitness (you can register 32 bit .tlb on 64 bit system without any problem.

    The exception is shown if you try to register library for incorrect platform, which might be your problem.

    • Extra tip: try to run the installer as Administrator, usually the libraries have to be registered in admin mode.