?
Solved

Advice on auto-update architecture for my program

Posted on 2001-06-15
5
Medium Priority
?
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 4

Accepted Solution

by:
beckingh earned 300 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

777 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