回复 3# qixinwb
没细看,整合了Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.
$aboutitem = TrayCreateItem("安装软件")
TrayCreateItem("")
$exititem = TrayCreateItem("退出")
TraySetState()
TraySetClick(16)
While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $aboutitem
MsgBox(64, "安装软件", "现在开始安装软件")
test()
Case $msg = $exititem
;MsgBox(64, "温馨提示!", "智能更新系统在您空闲的时候自动下载游戏,将使您下次进入游戏更快速!" & @CRLF & @LF & "更新完毕他会自动关闭,不会影响您上机!")
Exit
EndSelect
WEnd
Func test()
$g_szVersion = "gameupdate"
If WinExists($g_szVersion) Then Exit
AutoItWinSetTitle($g_szVersion)
$var = IniReadSectionNames("Server\e\gameupdate\gameupdate.ini")
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $i = 1 To $var[0]
ShellExecuteWait($var[$i])
Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.
TrayTip("请勿关闭游戏下载窗口!", "智能后台更新已启动,他将使您下次进入游戏更快速!", 5000, 1)
Sleep(5000)
ProcessWaitClose("load.exe")
FileWrite("\\Server\xunlei\更新日志" & @ComputerName & ".txt", @ComputerName & " " & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & " " & $var[$i] & @CRLF)
Next
TrayTip("更新完成!", "下次进入游戏将会快很多!", 5000, 1)
Sleep(5000)
TrayTip("祝您上机愉快!", "欢迎下次光临齐心网吧!", 5000, 1)
Sleep(5000)
EndIf
EndFunc ;==>test
|