無人值守全自動靜默安裝Delphi7到Windows11的AutoHotkey指令碼2022年1月9日
阿新 • • 發佈:2022-01-10
無人值守全自動靜默安裝Delphi7到Windows11的AutoHotkey指令碼2022年1月9日
第1步:下載Delphi7安裝包
檔名稱: D:\Personal\Desktop\Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.exe
檔案大小: 74.2 MB (77,900,595 位元組)
檔案版本: 7.3.4.3
修改時間: 2011年08月01日,08:36:20
MD5: 251DD0193CCA8906E2335087BE2FE1D0
SHA1: 7222D058F38FB086227C0D1056221165F69F3174
SHA256: E413ECD2615E24FB3A3A60555A6AFDACCB812C70C3B693E709859928ECC878DA
SHA512: 17DA0668570D9E62A88F60ABBCF79CC2531036C94EACE99A3F2EF0BA156182EA175233CB05B23EC747322E2D3F6B7385AB3FBC46AD5486FB7AABACDA3C7EE12E
CRC32: 67402278
第2步:製作並測試“全自動靜默安裝Delphi7的AutoHotkey指令碼”
; 無人值守全自動靜默安裝Delphi7到Windows11的AutoHotkey指令碼2022年1月9日
; FileName := A_Setup_Delphi7.ahk
#SingleInstance,Ignore
loop,5
{
DetectHiddenWindows,On
Sleep,5
IfWinExist,[email protected]
ExitApp
}
Gui, Show, Hide,[email protected]
#Persistent
; #NoTrayIcon
DetectHiddenWindows,On
SetTitleMatchMode,2
; 啟動7z安裝程式
SetTimer,SetupTimer,500
return
SetupTimer()
{
; 1、如果程式沒有執行則執行程式
Process,Exist,Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.exe
if (%ErrorLevel%=0)
{
IfExist,%A_ScriptDir%\Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.exe
{
Run,%A_ScriptDir%\Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.exe
}
else
{
MsgBox,找不到檔案 %A_ScriptDir%\Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.exe
return
}
}
IfWinNotExist,安裝嚮導 - Delphi 7 Lite Full Edition,正在你的計算機中安裝 Delphi 7 Lite Full Edition,請稍等...
{
ControlSend, TNewButton1,{Space}, 選擇安裝語言 ahk_class TSelectLanguageForm ahk_exe Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.tmp, 取消
ControlSend, Button1,{Space}, 安裝嚮導 ahk_class #32770 ahk_exe Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.tmp, 本程式為Window
ControlSend, TNewButton1,!n, 安裝嚮導 - Delphi 7 Lite Full Edition ahk_class TWizardForm ahk_exe Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.tmp, 取消
ControlSend, TNewButton1,!i, 安裝嚮導 - Delphi 7 Lite Full Edition ahk_class TWizardForm ahk_exe Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.tmp, 取消
}
IfWinExist,安裝嚮導 - Delphi 7 Lite Full Edition ahk_class TWizardForm,安裝嚮導已完成 Delphi 7 Lite Full Edition 的安裝
{
SetTimer,SetupTimer,Delete
ControlClick, TNewButton5, 安裝嚮導 - Delphi 7 Lite Full Edition ahk_class TWizardForm ahk_exe Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801.tmp,安裝嚮導已完成 Delphi 7 Lite Full Edition 的安裝
MsgBox,,,已成功安裝Delphi7Lite程式設計軟體,2
ExitApp
}
}