 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mike King Guest
|
Posted: Mon Aug 01, 2005 5:54 pm Post subject: Updating Application |
|
|
How can I make a program that updates it's self? In other words, it will
need to download the new EXE then replace the old one with the new one, but
I can't modify a running program. How is this done?
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Aug 01, 2005 6:05 pm Post subject: Re: Updating Application |
|
|
"Mike King" <emailMK (AT) excite (DOT) com> wrote
| Quote: | How can I make a program that updates it's self?
|
You cannot.
| Quote: | it will need to download the new EXE then replace the old
one with the new one, but I can't modify a running program.
How is this done?
|
Have the program shut itself down, starting another helper application
beforehand. The helper can then wait for the main application to finish
terminating itself fully, then replace the file and restart it. The main
application can pass its own process ID as a command-line parameter to the
helper application so that it knows which process to wait on. The helper
application can use OpenProcess() and WaitForSingleObject().
Gambit
|
|
| Back to top |
|
 |
Michael Gillen Guest
|
Posted: Fri Aug 05, 2005 6:53 pm Post subject: Re: Updating Application |
|
|
Mike King wrote:
| Quote: | How can I make a program that updates it's self? In other words, it will need to download the
new EXE then replace the old one with the new one, but I can't modify a running program. How is
this done?
|
TWebUpdate from http://www.tmssoftware.com/ is an option. Although, it would be easy to do
yourself.
Download a file with update info and see if it's the program needs to be updated.
if so...
Download the new program
Either extract from your resource or download a "renaming program" or create a batch file
Launch the "renaming program" and exit
the renaming program or batch file:
while program.exe exists, try to delete it
When the program.exe no longer exists, rename the downloaded program to program.exe and launch it.
--
-Michael Gillen
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|