Jump to content

Script will not END EVER


dh8593
 Share

Recommended Posts

so here is my script

RunWait("msiexec /i ""Centricity4.0.msi"" /quiet /norestart Transforms=""Centricity4.0.mst"" ")
WinWaitActive("GE Centricity RA1000","Do you wish to proceed?")
   Send("{ENTER}")

It works but it will not ever end, it just sits and waits and waits and waits.

can anyone please point me in the correct direction.

this is driving me nuts

 

Link to comment
Share on other sites

1) Do a run command, and do a loop to wait for the PID to no longer be present...initiate a timer, and if the process doesn't complete in a certain amout of time, then kill the process.

2) does this window appear because of the RunWait command?  If so, switching to Run will allow you to grab the window...RunWait will wait for the process to end, which can be infinite if it requires user action.

3) there is an optional param on your winwait function for a timeout...add that param in.

More info needed, but try something like this (generally, OK is id=1..you would need to update it if that's not the case...use the AutoIT window info tool, and put target over the OK or YES button)

$iMaxMSITime = 5*60*1000 ; 5 min max wait
$iMaxWinWait = 1*60*1000 ; 1 min max wait
$bFoundWindow = False
$iTimer = TimerInit()
$iPID = Run('msiexec /i "\Centricity4.0.msi" /quiet /norestart Transforms="Centricity4.0.mst"')
While ProcessExists($iPID) And TimerDiff($iTimer)<$iMaxMSITime
    If Not $bFoundWindow And WinExists("GE Centricity RA1000","Do you wish to proceed?") Then
        WinActivate("GE Centricity RA1000","Do you wish to proceed?")
        If WinWaitActive("GE Centricity RA1000","Do you wish to proceed?",$iMaxWinWait) Then
            $bFoundWindow = True
            ControlFocus("GE Centricity RA1000","Do you wish to proceed?",1)
            ControlClick("GE Centricity RA1000","Do you wish to proceed?",1)
        Else
            MsgBox(1,1,"window exists, but is not active")
            ExitLoop
        EndIf
    EndIf
    If $bFoundWindow Then ExitLoop 
WEnd

If $bFoundWindow Then
    MsgBox(1,1,"success")
Else
    MsgBox(1,1,"failure")
EndIf
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

More Detail - when you run the centricity app normal with no switching it askes if you want to BLAH BLAH BLAH and you just press enter and the rest is automatic. hence the (Send (enter)) in the script. The MST handles all the other compnents . it does install and it does work but it just will not end

Link to comment
Share on other sites

ok so as you can tell im new to scripting, but im looking at this and im not sure that this will work. i dont see where i send the Enter command. i see how it will call the MSI but it is waiting for the Enter Key to keep going.

Link to comment
Share on other sites

ok so as you can tell im new to scripting, but im looking at this and im not sure that this will work. i dont see where i send the Enter command. i see how it will call the MSI but it is waiting for the Enter Key to keep going.

That is probably because RunWait has not finished, and it will not finish until you interact with the gui, which you cannot, using the same script.

Use Run instead and add some debugging msgboxes or similar to your script so you can see exactly where it's stuck.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I made the changes to the script that i needed to and i got it to work. instead of waiting for a responce or looking for an action i just forced it to exit and that works perfectly. It may not be the cleanest way to do it but it works.  Thank you for all your help

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...