Jump to content

Issue with Run command (I think)


Lunatic
 Share

Recommended Posts

Here's my issue. I'm creating a script to install multiple programs, one after another. The example I'll use is Adobe Reader 9 and Adobe Flash Player. The script will install either program absolutely flawlessly, for the intent I have in mind. The problem is, once it finishes running Adobe Reader's install (as shown below), I can not get it to start the install for Flash Player. I've spent half an hour trying different things to get it to work (which I admit are lame attempts, mostly involving delays and the like, but I'm tired and honestly I'm not incredible at programing, whatsoever.) Is there a way around this issue, or am I going to have to make a script for each program? :)

;==========Install Adobe Reader 9==========
Run ( "AdobeReader90.exe" , "" )
WinWaitActive ( "Adobe Reader 9 - Setup" , "Destination Folder" );Wait for pre-install.
ControlClick ( "Adobe Reader 9 - Setup" , "Destination Folder" , "Button1" , "Left" , "1" ,  ,  );Click Next
WinWaitActive ( "Adobe Reader 9 - Setup" , "Ready to Install" );Wait for Install Prompt
ControlClick ( "Adobe Reader 9 - Setup" , "Ready to Install" , "Button1" , "Left" , "1" ,  ,  );Click Install
WinWaitActive ( "Adobe Reader 9 - Setup" , "Setup has successfully" );Wait for Install Completed
ControlClick ( "Adobe Reader 9 - Setup" , "Setup has successfully" , "Button1" , "Left" , "1" ,  ,  );Click Finish
Sleep (30000)

;==========Install Adobe Flash Player==========
Run ( "install_flash_player.exe" , "" )
WinWaitActive ( "Adobe Flash Player Plugin Setup: Completed" , "Completed" );Wait for Installation
ControlClick ( "Adobe Flash Player Plugin Setup: Completed" , "Completed" , "Button2" , "Left" , "1" ,  ,  );Click Close
Sleep (30000)

[center][/center]

Link to comment
Share on other sites

First check: is install_flash_player.exe at the same location as your previous exe?

Replace your Run statement with this:

If FileExists("install_flash_player.exe") Then
    Run ( "install_flash_player.exe" , "" )
Else
    MsgBox(16, "Error:", "install_flash_player.exe was not found")
EndIf

It has the same effect but it will tell you if the file is not found.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Sorry for the delay in responding. I entered the code in my script, with the same results. It runs Adobe Reader flawlessly, then locks up. No launch of the flash installer, no error message. after 10 minutes I closed the script. I'll post the modification I made below, in case I screwed it up.

;==========Install Adobe Reader 9==========
Run ( "AdobeReader90.exe" , "" )
WinWaitActive ( "Adobe Reader 9 - Setup" , "Destination Folder" );Wait for pre-install.
ControlClick ( "Adobe Reader 9 - Setup" , "Destination Folder" , "Button1" , "Left" , "1" , "" , "" );Click Next
WinWaitActive ( "Adobe Reader 9 - Setup" , "Ready to Install" );Wait for Install Prompt
ControlClick ( "Adobe Reader 9 - Setup" , "Ready to Install" , "Button1" , "Left" , "1" , "" , "" );Click Install
WinWaitActive ( "Adobe Reader 9 - Setup" , "Setup has successfully" );Wait for Install Completed
ControlClick ( "Adobe Reader 9 - Setup" , "Setup has successfully" , "Button1" , "Left" , "1" , "" , "" );Click Finish
Sleep (30000)

;==========Install Adobe Flash Player==========
If FileExists("install_flash_player.exe") Then
    Run ( "install_flash_player.exe" , "" )
Else
    MsgBox(16, "Error:", "install_flash_player.exe was not found")
EndIf
WinWaitActive ( "Adobe Flash Player Plugin Setup: Completed" , "Completed" );Wait for Installation
ControlClick ( "Adobe Flash Player Plugin Setup: Completed" , "Completed" , "Button2" , "Left" , "1" , "" , "" );Click Close

[center][/center]

Link to comment
Share on other sites

Here might be an alternative way to do what you are trying to do. It is set to take manual prompts after each install is executed but I made a few comments on how better to automate it. Since your concern is the execution of the next install I left it as is. It is partially tested in that I ran it once and got the results I expected but not all the scenarios that I made arguments have been presented to the script. Hope this helps in some way.

Edit... I walked away and tested it again. While I though that MsgBox without the optional time out would cause the script to pause, it doesn't seem to and I don't see where a default is specified. You might want to add an extremely long time out and see if that helps at each prompt for install. Nor does RunWait seem to halt the script after the script has decided to continue. Maybe you should just wait for more experienced folks who have an idea of what is happening to post. Sorry for the false hope.

V/r

Casey

Chained_Install_Example_v_0.0.1.au3

Edited by Casey
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...