Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto-Update my Program 1

Status
Not open for further replies.

Griffyn

Programmer
Jul 11, 2002
1,077
AU
Hi all,

Not exactly a Delphi specific question - but there's loads of talent on this forum, so.....

Got a reverse TCP client/server program set working fine (one client, multiple servers), and now I want to set up an auto-update process, so that if I update the server program that resides in the same folder as the client, the client will distribute it to each of the other servers. That part is easy. What I'm unsure of is how does each server program, after receiving an update of itself, manage terminating itself, and having Windows run the new version?

Obviously I could write a script that runs each time Windows boots, but this is not quick enough, as some of the machines may be servers.

One thought I had was to run a Delphi helper application that runs all the time with the server programs, and watches out for a new version of the server being delivered - and it would then ask the server application to terminate, do the deleting and renaming, and launch the new version. While it works in theory, I find having a separate program running all the time just for this task very inefficient. Updates may only happen once every year for all I know.

Does anyone have any thoughts to help me out?

Much appreciated.
 
Start the helper app only when you need it, all it does is wait for the main prog to terminate, update the file and (re)start it, then exit. Mildly ugly, but quite robust.
 
I take a somewhat different approach. The app that is run is simply a loader, it might go unchanged for years. It loads, looks around to find the version it's supposed to run and runs that. The real program is stored with a numeric extension rather than a .EXE, the loader simply finds the highest numeric extension and runs it.

Thus to load an update you store it to a file whose extension is one higher than the highest one found, then run the loader and terminate.
 
Ta muchly MozNZ. Seems so clear now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top