Sorian 0 Posted May 18, 2006 I need some help on a script.I am trying to automate the install for Windows Media Player 10, but I can't get it running 100% right.Here is the current script:Run("MP10Setup.exe")WinWaitActive("Windows Media Player 10", "Thank you for choosing Windows Media Player 10")Send("!a")WinWaitActive("Windows Media Player 10", "Confirm software download")Send("!a")If WinActive("Security Warning")then Send("!y")If WinActive("Microsoft Windows Media Configuration Utility")then Send("!r")WinWaitActive("Windows Media Player 10", "Welcome to Windows Media Player 10")Send("!n")WinWaitActive("Windows Media Player 10", "Select your Privacy Options")Send("!n")WinWaitActive("Windows Media Player 10", "Customize the Installation Options")Send("!f")WinWaitActive("Windows Media Player")Sleep(5000)WinKill("Windows Media Player")Run("PStory1.exe")The parts I have bolded are where it is messing up. On some computers, A Security Warning message pops up asking is it ok to trust this program from Microsoft. In the script, it is suppose to send alt+y when that pops up, it doesn't. Same for the one below it, If service pack 2 is intall, it asks is it ok to run Microsoft Windows Media Configuration Utility. The send command part works, its just getting it so that it will register the popup windows.Now the reason I am trying to set it up with If...Then is because only some computers get these messages.Also a side note, if you already installed it, some message boxes don't show up so running the script to test or to take screen shots are hard.Any help would be greatly appreciated. Share this post Link to post Share on other sites
Jos 2,168 Posted May 18, 2006 (edited) You are checking right after the send() for the "extra windows... You need to make sure the time is enough for them to popup. something like this might work: Run("MP10Setup.exe") WinWaitActive("Windows Media Player 10", "Thank you for choosing Windows Media Player 10") Send("!a") WinWaitActive("Windows Media Player 10", "Confirm software download") Send("!a") While 1 If WinActive("Security Warning") then Send("!y") If WinActive("Microsoft Windows Media Configuration Utility") then Send("!r") If WinActive("Windows Media Player 10", "Welcome to Windows Media Player 10") Then ExitLoop Sleep(50) WEnd Send("!n") WinWaitActive("Windows Media Player 10", "Select your Privacy Options") Send("!n") WinWaitActive("Windows Media Player 10", "Customize the Installation Options") Send("!f") WinWaitActive("Windows Media Player") Sleep(5000) WinKill("Windows Media Player") Run("PStory1.exe") Edited May 18, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
GaryFrost 18 Posted May 18, 2006 why not run it silent? RunWait('MP10Setup.EXE /Q:A /R:N /C:"setup_wm.exe /DisallowSystemRestore /Q:A /R:N"') SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Share this post Link to post Share on other sites
Sorian 0 Posted May 18, 2006 (edited) I'll give these a try. If anyone else has any other input, please post it. why not run it silent? RunWait('MP10Setup.EXE /Q:A /R:N /C:"setup_wm.exe /DisallowSystemRestore /Q:A /R:N"') I'm confused (could be because I am still learning this), but doesn't the RunWait command pauses script execution until the program finishes. So that would cause the whole thing not to work right? Edited May 18, 2006 by Sorian Share this post Link to post Share on other sites
SmOke_N 210 Posted May 18, 2006 I'll give these a try. If anyone else has any other input, please post it.I'm confused (could be because I am still learning this), but doesn't the RunWait command pauses script execution until the program finishes. So that would cause the whole thing not to work right?In this case it would cause the script to pause until the installation is finished, it just cuts out the need for all the coding your trying to do. I mean, while your "self made" installation script is running, are you able to do anything else other than looking for windows and or controls? Then this is the same thing but easier. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
Sorian 0 Posted May 19, 2006 (edited) In this case it would cause the script to pause until the installation is finished, it just cuts out the need for all the coding your trying to do. ok, so then the script would change from Run("MP10Setup.exe") WinWaitActive("Windows Media Player 10", "Thank you for choosing Windows Media Player 10") Send("!a") WinWaitActive("Windows Media Player 10", "Confirm software download") Send("!a") While 1 If WinActive("Security Warning") then Send("!y") If WinActive("Microsoft Windows Media Configuration Utility") then Send("!r") If WinActive("Windows Media Player 10", "Welcome to Windows Media Player 10") Then ExitLoop Sleep(50) WEnd Send("!n") WinWaitActive("Windows Media Player 10", "Select your Privacy Options") Send("!n") WinWaitActive("Windows Media Player 10", "Customize the Installation Options") Send("!f") WinWaitActive("Windows Media Player") WinKill("Windows Media Player") Run("PStory1.exe") To Run("MP10Setup.exe") RunWait('MP10Setup.EXE /Q:A /R:N /C:"setup_wm.exe /DisallowSystemRestore /Q:A /R:N"') WinActive("Windows Media Player 10", "Welcome to Windows Media Player 10") Send("!n") WinWaitActive("Windows Media Player 10", "Select your Privacy Options") Send("!n") WinWaitActive("Windows Media Player 10", "Customize the Installation Options") Send("!f") WinWaitActive("Windows Media Player") WinKill("Windows Media Player") Run("PStory1.exe") Right? Edited May 19, 2006 by Sorian Share this post Link to post Share on other sites
GaryFrost 18 Posted May 19, 2006 no it would change from Run("MP10Setup.exe") WinWaitActive("Windows Media Player 10", "Thank you for choosing Windows Media Player 10") Send("!a") WinWaitActive("Windows Media Player 10", "Confirm software download") Send("!a") While 1 If WinActive("Security Warning") then Send("!y") If WinActive("Microsoft Windows Media Configuration Utility") then Send("!r") If WinActive("Windows Media Player 10", "Welcome to Windows Media Player 10") Then ExitLoop Sleep(50) WEnd Send("!n") WinWaitActive("Windows Media Player 10", "Select your Privacy Options") Send("!n") WinWaitActive("Windows Media Player 10", "Customize the Installation Options") Send("!f") WinWaitActive("Windows Media Player") WinKill("Windows Media Player") Run("PStory1.exe") oÝ÷ ÚÚºÚ"µÍ[ØZ] ÌÎNÓTLÙ]VHÔNHÔÐÎ][ÝÜÙ]ÝÛK^HÑØ[ÝÔÞÝ[TÝÜHÔNHÔ][ÝÉÌÎNÊB[ ][ÝÔÝÜLK^I][ÝÊB SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Share this post Link to post Share on other sites
MHz 80 Posted May 19, 2006 Adding some registry entries before installing may help. Been awhile since I installed WMP. Test with these entries RegWrite('HKCU\Software\Microsoft\MediaPlayer\Preferences', 'AcceptedPrivacyStatement', 'Reg_Dword', '0x00000001') RegWrite('HKCU\Software\Microsoft\MediaPlayer\Preferences', 'FirstRun', 'Reg_Dword', '0x00000000') RegWrite('HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer', 'GroupPrivacyAcceptance', 'Reg_Dword', '0x00000001') Share this post Link to post Share on other sites
Sorian 0 Posted May 19, 2006 ok, the silent install will work, thanks. Share this post Link to post Share on other sites
chaz888 0 Posted February 26, 2009 I am interested to know why the silent install for this works better than writing a script for the installation which you can see it happening. Im new to AutoIT and was having exactly the same trouble on this one. I needed an automated install of WMP 10 for a peer to peer network, where i have to locally install everything and need something to speed up my time on installs. Can silent installs be done for most software??? Share this post Link to post Share on other sites
qazwsx 0 Posted February 26, 2009 I believe the silent install is a feature of the WMP installer. It is only ran through autoit, not actually installed by autoit. Share this post Link to post Share on other sites