Jump to content

Multiple Windows at same time


notta
 Share

Recommended Posts

Setting up an automated installer. How do you handle this situation?

After the installer completes the installer launches 3 windows in random order.

1. Updater Window that launches a browser window to show updates available for the product.

2. The browser window

3. A config window that allows you to set settings for the application

I only want to work with the config window. I used ProcessClose ("Iexplore.exe") but the times are completely random on what window pops first, second, or third. How do I get it so I can close the other 2 windows and than let the script complete when I have the config window on the screen alone? I'm all over place, but I will try to clarify if you don't understand what I'm saying. Thanks.

here is what I have:

;$var = EnvGet("temp")
run ("setup.exe")
;run ("setup.exe", $var)
WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "The InstallShield(R)")
Send ("!n")

WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "License Agreement")
Send ("{UP}")
Send ("!n")

WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Customer Information")
Send ("!n")

WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Destination Folder")
Send ("!n")

WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Setup Type")
Send ("{DOWN}")
Send ("{ENTER}")

WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Custom Setup")
; Skip Lotus Notes
Send ("{DOWN}")

; Disable Lotus Organizer
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{ENTER}")

Send ("{DOWN}")

; Disable Microsoft Outlook
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{ENTER}")
Sleep (1000)

Send ("{DOWN}") 

; Disable Microsoft Outlook Express
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{ENTER}")
Sleep (1000)

Send ("{DOWN}")

; Disable Microsoft Windows Mobile
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{ENTER}")
Sleep (1000)

Send ("{DOWN}")

; Disable Novell GroupWise
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{ENTER}")
Sleep (1000)

Send ("{DOWN}")
Send ("{DOWN}")

; Disable Sage ACT!
Send ("{SPACE}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{DOWN}")
Send ("{ENTER}")
Sleep (1000)

Send ("!n")

WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Ready to Install the Program")
Send ("!i")

WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Click Finish to exit")
Send ("!f")

WinWaitActive ("InstallShield Wizard", "Select from the following options.")
Send ("!n")

WinWaitActive ("InstallShield Wizard") 
Sleep(1000)
Send ("999999")
Send ("99999")
Send ("999999")
Send ("999999")
Send ("!n")

WinWaitActive ("InstallShield Wizard", "Thank you.")
Send ("{ENTER}")

;***************************** perfection up to this point   *****************************

;***************************** this is where the mess starts *****************************

sleep(30000)
Opt ("WinTitleMatchMode", 2); have this for changing value in window title
sleep(30000);cheating
ProcessClose ("Iexplore.exe");trying to close the browser window, but what if the have Firefox :)
sleep(1000);no idea again
WinSetOnTop("Intellisync", "", 1);thought I could put the window on top, but doesn't seem to work

WinWaitActive ("Intellisync")
Send ("{TAB}")
Send ("{TAB}")
Send ("{TAB}")
Send ("{ENTER}")

Opt ("WinTitleMatchMode", 2)
WinWaitClose("Intellisync", 20)

;*********************************************************

;launch patch after config window closes. Sometimes launches before config window even closes :(

sleep(10000)
RUN ("175.exe")
sleep(10000)
WinWaitActive ("Intellisync Handheld Edition Patch - InstallShield Wizard", "Welcome to the Patch")
Send ("{ENTER}")

WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "InstallShield Wizard Completed")
Send ("!f")

WinWaitActive ("Intellisync Handheld Edition Installer Information", "You must restart")
Send ("!y")
Edited by notta
Link to comment
Share on other sites

Try using these three functions:

WinWait;

WinGetHandle;

ControlClick;

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

Here is an attempt

CODE

;$var = EnvGet("temp")
$pid = run ("setup.exe")
;run ("setup.exe", $var)
_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "The InstallShield(R)")
Send ("!n")

_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "License Agreement")
Send ("{UP}!n")

_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Customer Information")
Send ("!n")

_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Destination Folder")
Send ("!n")

_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Setup Type")
Send ("{DOWN}{ENTER}")

_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Custom Setup")
; Skip Lotus Notes
Send ("{DOWN}")

; Disable Lotus Organizer
Send ("{SPACE}{DOWN 3}{ENTER}{DOWN}")

; Disable Microsoft Outlook
Send ("{SPACE}{DOWN 3}{ENTER}")
Sleep (1000)

Send ("{DOWN}")

; Disable Microsoft Outlook Express
Send ("{SPACE}")
Send ("{DOWN 3}{ENTER}")
Sleep (1000)

Send ("{DOWN}")

; Disable Microsoft Windows Mobile
Send ("{SPACE}{DOWN 3}{ENTER}")
Sleep (1000)

Send ("{DOWN}")

; Disable Novell GroupWise
Send ("{SPACE}{DOWN 3}{ENTER}")
Sleep (1000)

Send ("{DOWN 2}")

; Disable Sage ACT!
Send ("{SPACE}{DOWN 3}{ENTER}")
Sleep (1000)

Send ("!n")

_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Ready to Install the Program")
Send ("!i")

_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "Click Finish to exit")
Send ("!f")

_WinWaitActive ("InstallShield Wizard", "Select from the following options.")
Send ("!n")

_WinWaitActive ("InstallShield Wizard")
Sleep(1000)
Send ("999999")
Send ("99999")
Send ("999999")
Send ("999999")
Send ("!n")

_WinWaitActive ("InstallShield Wizard", "Thank you.")
Send ("{ENTER}")

;***************************** perfection up to this point     *****************************

;***************************** this is where the mess starts *****************************

;~ sleep(30000)
Opt ("WinTitleMatchMode", 2); have this for changing value in window title
;~ sleep(30000);cheating
Do
    Sleep(1000)
Until ProcessExists('Iexplore.exe') Or ProcessExists('Firefox.exe')
ProcessClose('Firefox.exe')
ProcessClose ("Iexplore.exe");trying to close the browser window, but what if the have Firefox :)
;~ sleep(1000);no idea again
;~ WinSetOnTop("Intellisync", "", 1);thought I could put the window on top, but doesn't seem to work

_WinWaitActive ("Intellisync")
Send ("{TAB 3}{ENTER}")
WinWaitClose("Intellisync", 20)

ProcessWaitClose($pid)

Opt ("WinTitleMatchMode", 1)

;*********************************************************

;launch patch after config window closes. Sometimes launches before config window even closes :(

sleep(10000)
RUN ("175.exe")
sleep(10000)
_WinWaitActive ("Intellisync Handheld Edition Patch - InstallShield Wizard", "Welcome to the Patch")
Send ("{ENTER}")

_WinWaitActive ("Intellisync Handheld Edition - InstallShield Wizard", "InstallShield Wizard Completed")
Send ("!f")

_WinWaitActive ("Intellisync Handheld Edition Installer Information", "You must restart")
Send ("!y")

Exit

Func _WinWaitActive($title, $text = "")
    WinWait($title, $text)
    WinActivate($title, $text)
    WinWaitActive($title, $text)
EndFunc

The installShield installer may allow recording of the install and to silent install to make it easier.

Some directions for recording and to silent install below.

Make a recording of the installer with:

Setup.exe /r /sms /f1"c:\setup.iss"

The setup.iss is saved to the root of c:\ drive, as to above command.

Move the setup.iss to setup.exe directory.

The installation files can be packed into an archive, or kept within it's own directory, unpacked.

To silently install, use:

Setup.exe /s /sms /f2"c:\ProgramName.log"

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