How does it work
It runs the .gadget file, waits for the security prompt to appear and then clicks the Install button.
To get around the user clicking away, it repeatedly makes the security dialogue the active window until it's been closed.
If the window isn't found after 5 seconds, it will quit.
It's compiled with AutoIt, the complete code is as follows:
AutoItSetOption("TrayIconHide", 1)
If $CmdLine[0]=0 or $CmdLine[1]="/?" Then
MsgBox(0, "AddGadget", "Usage: AddGadget ""<path>\<.gadget file>""" & @CR & " eg: AddGadget ""c:\temp\Clock.gadget""")
Exit
EndIf
Run("rundll32.exe shell32.dll,ShellExec_RunDLL """ & $CmdLine[1] & """")
While WinWait("Install Gadget - Security Warning", "", 5) = 1
WinActivate("Install Gadget - Security Warning")
Send("{LEFT} ")
WEnd
Attached File(s)
-
AddGadget.zip (110.97K)
Number of downloads: 91

Sign In
Register
Help



MultiQuote









