Alex Lau Posted November 21, 2006 Share Posted November 21, 2006 (edited) hi , can anyone help to check my script below ? it's always paused on the first window when i run it , i don't know what's happened, i have ran many test for this script , sometime succesfully and sometimes failed. i don't know what can i do. ---------------------------------------------------------------------- $answer = MsgBox(64+4, "SAP GUI Upgrade", "This program will upgrade SAP GUI from 6.20 to 6.40. do you want to do it now ?") If $answer = 7 Then Exit EndIf RunAsSet("Administrator", "xxxxx", "xxxxxx") RunWait("\\172.16.16.39\mis\source\sapgui640\setup.exe") WinWaitActive("SAP Front-End Configuration Wizard - [step 1 of 2]") ;The script pasued on the window above , but when i run the script again, it will pass, and there two AutoIt icons in the system icon area!!! Send("{Enter}") WinWaitActive("SAP Front-End Configuration Wizard - [step 2 of 2]") Send("{Enter}") WinWaitActive("SAP Front-End Setup Wizard") Send("{Enter}") RunAsSet() $answer = msgbox(0, "SAP GUI Upgrade", "Completed!") ------------------------------------------------------------------------ Thank you very much !!! Edited November 21, 2006 by Alex Lau Link to comment Share on other sites More sharing options...
Alex Lau Posted November 21, 2006 Author Share Posted November 21, 2006 hi , can anyone help to check my script below ? it's always paused on the first window when i run it , i don't know what's happened, i have ran many test for this script , sometime succesfully and sometimes failed. i don't know what can i do. ---------------------------------------------------------------------- $answer = MsgBox(64+4, "SAP GUI Upgrade", "This program will upgrade SAP GUI from 6.20 to 6.40. do you want to do it now ?") If $answer = 7 Then Exit EndIf RunAsSet("Administrator", "xxxxx", "xxxxxx") RunWait("\\172.16.16.39\mis\source\sapgui640\setup.exe") WinWaitActive("SAP Front-End Configuration Wizard - [step 1 of 2]") ;The script pasued on the window above , but when i run the script again, it will pass, and there two AutoIt icons in the system icon area!!! Send("{Enter}") WinWaitActive("SAP Front-End Configuration Wizard - [step 2 of 2]") Send("{Enter}") WinWaitActive("SAP Front-End Setup Wizard") Send("{Enter}") RunAsSet() $answer = msgbox(0, "SAP GUI Upgrade", "Completed!") ------------------------------------------------------------------------ Thank you very much !!! about the "2 tray icons" problem i know i need add "#NoTrayIcon" in the first line Link to comment Share on other sites More sharing options...
MHz Posted November 21, 2006 Share Posted November 21, 2006 If you want your script to continue while the setup is running, then you need to use Run(). I added window activation as well. $answer = MsgBox(64 + 4, "SAP GUI Upgrade", "This program will upgrade SAP GUI from 6.20 to 6.40. do you want to do it now ?") If $answer = 7 Then Exit EndIf RunAsSet("Administrator", "xxxxx", "xxxxxx") $pid = Run("\\172.16.16.39\mis\source\sapgui640\setup.exe") WinWait("SAP Front-End Configuration Wizard - [Step 1 of 2]") If Not WinActive("SAP Front-End Configuration Wizard - [Step 1 of 2]") Then WinActivate("SAP Front-End Configuration Wizard - [Step 1 of 2]") EndIf WinWaitActive("SAP Front-End Configuration Wizard - [Step 1 of 2]") Send("{Enter}") WinWait("SAP Front-End Configuration Wizard - [Step 2 of 2]") If Not WinActive("SAP Front-End Configuration Wizard - [Step 2 of 2]") Then WinActivate("SAP Front-End Configuration Wizard - [Step 2 of 2]") EndIf WinWaitActive("SAP Front-End Configuration Wizard - [Step 2 of 2]") Send("{Enter}") WinWait("SAP Front-End Setup Wizard") If Not WinActive("SAP Front-End Setup Wizard") Then WinActivate("SAP Front-End Setup Wizard") EndIf WinWaitActive("SAP Front-End Setup Wizard") Send("{Enter}") ProcessWaitClose($pid) RunAsSet() MsgBox(0, "SAP GUI Upgrade", "Completed!") Link to comment Share on other sites More sharing options...
Alex Lau Posted November 21, 2006 Author Share Posted November 21, 2006 If you want your script to continue while the setup is running, then you need to use Run(). I added window activation as well. $answer = MsgBox(64 + 4, "SAP GUI Upgrade", "This program will upgrade SAP GUI from 6.20 to 6.40. do you want to do it now ?") If $answer = 7 Then Exit EndIf RunAsSet("Administrator", "xxxxx", "xxxxxx") $pid = Run("\\172.16.16.39\mis\source\sapgui640\setup.exe") WinWait("SAP Front-End Configuration Wizard - [Step 1 of 2]") If Not WinActive("SAP Front-End Configuration Wizard - [Step 1 of 2]") Then WinActivate("SAP Front-End Configuration Wizard - [Step 1 of 2]") EndIf WinWaitActive("SAP Front-End Configuration Wizard - [Step 1 of 2]") Send("{Enter}") WinWait("SAP Front-End Configuration Wizard - [Step 2 of 2]") If Not WinActive("SAP Front-End Configuration Wizard - [Step 2 of 2]") Then WinActivate("SAP Front-End Configuration Wizard - [Step 2 of 2]") EndIf WinWaitActive("SAP Front-End Configuration Wizard - [Step 2 of 2]") Send("{Enter}") WinWait("SAP Front-End Setup Wizard") If Not WinActive("SAP Front-End Setup Wizard") Then WinActivate("SAP Front-End Setup Wizard") EndIf WinWaitActive("SAP Front-End Setup Wizard") Send("{Enter}") ProcessWaitClose($pid) RunAsSet() MsgBox(0, "SAP GUI Upgrade", "Completed!") working perfection !! Thank you very much ! Link to comment Share on other sites More sharing options...
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