cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yesso79
Level 3

CallDllFx on 64-bit dont work

Hi,

i am building a installer on a 32-bit OS for 64-bit OS. i use the following the installscript:

nExitCode = CallDLLFx(szDllFilePath, "ISHelper", nPathBuffer, szArgumentString);


i am using the script for 32-bit installer and it works, but in my 64-bit installer it dont work! It returns: "-1".

Is CallDllFx not working on 64-bit systems ?

LaunchAppAndWait i can not use, because i am calling rundll32.exe which gives me not the return value from the called function back...

thanks
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

With LaunchAppAndWait (and similar), you can use the nLaunchResult field of LAAW_PARAMETERS to capture the return value.

(As mentioned in the CallDllFx help topic, you might also consider "upgrading" to UseDLL and the like.)
0 Kudos
yesso79
Level 3

hi,

i have tried it about LAAW_PARAMETERS.nLaunchResult:

nExitCode = LaunchAppAndWait("rundll32.exe", szTmp, LAAW_OPTION_WAIT);
NumToStr(szExitCode, LAAW_PARAMETERS.nLaunchResult);
MessageBox("Launched LaunchAppAndWait: ExitCode: " + szExitCode + ".", SEVERE);


rundll32.exe gives back "0", irrespective of the function has been found or not!

so i can not use rundll32.exe, is there another solution to get back the return code of the function which should called about rundll32.exe ?

thanks
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The InstallScript engine is built as 32-bit code, so it is not possible to load a 64-bit DLL from InstallScript. The simplest solution would be to create a wrapper executable that mimics the functionality of rundll32 (i.e., LoadLibrary to load the DLL, GetProcAddress to get the address of the DLL entry point to call) and then return the value with the executable that is provided by the DLL. The executable can then be launched with LaunchAppAndWait and the result obtained from LAAW_PARAMETERS.nLaunchResult (after the EXE completes).
0 Kudos
yesso79
Level 3

Hi,

i tried it about the UseDLL function but it dont works. Every time it fails because my dll, which i have added to the support files under language independent, will not unpack to the temp folder...

what can be the reason ?

thanks
0 Kudos