Identify installer completion window in any language?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
teknowledgist
Posts: 14
Joined: 22 Nov 2016, 10:20
Contact:

Identify installer completion window in any language?

31 Aug 2018, 11:25

I'm trying to automate an installer to make it (mostly) silent, but I don't always know what language the system will be configured for and the installer supports a large number of languages. The installer is particularly insidious because the control names appear to be somewhat randomly assigned and the positions of some are not consistent from one install attempt to the next (even on the same machine with the same language). I can't identify which page I am on by looking for key text because the language will be unknown. I can't even identify the window because all attempts at finding the window by matching title and/or content containing the software name have failed. (I assume the name of the software must be in unicode/special characters that won't copy out of Windows Spy.) :o All controls for all pages of the install are returned by a winget, ActiveControlList, ControlList, ahk_id %id% run on any page.

Nevertheless, I have managed to work out how to get all the way through the install using AHK to supply {enter} commands for the default install like this:

Code: Select all

WinGet, id, ID, ahk_class TWizardForm
WinActivate, ahk_id %id%

winget, ActiveControlList, ControlList, ahk_id %id%

Loop, Parse, ActiveControlList, `n
{
  ControlGet, CanSee, Visible ,, %A_LoopField%, ahk_class TWizardForm
  ControlGet, CanWork, Enabled ,, %A_LoopField%, ahk_class TWizardForm
  ControlGet, Check, Checked ,, %A_LoopField%, ahk_class TWizardForm
  ControlGetText, RText, %A_LoopField%, ahk_class TWizardForm
  If (CanSee 
      and CanWork
      and (RText <> "")
      and InStr(A_LoopField,"radio",false)
      and !Check)
  {
    ControlClick, %A_LoopField%, ahk_id %id%
    Break
    ;MsgBox, 4,, "%A_LoopField%" is Checked=%Check%. "%RText%" Continue?
    ;IfMsgBox, No
    ;    break
  }
}
sleep, 100
WinActivate, ahk_id %id%
Send, {enter}
sleep, 100
WinActivate, ahk_id %id%
Send, {enter}
sleep, 100
WinActivate, ahk_id %id%
Send, {enter}
sleep, 100
WinActivate, ahk_id %id%
Send, {enter}
This gets me through the installation and only the last screen to close or finish is left. The problem is that is not immediate. It might take some time and it may be in any language and and the button names are not consistent from one run to the next. The processes are the same as the installer, so I can't watch for those. I'm not sure how to tell when the install is complete with AHK.

Does anyone have any suggestions?
YMP2
Posts: 48
Joined: 20 Apr 2014, 06:55

Re: Identify installer completion window in any language?

31 Aug 2018, 13:14

Would it help if you knew the user's language? Then you could probably use DllCall("GetUserDefaultLangID") to find it out.
teknowledgist
Posts: 14
Joined: 22 Nov 2016, 10:20
Contact:

Re: Identify installer completion window in any language?

04 Sep 2018, 07:58

YMP2 wrote:Would it help if you knew the user's language? Then you could probably use DllCall("GetUserDefaultLangID") to find it out.
Thanks for the reply.

I don't think knowing which language would be particularly helpful unless I create a table of all the languages and all the possible words to watch for (that I don't even know how to read). I was hoping someone would have a creative, outside-the-box answer that I haven't thought of.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 183 guests