Jump to content

Recommended Posts

Posted (edited)

Hi.

Some Autoit Macros return different values on X64 Win7 boxes, dependent on the target choosen upon compiling the script: x86 or x64.

Target = x64
@AutoItExe = file01installtoolstestAI3-Test-Macros-x64.exe
@OSArch = X64
@AutoItX64 = 1
@CommonFilesDir = C:Program FilesCommon Files
@ProgramFilesDir = C:Program Files
@SystemDir = C:\Windows\System32\

Target = x86
@AutoItExe = file01installtoolstestAI3-Test-Macros-x86.exe
@OSArch = X64
@AutoItX64 = 0
@CommonFilesDir = C:Program Files (x86)Common Files
@ProgramFilesDir = C:Program Files (x86)
@SystemDir = C:WindowsSysWOW64

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".

</edit>

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Posted

The macros are evaluated at run-time. If the exe is compiled for 32 bit you'll get the 32 bit values otherwies the values for 64 bit.

Use directives

#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
and you will compile for 32 and 63 bit in one go.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

Hi.

Thanks for the incredible fast reply ;)

#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y

MsgBox(0,"Programfiles",@ProgramFilesDir & @CRLF & EnvGet("programfiles(x86)"))

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

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

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

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

Regards, Rudi.

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Posted (edited)

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 by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Posted

Hi.

thanks for your reply. Looks like the wrapper is the only way to get it done in one executable... ;)

Let me ask again this one question: There is no way to get the x64 values for the autoit macros from an Autoit EXE file, compiled with "target = x86" ?

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Posted

Let me ask again this one question: There is no way to get the x64 values for the autoit macros from an Autoit EXE file, compiled with "target = x86" ?

Correct

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

Hi.

Frustrating...

You've *SPOILED* my Sunday ;)

:):D :D

OK, I'll use the fileinstall() solution, you've mentioned before.

Thanks for your replies, Rudi.

PS: Wouldn't that be a nice feature for future releases of Autoit, to get the Win7 macro values for x64, even when the script is compiled to x86, and vice versa?

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...