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
Solved

Advice on auto-update architecture for my program

Posted on 2001-06-15
5
206 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article will show, step by step, how to integrate R code into a R Sweave document
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

856 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