Jump to content

How to deal with multiple possible windows in installer script - (Moved)


Recommended Posts

I am trying to make a simple installer script for my understanding.  I would just like to understand how to deal with multiple possible windows. In the case of installing VLC, I might get a window saying VLC is already installed. I have also tried a switch with no luck.  I would just like to understand some methods for dealing with the possible existence of unexpected windows. 

 

;INSTALL VLC VIEWER
Run(@ScriptDir & '\bin\VLCViewer_2.2.4_3.EXE')
AutoItSetOption('MouseCoordMode', 0)

sleep(4000)
WinWait("VLC Viewer 2.2.4")


     ; this window will pop up if vlc is already installed
    If WinExists( "VLC Viewer 2.2.4", "VLC 2.2.4 Already Installed") Then
          ConsoleWrite ("already installed")
          WinActivate ('VLC Viewer 2.2.4','Already Installed')
          MouseClick ('primary', 93, 83, 1, 0)
          
    EndIf

 

      ; this window will pop up if installer finishes sucessfully

     If WinExists( "VLC Viewer 2.2.4", "VLC Viewer 2.2.4 Installed") Then 
          ConsoleWrite ("already installed")
          WinActivate ('VLC Viewer 2.2.4','VlC Installed')
          MouseClick ('primary', 93, 83, 1, 0)
   EndIf


 

 

 

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support forums.

Moderation Team

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

A good way to see if you catch a windows is before do winwait etc.... (that can cause your script while in the wind) Is to move windows. 

 

SO I whould just try to catch the windows with handle or class then try to move it to be sure i got the correct windows. 

When i know i am safe I start coding.

 

Check this :

WinGetClassList
WinGetHandle

 

A good thing would be to change this : 

sleep(4000)
WinWait("VLC Viewer 2.2.4")

By somthing like this : 

WinWait("VLC Viewer 2.2.4","", 4000)

Or if you need to sleep 4 sec before wait and then wait 4 more seconde, or more... : 

WinWait("VLC Viewer 2.2.4","",8000)

 

Look : 2 windows 1 title 1 class 2 handle : 

In this case I whould use the handle.

image.thumb.png.723e84b8eecc105931d894231615d013.png

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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

×
×
  • Create New...