s4pp3r

Installer child process

7 posts in this topic

#1 ·  Posted (edited)

Hi all,
 
i'm trying to automate an app installer with a checkbox at the end. If i leave it checked, the installed application will start. ( child process )
How can i call a WinClose method on it?
 
I'm using win32com.client w/ Dispatch in python 2.7
Tried WinSearchChildren set to 1, WinActivate, WinGetState, WinExists but it fails.
What is the way to handle the child properly?
I can get the pid, and force to close it by processkill, but its not the same as WinClose :(>
 
Any idea?

from win32com.client import Dispatch
_autoit = Dispatch("AutoItX3.Control")
_autoit.Opt("WinSearchChildren", 1)
_autoit.Run(installer)
_autoit.WinWaitActive("[Class:#32770]", "", 3)
#Language selection
_autoit.ControlCommand("[Class:#32770]", "", "ComboBox1", "SetCurrentSelection", 1)
#Next
_autoit.ControlClick("[Class:#32770]", "", "Button1")
_autoit.WinWaitActive("[Class:#32770]", "", 5)
#Install button
_autoit.ControlClick("[Class:#32770]", "", "Button2")
_autoit.WinWaitActive("[Class:#32770]", "", 5)
#Pull until install finishes
while not _autoit.ControlGetText("[Class:#32770]", "", "Static14"):
    time.sleep(0.25)
_autoit.WinWaitActive("[Class:#32770]", "", 3)
#This checkbox allow to run program after installer finish
#_autoit.ControlCommand("[Class:#32770]", "", "Button4", "UnCheck", "")
_autoit.WinWaitActive("[Class:#32770]", "", 3)
#Close
_autoit.ControlClick("[Class:#32770]", "", "Button2")
#wait till it loads
time.sleep(3)
print _autoit.WinExists("ClassWindow")
print _autoit.WinGetState("ClassWindow")
_autoit.WinSetState("ClassWindow", "", autoit.SW_SHOW)
_autoit.WinActivate("ClassWindow")
_autoit.WinClose("ClassWindow")
Edited by s4pp3r

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

I can't help with your problem but I'm sure you will get as much help as possible when posting your code.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

A little update, all previous try can work if i use Title instead of the class...i can't use it because currently ~17 language is supported, and don't want to using regex match or any hardcoded string in it

update#2:

Looks like Au3Info window control does not work, but WinGetClassList tells me this:

Chrome_WidgetWin_0
Chrome_RenderWidgetHostHWND
CompositorHostWindowClass
 
tried, Chrome_RenderWidgetHostHWND and autoit.WinClose("[CLASS:Chrome_RenderWidgetHostHWND; INSTANCE:1]") but still fails to close it :(
 
okay: acceptable solution
 
because its a special application ( a form with chrome render ) cannot acces window class properly, so i would check for child processes and using winclose with title method
Edited by s4pp3r

Share this post


Link to post
Share on other sites
Chrome_WidgetWin_0
Chrome_RenderWidgetHostHWND
CompositorHostWindowClass

 

 

That looks like a chrome browser control rather than a window form top container, can it really close without its parent closing.


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

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

chromer2.jpg

Yes, but i cannot close it with the window class

Share this post


Link to post
Share on other sites

Does not work...

>>> au.WinClose("[CLASS:Chrome_WidgetWin_0]", "")
1
>>> au.WinClose("[CLASS:Chrome_WidgetWin_1]", "")
1
 
Cannot control a chrome class within a form. So i will use title by language codes and matching it with the form title.

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