MaryannJust Posted December 7, 2011 Posted December 7, 2011 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
norry Posted December 7, 2011 Posted December 7, 2011 (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 December 7, 2011 by norry
Shaggi Posted December 7, 2011 Posted December 7, 2011 Nope, you can however make a second program that executes x64 version or x86 depending on @osarch. Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG
UEZ Posted December 7, 2011 Posted December 7, 2011 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now