Article View: borland.public.cppbuilder.nativeapi
Article #5663Re: Updating Application
From: Remy Lebeau (TeamB)
Date: Mon, 01 Aug 2005 18:05
Date: Mon, 01 Aug 2005 18:05
21 lines
1672 bytes
1672 bytes
"Mike King" <emailMK@excite.com> wrote in message news:42ee62a7@newsgroups.borland.com... > How can I make a program that updates it's self? You cannot. > 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
Technical Details
Message-ID:
<42ee6616$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42ee62a7@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7171097dce7fbc5a X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42ee62a7@newsgroups.borland.com> Subject: Re: Updating Application Date: Mon, 1 Aug 2005 11:05:46 -0700 Lines: 23 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <42ee6616$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1122919958 68.69.17.41 (1 Aug 2005 11:12:38 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail