Created
April 16, 2023 15:08
-
-
Save jglathe/d35ce5f00b95237ffe512296bc3f8681 to your computer and use it in GitHub Desktop.
innosetup import external library for specific call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Files] | |
;for the install package: VersionInfo.dll | |
Source: "VersionInfo.dll"; Flags: dontcopy; | |
[Code] | |
function GetWindowsBuildNumber: Integer; | |
external '_GetWindowsBuildNumber@0@files:VersionInfo.dll stdcall delayload'; | |
//in a function | |
BuildNumber := GetWindowsBuildNumber(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That was quite a session with ChatGPT and StackOverflow to hack this out. For the real name in the dll you need DependencyWalker. The dll will only be loaded at installation for something you can't do in InnoSetup. It's a good idea to compile the dll for x86. Turns out you can do this directly (getting the Build Number), but maybe it's useful for a case where you can't.