Sign in to follow this  
Followers 0
Sorian

Windows Media Player 10 Install

11 posts in this topic

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



#2 ·  Posted (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 by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

#4 ·  Posted (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 by Sorian

Share this post


Link to post
Share on other sites

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Sorian

Share this post


Link to post
Share on other sites

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

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

ok, the silent install will work, thanks.

Share this post


Link to post
Share on other sites

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

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

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
Sign in to follow this  
Followers 0