Sign in to follow this  
Followers 0
MaryannJust

Compile single file for both 32 bit and 64 bit?

4 posts in this topic

I see there's an x64 check box to compile for 64 bit platforms and unchecking will compile for 32 bit; is there a way to compile a single file that will work on both platformes (Windows 7 Ultimate)? So far I haven't been able to use one exe for both types of machines. The script is small anyway so size isn't an issue, I would like to manage only one file rather than two if possible? Any suggestions?

Thanks :D

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi I just compile 32bit exe's but take care when either messing with the registry or system directories.

For example.

Have a look at ttp://msdn.microsoft.com/en-us/library/Aa384187 which describes windows redirection

So you could put something like this at the top of your code and then just use $SystemDir throughout the code

If @OSArch = "X64" and @AutoItX64 <> 1 Then
$SystemDir = @WindowsDir & "Sysnative"
Else
$SystemDir = @SystemDir
EndIf

and for accessing the registry put something like this when declaring variables and use $HKCU etc throughout your code if/when you access the registry

If @OSArch = "X64" And @AutoItX64 <> 1 Then
$HKCU = "HKEY_CURRENT_USER64"
$HKLM = "HKEY_LOCAL_MACHINE64"
$HKU = "HKEY_USERS64"
$HKCR = "HKEY_CLASSES_ROOT64"
$HKCC = "HKEY_CURRENT_CONFIG64"
Else
$HKCU = "HKEY_CURRENT_USER"
$HKLM = "HKEY_LOCAL_MACHINE"
$HKU = "HKEY_USERS"
$HKCR = "HKEY_CLASSES_ROOT"
$HKCC = "HKEY_CURRENT_CONFIG"
EndIf
Edited by norry

Share this post


Link to post
Share on other sites

Download latest beta of AutoIt3Wrapper and use this to compile both versions:

#AutoIt3Wrapper_Compile_both=y

or this workaround

#AutoIt3Wrapper_Run_Before=del /f /q "%scriptfile%_x64.exe"
#AutoIt3Wrapper_Run_Before=del /f /q "%scriptfile%_x86.exe"
#AutoIt3Wrapper_Run_Before=""%autoitdir%aut2exeaut2exe.exe" /in "%in%" /out "%scriptdir%%scriptfile%_x64.exe" /nopack /x64"
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Run_After=ren "%out%" "%scriptfile%_x86.exe"

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0