ETVator
ETVator

Reputation: 43

Why isnt AutoIt performing a click?

My Code in AutoIt doesn't click, it opens up the file, but doesn't do anything. Any ideas?

Could it be because there's another Window in between asking for my Administrator Password?

Run("Setup.exe")
WinWait("Mozilla Firefox-Installation", "Willkommen beim ")
WinActivate("Mozilla Firefox-Installation", "Willkommen beim ")
ControlClick("Mozilla Firefox-Installation", "Willkommen beim ", "Abbrechen", "left")

Upvotes: 0

Views: 309

Answers (1)

michael_heath
michael_heath

Reputation: 5372

#pragma compile(ExecLevel, requireAdministrator)
#RequireAdmin

Run("Setup.exe")
WinWait("Mozilla Firefox-Installation", "Willkommen beim ")
WinActivate("Mozilla Firefox-Installation", "Willkommen beim ")
ControlClick("Mozilla Firefox-Installation", "Willkommen beim ", "Abbrechen")

The #pragma compile directive to set ExecLevel to requireAdministrator allows the AutoIt script compiled to executable, in the manifest, to run as Administrator.

The #RequireAdmin directive allows the executed au3 file to run as Administrator.

The ControlClick may not be allowed happen if the AutoIt process is running as not an Administrator and the process to be automated is running as Administrator.

The optional parameter of left can be omitted form the ControlClick function call as it is already the default.

Note that Firefox supports a -ms silent install argument so GUI automation can be avoided.

Upvotes: 1

Related Questions