Jump to content

Recommended Posts

Posted

here is my code to currently install Mathematica

Run ( "setup.exe" )
WinWaitActive ("Mathematica 5.1 Setup" , "Installation Folder" )
ControlClick ("Mathematica 5.1 Setup","B&rowse...","Button6")
WinwaitActive ("Choose Folder","Please choose the installation folder.")
ControlSend ("Choose Folder" , "" ,"Edit1" , @ProgramFilesDir & "\Mathematica 5.1")
ControlClick ("Choose Folder","OK","Button1")
WinWaitActive ("Mathematica 5.1 Setup" , "Installation Folder" )
ControlClick ("Mathematica 5.1 Setup","I&nstall","Button1")
======================================================
WinActivate ("Mathematica 5.1 Setup" , "&Enter license information now" )
WinWaitActive ("Mathematica 5.1 Setup" , "&Enter license information now" )
ControlClick ("Mathematica 5.1 Setup","&Finish","Button2")
WinActivate ("Personalize Mathematica" , "Net&work License" )
WinWaitActive ("Personalize Mathematica" , "Net&work License" )
ControlSend ("Personalize Mathematica" , "" , "Edit3" , "xxxxx-xxxx" )
ControlClick ("Personalize Mathematica" , "OK" , "Button4")
Winwaitactive ("Personalize Mathematica" , "&MathID" )
ControlSend ("Personalize Mathematica" , "" , "Edit1" ,"xxxx-xxxxx-xxxxx" )
ControlSend ("Personalize Mathematica" , "" , "Edit2" ,"xxxx-xxx-xxx" )
ControlClick ("Personalize Mathematica", "OK" , "Button2")
ProcessClose ( "Mathematica.exe" )

the equals singns are durring the actual installation at the end of which the finalization window gets loaded however the finalization window is not laoded active and i cant figure out how to activate it. once i manually activate it the rest of the script runs fine.

Thanks all


Posted

Run ( "setup.exe" )
WinWait ("Mathematica 5.1 Setup" , "Installation Folder" )
ControlClick ("Mathematica 5.1 Setup","B&rowse...","Button6")
Winwait ("Choose Folder","Please choose the installation folder.")
ControlSend ("Choose Folder" , "" ,"Edit1" , @ProgramFilesDir & "\Mathematica 5.1")
ControlClick ("Choose Folder","OK","Button1")
WinWait ("Mathematica 5.1 Setup" , "Installation Folder" )
ControlClick ("Mathematica 5.1 Setup","I&nstall","Button1")
;=================================================
WinWait ("Mathematica 5.1 Setup" , "&Enter license information now" )
ControlClick ("Mathematica 5.1 Setup","&Finish","Button2")
WinWait ("Personalize Mathematica" , "Net&work License" )
ControlSend ("Personalize Mathematica" , "" , "Edit3" , "xxxxx-xxxx" )
ControlClick ("Personalize Mathematica" , "OK" , "Button4")
Winwait ("Personalize Mathematica" , "&MathID" )
ControlSend ("Personalize Mathematica" , "" , "Edit1" ,"xxxx-xxxxx-xxxxx" )
ControlSend ("Personalize Mathematica" , "" , "Edit2" ,"xxxx-xxx-xxx" )
ControlClick ("Personalize Mathematica", "OK" , "Button2")
ProcessClose ( "Mathematica.exe" ); <-- Seems very abrupt ending ?

Activating windows should not be needed. All the Control* functions will operate on inactive windows. Windows needed only to be active for functions like Send().

;)

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