Solved

Advice on auto-update architecture for my program

Posted on 2001-06-15
5
200 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
ID: 6196117
"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
ID: 6196487
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
ID: 6196488
Oh, and of course the last step:

iu2.exe launches app.exe
0
 
LVL 6

Expert Comment

by:andyclap
ID: 6197953
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
ID: 6204058
thanks, I love getting rid of ancillary files!
I may start another thread on the 'updating the autoupdater' concept....
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

867 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

19 Experts available now in Live!

Get 1:1 Help Now