Solved

Advice on auto-update architecture for my program

Posted on 2001-06-15
5
196 Views
Last Modified: 2013-11-13
My task is to make our client update itself when a new version is released (basically just downloading a new exe). My current thinking is as follows

1.Have the shortcut for my client actually point to an exe which does the following
2. poll a server and acquire a version number.
3. Check this version number against the clients version number held in a local text file.
4.If the version numbers match then start the client.exe
5.If the version numbers dont match then use winsock or other control to download the new exe from our ftp server and a new version number file.
6. use file system object to copy the the new exe over the old exe.
7.have the update.exe start the client.exe

I am taking comment criticisms and elegant solutions.
I will start the points off at 75 but will go much higher, especially if one of yuze gize has an alternate solution that really makes me look good!

(BTW) Ive implemented this same architecture with batch files but I'd really like to move away from those. However, Im afraid my prior experience has given me tunnel vision regarding a better way to do this. THanks.
0
Comment
Question by:mccainz2
5 Comments
 
LVL 4

Accepted Solution

by:
beckingh earned 75 total points
Comment Utility
"Check this version number against the clients version number held in a local text file."

I'd use App.Major, App.Minor and App.Revision.  I'm doing something a lot like this and this seems elegant and works well.

Other than that I see nothing wrong with your scheme.  I have an app that does this, and what I do is check the version number, if it doesn't match then launch a new executable that launches an Uninstall and then an install.  Works quite well.  Pretty much what you are talking about, except you just copy the exe over your current exe.
0
 
LVL 5

Expert Comment

by:gbaren
Comment Utility
McCainz,

Basically you are right on track. The only thing I would suggest is updating the updater as well. If, at some later date, you find the need to do X during the download and install, you'll be able to do it. This is how mine works:

Shortcut launches iu1.exe
iu1.exe checks/updates iu2.exe
iu2.exe checks/updates iu1.exe
if iu1.exe was updated then launch iu1.exe
iu2.exe checks/updates app.exe

hth,
Gary
0
 
LVL 5

Expert Comment

by:gbaren
Comment Utility
Oh, and of course the last step:

iu2.exe launches app.exe
0
 
LVL 6

Expert Comment

by:andyclap
Comment Utility
Glad to see other people are doing this too.
I'd agree with gbaren's sugegstion to also update the updater if required.
If you're updating dlls too, then don't forget to unregister them before overwriting them, then re-register them, and don't forget lots of error handling. I've found that explicitly declaring the DllRegisterServer and DllUnregisterServer in your updater is easier to maintain than shelling out to regsvr32.
0
 
LVL 5

Author Comment

by:mccainz2
Comment Utility
thanks, I love getting rid of ancillary files!
I may start another thread on the 'updating the autoupdater' concept....
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now