antmar904 Posted July 21, 2016 Posted July 21, 2016 Hi, Do we need to have two scripts one for 32 and one for 64bit when using the built in macros? I am creating a installer for a program but first I check to see if the program is already installed by looking for the main exe in the program files dir by using @ProgramFilesDir. If I run my script in 32bit on a 64bit computer it does not find the exe, but if I run the script in 64bit on my 64bit computer it finds the exe. I really don't want to create two install scripts on for each OS arch if possible.
antmar904 Posted July 21, 2016 Author Posted July 21, 2016 Or I can do something like this If @OSArch = "X64" Then Global $ProgramDir = "C:\Program Files" Else Global $ProgramDir = "C:\Program Files (x86)" EndIf
AutoBert Posted July 21, 2016 Posted July 21, 2016 A 32 bit script, checking on which OS running, and calling some different funcs, should also do the job. Quote Running the 32-bit version of AutoIt on a x64 System For Files, Windows has a special redirection mechanism for some system directories : Directories 32-bit Value 64-bit Value @SystemDir @WindowsDir & "\System32" @WindowsDir & "\SYSWOW64" @ProgramFilesDir {SystemDrive} & "\Program Files (x86)" {SystemDrive} & "\Program Files" It's possible to access the 64-bit version of those directories by disabling the redirection mechanism. #include <WinAPIFiles.au3>_WinAPI_Wow64EnableWow64FsRedirection(True) Additional information can be found at MSDN.
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