Jump to content
Sign in to follow this  

Program Updater

Recommended Posts


Hi all,

How to make some sort of update script for my program? I tried the following:

#include <GUIConstants.au3>

GUICreate("My GUI")  ; will create a dialog box that when displayed is centered
$t1 = GUICtrlCreateLabel("", 10, 10, 130)
$t2 = GUICtrlCreateLabel("", 10, 25, 130)
$t3 = GUICtrlCreateLabel("", 10, 40, 130)
GUISetState (@SW_SHOW)       ; will display an empty dialog box

; Run the GUI until the dialog is closed
GUICtrlSetData($t1, "Searching for updates ....")
If FileExists("[url="file://\Serverupdates$instupdate.txt"]\\Server\updates$\instupdate.txt[/url]") Then
GUICtrlSetData($t2, "Getting Update File ....") 
FileCopy("[url="file://\Serverupdates$instupdate.txt"]\\Server\updates$\instupdate.txt[/url]", @TempDir & "\instupdate.txt", 1)
$read = FileReadLine(@TempDir & "\instupdate.txt", 1)
GUICtrlSetData($t3, "New Version: " & $read)
MsgBox(64, "Updater", "No update available")
While 1
 $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop

It works, but its to time-consuming. I think theres a better way to do it. Does somebody have an idea?

Share this post

Link to post
Share on other sites

The best method is probably to create a PAD file.

Just query Google for "Create PAD file"


Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver: - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post

Link to post
Share on other sites

i made auto update in my script, it is part of my code, maybe it help u


        Case $msg = $UpdateButton 
        $size=InetGetSize ( $next_version )
        if  $size<1 Then
        MsgBox(0, "Update", "No update avaiable")
            If $size>1 Then
            InetGet($next_version, "update.rar", 1, 1)
            While @InetGetActive
            TrayTip("Downloading", "kBytes = " & @InetGetBytesRead/1000, 10, 16)
    Case $msg == $Gui_Event_close
    SaveSettings ()

i just need to remember write correct $next_version

Share this post

Link to post
Share on other sites

Check my sig - there is a Update UDF that you can use or hack to make your own. It is primarily for updating a program via the internet, however, it wouldn't take much to modify for use over a LAN etc.

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this