by sak20102005 07/04/11, 04:44 am
การทำ AutoInstall มีอยู่หลากหลายวิธี ต้องเจาะจงว่าจะเลือกแบบไหน? อย่างไร? เช่น
ติดตั้งพร้อมลงทะเบียนให้อัตโนมัติ เป็นต้น ลองดูคำสั่งนี้ ท่านที่ไม่คุ้น เห็นแล้วอาจงง
แต่ถ้าสงสัยกับคำสั่งตรงไหน ผมอนุญาตให้ถามได้ ท่านจะได้เกิดความเข้าใจ
Download: AutoPlay Menu Builder 6.0 Auto Installer&Register Click here
- Code:
#NoTrayIcon
#include <Process.au3>
Opt("MustDeclareVars", 1)
Global $target = @ProgramFilesDir&'\AutoPlay Menu Builder'
Global $filepath = @ProgramFilesDir&'\AutoPlay Menu Builder\APMBuilder.exe'
Global $sourcefolder = @ScriptDir&'\AutoPlay Menu Builder 6.0'
Global $propath = @ProgramFilesDir&'\AutoPlay Menu Builder\APMB.6.LOM.exe'
Global $active_title = '- AutoPlay Menu Builder v6.0 Build 1855 Patch + Keygen by Kindly -'
Global $keyname = 'HKEY_CURRENT_USER\Software\AutoPlay Menu Builder\Registration'
Global $valuename1 = 'DontShowNAG', $valuename2 = 'Name', $valuename3 = 'Code', $var
Global $type = 'REG_SZ', $value1 = 1, $value2 = 'Administrator', $pid, $i = 0, $btn
$btn = MsgBox(36, "AutoPlay Menu Builder 6.0", "Do you wanted to install?", 60)
If $btn = 7 Then Exit
$pid = Run($sourcefolder&'\'&'apmsetup.exe /S /NCRC')
ProgressOn("Setup in progress", "", "0%", 350, 320, 16)
While ProcessExists($pid)
$i += 1
ProgressSet($i, $i&'%', "Installing..please wait!")
Sleep($i)
If $i >=100 Then
ProgressSet(100, 100&'%', "Installing..please wait!")
ExitLoop
ElseIf Not ProcessExists($pid) Then
ExitLoop
EndIf
WEnd
ProgressSet(100, 100&'%', "Installing..please wait!")
Sleep(500)
ProgressOff()
If FileCopy($sourcefolder&'\'&'APMB.6.LOM.exe', $target, 1) = 0 Then Exit
Run ($propath, "", @SW_HIDE)
If @error Then Exit
If WinWait("[CLASS:TSetupForm]", "", 2)Then
WinSetState("[CLASS:TSetupForm]", "", @SW_HIDE)
EndIf
If WinWaitNotActive($active_title, "", 2)Then
Send("3+{TAB}")
If WinWaitNotActive($active_title, "", 2)Then
Send("{ENTER}")
If WinWaitNotActive($active_title, "", 2)Then
Send("{ENTER}")
If WinWaitNotActive($active_title, "", 2)Then
Send("4+{TAB}")
EndIf
EndIf
EndIf
EndIf
$var = ControlGetText("[CLASS:TSetupForm]", "", "TMemo1")
If Not @error Then
RegWrite($keyname, $valuename1, $type, $value1)
RegWrite($keyname, $valuename2, $type, $value2)
RegWrite($keyname, $valuename3, $type, $var)
If Not @error Then
WinClose("[CLASS:TSetupForm]")
If FileCreateShortcut($filepath, @DesktopDir&'\APMBuilder.lnk')Then
MsgBox(64, "", "Installation complete.", 2)
Exit
EndIf
EndIf
EndIf