Reputation: 13
i am using AutoItX4Java and trying to click the Next button on installer. The return of the method "controlClick" is True but even then i can see that the click doesn't happen on the installer window. Below is the code used for vlc installer[as example] where it asks to select language , default provide is English.
File file = new File("lib", "jacob-1.18-M2-x64.dll");
System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());
AutoItX x = new AutoItX();
x.run("vlc-2.1.3-win32.exe");
x.winActivate("[TITLE:Installer Language;]");
x.winWaitActive("[TITLE:Installer Language;]");
x.controlClick("[TITLE:Installer Language;]", "", "[CLASS:Button;INSTANCE:1;Text:OK;]")
Upvotes: 1
Views: 432
Reputation: 121
For my case I have just closed my eclipse session and relaunched it by saying run as administrator. This will elevate your session. It worked for me.
You can check if you have admin rights for eclipse session by using command isAdmin(); returns true if you have rights.
Upvotes: 1
Reputation: 2946
When manipulating external application windows, always use #RequireAdmin in order to get the permission elevation. Also use Opt("WinSearchChildren", 1) in order to search child windows too. Play with "WinTitleMatchMode".
#RequireAdmin ;Will give your script a permission elevation (sometimes its needed)
Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Opt("WinSearchChildren", 1) ;0=no, 1=search children also
Upvotes: 1