i have to check, if a application binary is 32 or 64 bit inside a Section.
Depending on the return value i have to execute different MSI-packages.
Windows has a nice function GetBinaryTypeA but i don't know how to set the parameters in NSIS syntax.
Here is what i have:
I only need the integer returned by the function. But i do always get $2 = 0, even if i use a invalid filename 😕
; Set output path to the windows\system32 directory.
SetOutPath $WINDIR\System32 ; Set Path to kernel32.dll
StrCpy $0 "C:\Program Files\Microsoft Office\root\Office16\winword.exe" ; assign memory to $0
System::Call 'Kernel32::GetBinaryTypeA(t, *i) i(.r0, r1r1).r2'
DetailPrint 'Path: "$0"'
DetailPrint "Path length: $1"
DetailPrint "Return value: $2"
$0 is always empty and $1 is always a 6 digit number.
Thanks in advance!
Best regards,
Pascal