ผมไม่ใช่ท่าน hypnox ขอตอบแทนนะครับ
ของผมใช้คำสั่ง ไม่ได้ใช้เม้าส์คลิ้ก
$TITLE = "Internet Download Manager"
;; ***************************************************************************
;; only code after here
$AllUsersProfile = Envget ("AllUsersProfile")
$Wid = (StringLen ($TITLE) * 5) + 140 ; the width of the window containing screen messages
$Hig = 26 ; the height of the window containing screen messages
$Wai = 111 ; wait time
$VTO = 300 ; very long time out for winwaits
$BTO = 30 ; long time out for winwaits
$LTO = 10 ; short time out for winwaits
;; uncomment this section if the application cannot be easily uninstalled. This allows the user to opt out in case of an accidental launch of the installer.
; $V1 = MsgBox (1,"Install " & $TITLE & "?", "To cancel silent setup of " & $TITLE & ", click CANCEL within 4 seconds...", 4)
; IF $V1 = 2 Then
; Exit
; EndIf
SplashTextOn("Installing", "Now installing " & $TITLE & "...", $Wid + 50, 22, -1, -1, 50, "Arial", 10)
TrayTip ("Installing", $TITLE, 180, 1)
Sleep (1500)
SplashOff ()
ProcessClose("IDMan.exe")
ProcessClose("IDMan.exe")
ProcessClose("IM IDMan.exe")
ProcessClose("IM idmftype.dll")
ProcessClose("IM IDMIECC.dll")
ProcessClose("IM idmmkb.dll")
ProcessClose("IM IEMonitor.exe")
ProcessClose("IM IDMIECC.dll")
ProcessClose("IM IDMShellExt.dll")
ShellExecute ("IDMan.exe")
; ShellExecuteWait ("IDMan.exe, "/SILENT /SUPPRESSMSGBOXES /NORESTART /NOCANCEL /SP-")
; ShellExecuteWait ("IDMan.exe", "/S")
; ShellExecuteWait ("IDMan.msi", "/passive /norestart")
; ShellExecuteWait ("IDMan.msi", "/quiet /norestart")
; ShellExecuteWait ("IDMan.exe", "/s /v/qn")
; ShellExecuteWait ("regedit.exe", "/S reg.reg", @ScriptDir)
$Txt1 = "Internet Download Manager Installation Wizard"
$Txt2 = ""
$But = "Button2"
$V1 = WinWait ($Txt1, $Txt2, $BTO)
If $V1 = 0 Then
SplashTextOn("There was an error", "Sorry, but there was an unexpected error, exiting...", $Wid + 50, $Hig, -1, -1, 50, "Arial", 10)
Sleep (1400)
SplashOff ()
Exit
EndIf
WinActivate ($Txt1, $Txt2)
Sleep ($Wai)
ControlClick ($Txt1, $Txt2,$But)
$Txt1 = "Please read IDM license"
$Txt2 = ""
$But = "Button2"
WinWait ($Txt1,$Txt2, $LTO)
WinActivate ($Txt1, $Txt2)
Sleep ($Wai)
ControlClick ($Txt1, $Txt2, $But)
$Txt1 = "Choose Destination Location"
$Txt2 = ""
$But = "Button2"
WinWait ($Txt1,$Txt2, $LTO)
WinActivate ($Txt1, $Txt2)
Sleep ($Wai)
ControlClick ($Txt1, $Txt2, $But)
$Txt1 = "Select Program Manager Group"
$Txt2 = ""
$But = "Button2"
WinWait ($Txt1,$Txt2, $LTO)
WinActivate ($Txt1, $Txt2)
Sleep ($Wai)
ControlClick ($Txt1, $Txt2, $But)
$Txt1 = "Start Installation of Internet Download Manager"
$Txt2 = ""
$But = "Button2"
WinWait ($Txt1,$Txt2, $LTO)
WinActivate ($Txt1, $Txt2)
Sleep ($Wai)
ControlClick ($Txt1, $Txt2, $But)
; files are installed
$Txt1 = "Installation Complete"
$Txt2 = ""
$But = "Button4"
WinWait ($Txt1,$Txt2, $VTO)
WinActivate ($Txt1, $Txt2)
Sleep ($Wai)
ControlClick ($Txt1, $Txt2, $But)
Sleep (10)
ProcessClose("IDM1.tmp")
$PID = ProcessExists("IDM1.tmp") ; Will return the PID or 0 if the process isn't found.
If $PID Then ProcessClose($PID)
#endregion --- ScriptWriter generated code End ---
ส่วนคำสั่งนี้คือ ใช้เม้าส์คลิ้กครับ
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
ProcessClose("IDMan.exe")
$PID = ProcessExists("IDMan.exe") ; Will return the PID or 0 if the process isn't found.
If $PID Then ProcessClose($PID)
ProcessClose("IDMan.exe")
ProcessClose("IDMan.exe")
ProcessClose("IM IDMan.exe")
ProcessClose("IM idmftype.dll")
ProcessClose("IM IDMIECC.dll")
ProcessClose("IM idmmkb.dll")
ProcessClose("IM IEMonitor.exe")
ProcessClose("IM IDMIECC.dll")
ProcessClose("IM IDMShellExt.dll")
Run('IDMan.exe')
WinWait("Internet Download Manager Installation Wizard","Welcome to Internet ")
If Not WinActive("Internet Download Manager Installation Wizard","Welcome to Internet ") Then WinActivate("Internet Download Manager Installation Wizard","Welcome to Internet ")
WinWaitActive("Internet Download Manager Installation Wizard","Welcome to Internet ")
MouseMove(327,339)
MouseDown("left")
MouseUp("left")
WinWait("Please read IDM license","< Back")
If Not WinActive("Please read IDM license","< Back") Then WinActivate("Please read IDM license","< Back")
MouseClick("left",327,339,2)
WinWait("Select Program Manager Group","Enter the name of th")
If Not WinActive("Select Program Manager Group","Enter the name of th") Then WinActivate("Select Program Manager Group","Enter the name of th")
WinWaitActive("Select Program Manager Group","Enter the name of th")
MouseDown("left")
MouseUp("left")
WinWait("Start Installation of Internet Download Manager","You are now ready to")
If Not WinActive("Start Installation of Internet Download Manager","You are now ready to") Then WinActivate("Start Installation of Internet Download Manager","You are now ready to")
WinWaitActive("Start Installation of Internet Download Manager","You are now ready to")
MouseMove(335,340)
MouseDown("left")
MouseUp("left")
WinWait("Installing","Copying file:")
If Not WinActive("Installing","Copying file:") Then WinActivate("Installing","Copying file:")
WinWaitActive("Installing","Copying file:")
MouseDown("left")
MouseUp("left")
WinWait("Installation Complete","Internet Download Ma")
If Not WinActive("Installation Complete","Internet Download Ma") Then WinActivate("Installation Complete","Internet Download Ma")
WinWaitActive("Installation Complete","Internet Download Ma")
MouseDown("left")
MouseUp("left")
ProcessClose("IDM1.tmp")
$PID = ProcessExists("IDM1.tmp") ; Will return the PID or 0 if the process isn't found.
If $PID Then ProcessClose($PID)
#endregion --- ScriptWriter generated code End ---