I'd like to get as well the "x64" values of these Autoit Macros for the Windows 7 64bit boxes, when using the compilation target = "x86". The background is simply, that few PCs don't have a x64 capable CPU, so the scripts have to run on both, x86 and x64 Win7. Hence I compile them as "target = x86", as this will run on both, x86 and x64 Win7 boxes.

But on the Win7 boxes I need to get both, the "x86-macro-values" as well as the "x64-macro-values".

One thing I could think of is to compile the script as <scriptname>.exe (x86) and a 2nd time as <scriptname>-x64.exe, and then call the one from the other, in case "@OSArch = X64". But I'd like to avoid to have to compile two versions of these scripts.

Any other suggestions?

Regards, Rudi.

<edit>

PS: I missed to mention, that trying to make use the Windows Environment Variables doesn't help here:

e.g. envget("Programfiles") and envget("Programfiles(x86)") will *BOTH* return "c:Program files(x64)", when the target of the script is "x86".

Share this post

Link to post

Share on other sites

guinness 1,458

guinness 1,458

doing so will produce *TWO* EXE files, one <scriptname>.exe, the other one <scriptname>_x64.exe.

Correct.

The first one will return the values for "x86" ONLY.

Correct.

The "*_x64.exe" will not run on x86 systems: " ... is not a valid Win32 application."

64-bit executables work on 64-bit OS's only.

Is there a posibility to create a x64 application, with a "x86 fallback" that will only execute, when runned on x86 systems?

Create a 32-bit wrapper and use FileInstall to 'FileInstall' the 32-bit and 64-bit, then in the wrapper find out if the OS is x64 and 'FileInstall' the 64-bit, else use the 32-bit executable.
Edited April 29, 2012 by guinness