Sorian Posted May 18, 2006 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.
Developers Jos Posted May 18, 2006 Developers 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.
GaryFrost Posted May 18, 2006 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.
Sorian Posted May 18, 2006 Author 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
Moderators SmOke_N Posted May 18, 2006 Moderators 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.
Sorian Posted May 19, 2006 Author 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
GaryFrost Posted May 19, 2006 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.
MHz Posted May 19, 2006 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')
chaz888 Posted February 26, 2009 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???
qazwsx Posted February 26, 2009 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.
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