Running installer via App.open() leads to App.focus failed error.

Asked by sdraganov on 2018-11-24

Microsoft Windows [Version 10.0.17134.407]
Sikuli 1.1.4 (201810311629)
java version "1.8.0_171"

I'm trying to run an installer on windows but I got an error - App.focus failed: no window error when using the following command:
App.open("D:\builds\vray_adv_40205_max2019_x64.exe")

(log exerp)----------------------------------------------------------------------------------------------------------------------
[user (11/24/18 10:22:16 AM)] Installing d:\builds\vray_adv_40205_max2019_x64.exe
[debug] App.create: [-1:vray_adv_40205_max2019_x64.exe]
[debug] App.open: [6500:vray_adv_40205_max2019_x64.exe (OleMainThreadWndName)] d:\builds\vray_adv_40205_max2019_x64.exe
[error] App.focus failed: no window for [6500:vray_adv_40205_max2019_x64.exe (OleMainThreadWndName)] d:\builds\vray_adv_40205_max2019_x64.exe
--------------------------------------------------------------------------------------------------------------------------------------

Despite that installer is successfully launched, but script is already terminated.

If I run installer through terminal with following command everything works fine:
#App.open('CMD /C ' + "D:\builds\vray_adv_40205_max2019_x64.exe")

Any idea why this is happening?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
sdraganov
Solved:
2018-11-24
Last query:
2018-11-24
Last reply:
2018-11-24
RaiMan (raimund-hocke) said : #1

Yep, I already realised, that there is still a quirk in the revised App.open implementation.

You might try this:
installer = App("D:\builds\vray_adv_40205_max2019_x64.exe")
installer.open(10) # waits for max 10 secs for the app to get ready

feedback appreciated

nevertheless: your situation is a bug, which I will post and relate here.

sdraganov (sdraganov) said : #2

Thanks for the confirmation and workaround.