I'm not having any luck importing a Delphi DLL into Inno Setup (Unicode). The DLL has a simple procedure..
procedure Foo(); stdcall;
begin
end;
exports
Foo;
The DLL is included in the installer source, and added to the files list:
[Files]
Source: "MyDLL.dll"; Flags: dontcopy
Then, I extract this DLL in the initialization:
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('MyDLL.dll');
end;
And finally, declared this procedure in the script:
function DoFoo(): Bool;
external '[email protected] stdcall';
However, when I run the setup, I get an error:
Cannot Import dll: <utf8>MyDLL.dll.
What am I doing wrong?
File not found MyDLL.dll
– Jerry DodgeCodeRunnerOnDllImport
event method for libraries which are loaded at initialization (not forced to delay load). If the library wouldn't exist, it would report some more sensible message, terminate the setup and avoid attempting to import function from a non existing library file anymore. Yes, such a check would be fine. – TLama