|
自动安装:
#NoTrayIcon
#RequireAdmin
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\..\软件\Software\WGho\ico.ico
#AutoIt3Wrapper_Res_Comment=Windows 一键还原自动安装
#AutoIt3Wrapper_Res_Description=WGho_Setup自动安装
#AutoIt3Wrapper_Res_Fileversion=1.2.9.15
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
; Windows 一键还原安装程序会篡改IE首页、默认页,预先读取
$reg1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN", "Start Page")
$reg2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN", "Default_Page_URL")
$reg3 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page")
;自定义文件名
Dim $wjm = IniRead("WGho_Setup.ini", "自定义文件名", "WGho_Setup", "WGho_Setup.exe")
If $wjm = "" Then
Exit
EndIf
;安装
Run($wjm)
WinWait("Windows 一键还原 v1.2 安装程序", "")
WinActivate("Windows 一键还原 v1.2 安装程序", "")
ControlClick("Windows 一键还原 v1.2 安装程序", "", "Button3")
WinWait("Windows 一键还原 安装程序","许可协议")
WinActivate("Windows 一键还原 安装程序","许可协议")
ControlClick("Windows 一键还原 安装程序","许可协议", "Button1")
WinWait("Windows 一键还原 安装程序", "< 返回(&B)")
WinActivate("Windows 一键还原 安装程序", "< 返回(&B)")
ControlClick("Windows 一键还原 安装程序", "< 返回(&B)", "Button1")
WinWait("Windows 一键还原 安装程序", "完成(&F)")
WinActivate("Windows 一键还原 安装程序", "完成(&F)")
ControlClick("Windows 一键还原 安装程序", "完成(&F)", "Button1")
;恢复IE首页、默认页
RegWrite ('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN',"Default_Page_URL","REG_SZ",$reg2)
RegWrite ('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN',"Start Page","REG_SZ",$reg1)
RegWrite ('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main',"Start Page","REG_SZ",$reg3)
;清理
FileDelete(@DesktopDir & "\Windows 一键还原.lnk")
FileDelete(@StartMenuDir & "\程序\Windows 一键还原\访问论坛.*")
;FileDelete(@StartMenuDir & "\程序\Windows 一键还原\信息反馈.lnk")
;FileDelete(@StartMenuDir & "\程序\Windows 一键还原\卸载 Windows 一键还原.*")
Exit
手动安装:
#NoTrayIcon
#RequireAdmin
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\..\软件\Software\WGho\ico.ico
#AutoIt3Wrapper_Res_Comment=Windows 一键还原手动安装(禁止篡改IE)
#AutoIt3Wrapper_Res_Description=手动安装(禁止篡改IE)
#AutoIt3Wrapper_Res_Fileversion=1.2.9.15
#AutoIt3Wrapper_Res_LegalCopyright=winner(l)
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
;自定义文件名
Dim $wjm = IniRead("WGho_Setup.ini", "自定义文件名", "WGho_Setup", "WGho_Setup.exe")
If $wjm = "" Then
Exit
EndIf
; Windows 一键还原安装程序会篡改IE首页、默认页,预先读取
$reg1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN", "Start Page")
$reg2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN", "Default_Page_URL")
$reg3 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page")
;安装
RunWait($wjm)
;恢复IE首页、默认页
RegWrite ('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN',"Default_Page_URL","REG_SZ",$reg2)
RegWrite ('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN',"Start Page","REG_SZ",$reg1)
RegWrite ('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main',"Start Page","REG_SZ",$reg3)
;清理
FileDelete(@DesktopDir & "\Windows 一键还原.lnk")
FileDelete(@StartMenuDir & "\程序\Windows 一键还原\访问论坛.*")
;FileDelete(@StartMenuDir & "\程序\Windows 一键还原\信息反馈.lnk")
;FileDelete(@StartMenuDir & "\程序\Windows 一键还原\卸载 Windows 一键还原.*")
Exit |
|