Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Advice on auto-update architecture for my program

Posted on 2001-06-15
5
Medium Priority
?
216 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

Industry Leaders: 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…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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 …
Suggested Courses

636 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