Sign in to follow this  
Followers 0
itsame

If Then for 64 bit

7 posts in this topic

Hi,

I am about to send out some software to over +500 users to install. I have used auto-it to guide it through all of the customizable sections. The problem is that there is different install questions for 32 bit Windows and 64 bit Windows? Is there a if/then statement I can put into Auto-it to tell it to run 1 set of code if it is 32 bit and another set of code if it is 64 bit.

Share this post


Link to post
Share on other sites



Use the @OSArch macro:

Switch @OSArch
     Case "x86"
          ; Do stuff for x86
     Case "x64"
          ; Do stuff for x64
     Case "IA64"
          ; Do stuff for IA64
     Case Else
          MsgBox(16, "Error", "Unhandled case: CPU architecture not recognized")
          Exit
EndSwitch

:graduated:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

The macro @CPUArch Returns "X86" when the CPU is a 32-bit CPU and "X64" when the CPU is 64-bit.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The rolly-polly bird has the right answer but IMHO you can forget about using special code for the Itanium since there is no more development by Microsoft being done after Server 2008. IA64 is pretty much a dead issue now and the systems that have it will be getting swapped out fairly soon.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The macro @CPUArch Returns "X86" when the CPU is a 32-bit CPU and "X64" when the CPU is 64-bit.

Many people are running a 32-bit OS on a 64-bit capable CPU or VM. So for software installation purposes, @OSArch might be more appropriate.

:(

Edit: And I am not "rolly-polly", I'm FLUFFY!

:graduated:

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Ya, it seems to me that @OSArch would be more appropiate. I didn't read far enough.. :graduated:


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

I am in the process of installing virtual machines to test but, this is the code I have. Since I am new to Auto-it, I wanted to know if anybody saw a problem with this.

; Run the install
Switch @OSArch
     Case "x86"

Run('sas\setup.exe')

WinWaitActive("Choose Language")
Send("{ENTER}")

WinWaitActive("SAS Deployment Wizard")
Send("{ENTER}")
Sleep(1000) 

WinWaitActive("SAS Deployment Wizard")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{SPACE}")
Send("{ENTER}")
Sleep(1000) 

WinWaitActive("SAS Deployment Wizard")
Send("{ENTER}")
Sleep(1000) 

WinWaitActive("SAS Deployment Wizard")
Send("!c")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")

Sleep(100)
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(100) 
Send("{ENTER}")

WinWaitActive("SAS Deployment Wizard")
Sleep(100) 
Send("{ENTER}")

WinWaitActive("SAS Deployment Wizard")
Sleep(100) 
Send("!c")
Send("!n")
Sleep(100)

WinWaitActive("SAS Deployment Wizard")
Sleep(100)
Send("!n")


Case "x64"
Run('sas\setup.exe')

WinWaitActive("Choose Language")
Send("{ENTER}")

WinWaitActive("SAS Deployment Wizard")
Send("{ENTER}")
Sleep(1000) 

WinWaitActive("SAS Deployment Wizard")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{SPACE}")
Send("{ENTER}")
Sleep(1000) 

WinWaitActive("SAS Deployment Wizard")
Send("{ENTER}")
Sleep(1000) 

WinWaitActive("SAS Deployment Wizard")
Send("{TAB}")
Send("{SPACE}")
Send("{ENTER}")
Sleep(1000) 

WinWaitActive("SAS Deployment Wizard")
Send("!c")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")

Sleep(100)
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(1000) 

Send("{DOWN}")
Sleep(100) 
Send("{SPACE}")
Sleep(100) 
Send("{ENTER}")

WinWaitActive("SAS Deployment Wizard")
Sleep(100) 
Send("{ENTER}")

WinWaitActive("SAS Deployment Wizard")
Sleep(100) 
Send("!c")
Send("!n")
Sleep(100)

WinWaitActive("SAS Deployment Wizard")
Sleep(100)
Send("!n")

EndSwitch

Again, thanks a lot for helping me with the OSArch.

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