#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=C:\Repository\app.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_Res_Fileversion=0.0.0.4 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_Language=1046 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Opt("MustDeclareVars", 1) #include-once #include #include #include #include #include #include #include ; Create this script in C:\Luigi_auto_update with name app.au3 AutoUpdate("app", "Luigi", @AppDataCommonDir, "C:\Repository") Global Const $__VERSION__ = __ScriptVersion() Global $EXIT = 1 OnAutoItExitRegister("OnExit") Opt("GUIOnEventMode", 1) Opt("GUIEventOptions", 1) Opt("MustDeclareVars", 1) Opt("WinWaitDelay", 25) Global Const $bDEBUG = True Global $aGuiSize[2] = [800, 600] Global $sGuiTitle = "Nome[ " & @ScriptFullPath & " ] Versão[ " & $__VERSION__ & " ]" Global $hGui $hGui = GUICreate($sGuiTitle, $aGuiSize[0], $aGuiSize[1]) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetState(@SW_SHOW, $hGui) If Not WinActive($hGui, $sGuiTitle) Then WinActivate($hGui, $sGuiTitle) While Sleep(10) WEnd Func OnExit($sInput = 0) If $EXIT Then If $bDEBUG Then ConsoleWrite("#Func OnExit( $sInput=" & (IsDeclared("sInput") ? $sInput : "Null") & " )" & @LF) If IsDeclared("sInput") Then ConsoleWrite("OnExit[ " & $sInput & " ]" & @LF) GUISetState($hGui, @SW_HIDE) GUIDelete($hGui) EndIf Local $aExit[5] = ["Natural closin", "close by Exit function", "close by cllicking on exit of the systray", "close by user logoff", "close by Windows shutdown"] ConsoleWrite("@exitCode[ " & @exitCode & " ] @exitMethod[ " & @exitMethod & " ] @exitMethod.text[ " & $aExit[@exitMethod] & " ]" & @LF) EndFunc ;==>OnExit Func Quit() Exit EndFunc ;==>Quit