What are your thoughts on this....


I wrote this app that updates the application and or data files for my main app.  I know how to handle params, but I would like to impliment a solution that leaves the end user totally out of the update.  I could make the application check for updates whenever you open it (and I may end up going down that road), but I would like to broadcast an instruction to update to all the clients.


I send a command

rcua data now

And that will tell all the clients to run rcu and update the data files immediatly.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You will need to be running your program all the time the pc is on, which will mean a Timer to trigger to look for your update.  

Method of looking for updates: probably best to put them in a fixed location on the web, so that the program can check that site periodically.  No good though if the end user is on a dial-up connection.

Your question implies Pushing the update to the user, but this would involve plonking an executable of some sort directly onto the user's hard drive.  Many companies security policy would baulk at this.  My feeling is that it needs to be Pulled from somewhere outside.

The question to ask is, is there any advantage in polling for updates versus scanning for them on opening the app?  Unless you are looking at updates the size of SP2 I think the user will be patient enough to see a message "Please wait, downloading updates".
You can have something like this on the server - INI file with the following information:

size= 295993

size= 295993

[subfolder/other file]
size= 295993

The client take this file and read the contents, then compare the side, md5 sum and version (for EXE, DLL, etc files). If there is a difference - download the new files from the server source directory...
If you want to be able to use a program on a computer to update the program on other computers, then you will need to use some kind of server and client components. Take a look at the Indy components that are bundled with delphi, or maybe the ICS from http://www.overbyte.be/frame_index.html

This will only work however whilst the program is running and there would need to be a server that the program would connect to.

Sorry if I've misinterpreted your question, this is just what I think you meant.
Wim ten BrinkSelf-employed developerCommented:
Simple TCP/IP should be enough. The client starts and in a separate thread it sends a message to the server providing it's current version number and asking if an update is available. The thread then waits for any response. If no response or no update then the thread just dies. Otherwise, it will need to update itself.
By doing this in a separate thread, your main application will just continue to run as normal.

Another technique could be to have every client create a separate TCP/IP port and just keep listening to this port until a command arrives. All the server has to do is broadcast the command once the update is ready. However, this means you have to keep a connection open all the time just to listen for any commands from the server. And if you only have an update every week, I just consider this a waste of resources. But it would be okay if you update twice per hour...

You could also use the first solution and have the client check for updates every 15 minutes and on start-up. That way you do manage to keep it as up-to-date as possible, without claiming too many resources. (You don't have to keep listening all the time.)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.