BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Updating Application

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Mike King
Guest





PostPosted: Mon Aug 01, 2005 5:54 pm    Post subject: Updating Application Reply with 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?


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Aug 01, 2005 6:05 pm    Post subject: Re: Updating Application Reply with quote




"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





PostPosted: Fri Aug 05, 2005 6:53 pm    Post subject: Re: Updating Application Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.