I would like to hear your opinions about the following:
I am writting a client/server app. The client will be installed on only 1 computer and the server on about 20-30 comps. I want to make the server part to be able to update it self. I was thinking, maybe the client can send a msg to all servers and then each server can request the update from the client. something like that.
What do you think? If someone has something better, please let me know.
Posted on 2003-04-24 12:05:33 by Ray
I think you got client<->server mixed up. Otherwise, idea sounds fine to me.
Posted on 2003-04-24 17:35:45 by comrade
server sits and waits commands right?
client makes the commands right?

If the above is right, then I have everything just fine :):tongue:
Posted on 2003-04-25 04:41:29 by Ray
Sometimes, clients do a bit of server work, and servers do a bit of client work.. happens.
Posted on 2003-04-25 04:47:24 by f0dder
I would suggest putting the functions in a DLL and loading it dynamically. In that case, if an update is required, you can unload the old dll and reload the updated dll. That is if you require to update the app while it's running.

There is a difference between server and client app and servers and workstations. The client app connect to the server app who is listening. After the connection, both can be doing stuff. As for Servers and workstations, normally you have few servers and many workstations. In this case, 20 workstations would connect to 1 server.
Posted on 2003-04-25 11:21:56 by Silas
thanks ,

indeed the next problem is how to update while running!
Iam still working on it....
Posted on 2003-04-26 03:53:30 by Ray
The Server can update it self by using URLDownloadToFile.

One way would be to Create a batch file, Which will delete the old app and run the new one.

OLD.exe creates and runs Run.bat,
Starts the bat file then OLD.exe terminates itself to allow deletion

del OLD.exe >> Delete the Old Server
NEW.exe /install >> Install the new one
del Run.bat >> Delete the batch file to clean up

Thats just one way.
Posted on 2003-04-26 17:22:59 by -=TM=-

Our we talking about an intranet update ( local/private wiring ) or an internet update ( public wiring )?

Regards, P1
Posted on 2003-04-28 08:58:05 by Pone
Its an intranet update.
Sorry if it was not clear.
Posted on 2003-04-30 02:44:43 by Ray
for "update while running", I'd go for the modular DLL approach. Means you have to get the "core" right fairly quickly, but since the "core" only has to be a simple program, that should be fairly easy.
Posted on 2003-04-30 02:49:36 by f0dder
All the loader does is to check the exe version and compare it to the network version, if there is a mis-match ( because I wanted the ability to go back as well as forward in rev. ), then it copies the updated exe file to the local client. Then do a CreateProcess for the local exe file. I also adjust the process to HIGH_PRIORITY_CLASS, to give the apps some pep to it.

This is an intermittant app, the user starts it numerous times, gives me the ability to update at startup. But I have also programmed a signaled restart for the app, if I need a immediate update.

The app exe has a updater code for the loader exe, so I am not stuck running around to a couple hundred workstations updating local software.

If you want a copy of the loader, let me know.

That why I asked if it was a local network app or not, this would not work for a internet app.

Enjoy your work, P1
Posted on 2003-04-30 08:35:05 by Pone

Curiosity has got the best of me.

What is the purpose of your client/server app?

Regards, P1
Posted on 2003-04-30 08:50:05 by Pone
Hello again,

I willl have to agre with you. The modular dll approach is a much more 'cleaner' approach but because of the way i coded the whole thing ( call it bad programming ) i never thought of that, so its gonna take some time to modularize it, i Think ! :tongue:
So, i am looking an 'easier' method of updating, if i can say this...!

Yea, i would like to see your work.
As for the purpose of the client/server thing, its actually a personal remote control app.
I have around 60 comps and actually i want to do a few things without running up and down a 4 floor building.
Posted on 2003-05-01 06:37:18 by Ray
Ray, either the batch file approach then, or have a "monitor" app that launches your main app and can handle the updates (I prefer the latter, so I don't have to depend on command.com / cmd.exe)
Posted on 2003-05-01 06:41:37 by f0dder

I was going for the bat file approach, but Pone's loader (, and monitor i would say,) seems interesting.
I will wait for his posting:)

Posted on 2003-05-01 06:48:10 by Ray
My first attempt was messy, involving ShellExecuting the newly-downloaded update (wininet yes) and then, sleeping 2 second while it fires up, and terminating. The new one deletes the old one as soon as it is able. It works, but it's not exactly pretty.
Posted on 2003-05-09 11:22:58 by Homer
so how is your trojan developement coming along? :)
Posted on 2003-05-28 07:49:39 by johnqpublic2323
Heh. I'm interested in a lot of things, but that's not one of them :)
Sure, I admit to having written that kind of code as a learning exercise, but by the same token, I freely admit to having written all kinds of code.
If I don't find something challenging, I lose interest very quickly - my attention span isn't the greatest. Surely there's more to life...
Posted on 2003-05-29 09:03:59 by Homer