au3scr Posted December 6, 2007 Posted December 6, 2007 Script dont click on I accept button Whats wrong here? could any one say it? Run (@scriptdir&"\wmp11-windowsxp-x86-enu.exe") WinWaitActive("Windows Media Player 11","") WinWaitNotActive("Windows Media Player 11","") WinWaitActive("Windows Media Player 11","") ControlClick("Windows Media Player 11", "", "[CLASS:Button; TEXT:&Validate; INSTANCE:6]") ControlClick("Windows Media Player 11", "", "[CLASS:Button; TEXT:I &Accept; INSTANCE:5]")
au3scr Posted December 6, 2007 Author Posted December 6, 2007 http://download.microsoft.com/download/0/9...sxp-x86-enu.exe
au3scr Posted December 6, 2007 Author Posted December 6, 2007 >>>> Control <<<< Class: Button Instance: 5 ClassnameNN: Button5 ID: 39302 Text: I &Accept Position: 508, 420 Size: 80, 22 ControlClick Coords: 33, 19 Style: 0x50010000 ExStyle: 0x00000020
weaponx Posted December 7, 2007 Posted December 7, 2007 Are you trying to automate the installation of Windows Media Player 11? If so there are rules for automating software installs. Is there command line options for a silent install? If so, use them. If not, check again! If there isn't any other choice, then manually automate (oxymoron). START /WAIT wmp11-windowsxp-x86-enu.exe /Q:A /C:"SETUP_WM.EXE /Q:A /R:N /P:#e"
au3scr Posted December 7, 2007 Author Posted December 7, 2007 I havent heard anything about command line installing and silent mode Can you tell me more about that?
weaponx Posted December 7, 2007 Posted December 7, 2007 Most programs have silent install options, especially if they are created with InstallShield or if they are msi files. Any time you plan to automate a program always do a google search for <program name> silent install A lot of times you can go to the command prompt and type in the name of the installer with /? to get a list of command line options wmp11-windowsxp-x86-enu.exe /?
au3scr Posted December 7, 2007 Author Posted December 7, 2007 Then i make script Run(@scriptdir&"\wmp11-windowsxp-x86-enu.exe /Q " ? or how i run it with command option?
weaponx Posted December 7, 2007 Posted December 7, 2007 No no no. You must be new to programming. Click Start > Run > cmd.exe Type: wmp11-windowsxp-x86-enu.exe /Q Hit enter. You will see a list of commands. If you want to perform the silent install from your script do this: RunWait('wmp11-windowsxp-x86-enu.exe /Q:A /C:"SETUP_WM.EXE /Q:A /R:N /P:#e"', "C:\Path to EXE\") Change the C:\Path to EXE\ to the folder where the exe is respectively.
au3scr Posted December 7, 2007 Author Posted December 7, 2007 I am back now.. Quiet install is bad way for script installing I still need script that clicks on I Accept button Help me please I have made something totally wrong Run (@scriptdir&"\wmp11-windowsxp-x86-enu.exe") WinWaitActive("Windows Media Player 11") WinWaitNotActive("Windows Media Player 11") WinWaitActive("Windows Media Player 11") ControlClick("Windows Media Player 11", "", "[CLASS:Button; TEXT:&Validate; INSTANCE:6]") ControlClick("Windows Media Player 11", "", "[CLASS:Button; TEXT:I &Accept; INSTANCE:5]")
weaponx Posted December 7, 2007 Posted December 7, 2007 ;CLICK VALIDATE $handle = ControlGetHandle ("[CLASS:#32770]", "", "[CLASSNN:Button6]") If NOT @ERROR Then ControlClick("","",$handle) Sleep(3000) ;CLICK I ACCEPT $handle = ControlGetHandle ("[CLASS:#32770]", "", "[CLASSNN:Button5]") If NOT @ERROR Then ControlClick("","",$handle)
au3scr Posted December 7, 2007 Author Posted December 7, 2007 (edited) Thanks alot, It works. but i dont understand it well (how it works) Can you teach me what is what And why there is sleep? Edited December 7, 2007 by au3scr
au3scr Posted December 7, 2007 Author Posted December 7, 2007 It dont select Express settins I dont like sleep here Run (@scriptdir&"\wmp11-windowsxp-x86-enu.exe") WinWaitActive("Windows Media Player 11") WinWaitNotActive("Windows Media Player 11") WinWaitActive("Windows Media Player 11") ;CLICK VALIDATE $handle = ControlGetHandle ("[CLASS:#32770]", "", "[CLASSNN:Button6]") If NOT @ERROR Then ControlClick("","",$handle) Sleep(3000) ;CLICK I ACCEPT $handle = ControlGetHandle ("[CLASS:#32770]", "", "[CLASSNN:Button5]") If NOT @ERROR Then ControlClick("","",$handle) $handle = ControlGetHandle ("[CLASS:#32770]", "", "[CLASSNN:Button1]") If NOT @ERROR Then ControlClick("","",$handle) -----------------------------------------------------------------
weaponx Posted December 7, 2007 Posted December 7, 2007 The sleep is there because the window after Activate has the same title and class #as the first one.
au3scr Posted December 7, 2007 Author Posted December 7, 2007 (edited) I Edited source, now it click validate and then close script and wm player 11 setup Run (@scriptdir&"\wmp11-windowsxp-x86-enu.exe") WinWaitActive("Windows Media Player 11") WinWaitNotActive("Windows Media Player 11") ControlClick("Windows Media Player 11", "", "[ClassNN:Button6]") ;~ Sleep(3000) ControlClick("Windows Media Player 11", "", "[ClassNN:Button5]") ControlClick("Windows Media Player 11", "", "[ClassNN:Button1]") ControlClick("Windows Media Player 11", "", "[ClassNN:Button9]")oÝ÷ ØhÙbë%yêlr¸©¶k¬¶éÝz»-jwpéâ¶wvËhrXw±´¸¤zÇ+bv'_¢·âçèÆz0j+b®¶sg6ÆVW¥våvD7FfRgV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²¥6VæBgV÷C¶âgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¤f×¶66WBFRFW&×2âFRÆ6Vç6Rw&VVÖVçC²å5Dä4S£EÒgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¢f×´æWBfwC³²å5Dä4S£%ÒgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¢f×´7W7FöÒfwC³²å5Dä4S£UÒgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¢f×´æWBfwC³²å5Dä4S£%ÒgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¢f×´æWBfwC³²å5Dä4S£%ÒgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¢f×´æWBfwC³²å5Dä4S£%ÒgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¢f×´æWBfwC³²å5Dä4S£%ÒgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¢f×´æWBfwC³²å5Dä4S£%ÒgV÷C²¤6öçG&öÄ6Æ6²gV÷C´Ö÷¦ÆÆf&Vf÷6WGWgV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤'WGFöã²DUC¢f×´ç7FÆÂfwC³²å5Dä4S£%ÒgV÷C² Edited December 7, 2007 by au3scr
weaponx Posted December 8, 2007 Posted December 8, 2007 (edited) I don't like sleep either but calling this script causes the installation to exit:;CLICK VALIDATE $handle = ControlGetHandle ("[CLASS:#32770]", "", "[CLASSNN:Button6]") If NOT @ERROR Then ControlClick("","",$handle) ;CLICK I ACCEPT $handle = ControlGetHandle ("[CLASS:#32770]", "", "[CLASSNN:Button5]") If NOT @ERROR Then ControlClick("","",$handle)The window title and class don't change so it will perform two actions on the first window. It did it to me on my work computer. It clicks Validate (Button6), which takes a few seconds to respond and then clicks Cancel (Button5) immediately. Sleep is the only way I could see to get past. Edited December 8, 2007 by weaponx
au3scr Posted December 8, 2007 Author Posted December 8, 2007 ok but how i get sleep time between accept and finish? Slower computers need more time and faster computers need less time
weaponx Posted December 8, 2007 Posted December 8, 2007 That is very true and I rarely use sleep because of this. It was just a quick solution because you will have to check the actual names of the buttons before clicking them and that can be tricky.
au3scr Posted December 9, 2007 Author Posted December 9, 2007 you will have to check the actual names of the buttons before clicking them and that can be tricky.What u mean with this?how i do it?Sorry for my bad understanding
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