Article View: borland.public.cppbuilder.nativeapi
Article #11303Re: Automatic Software Update
From: Remy Lebeau (TeamB)
Date: Wed, 18 Feb 2004 10:07
Date: Wed, 18 Feb 2004 10:07
39 lines
2676 bytes
2676 bytes
"Curt" <a@aol.com> wrote in message news:40332606$1@newsgroups.borland.com... > My problem is that I can't find a way to reliably install the > updates because the application itself has a lock on the > underlying executable file. What you ask for is not doable as you describe it. Once you download the files, you must shut down the application first. Which means that you will have to either 1) use a second application to install the files and then restart the first executables, or 2) use MoveFileEx() to delay the install of the files until the machine is rebooted. > I've thought of firing up a script which sleeps for a few seconds > in order to allow the application to exit but that doesn't seem like > the best solution. That will work fine, although sleeping is not the best approach. It would be better for the script to be an actual application, and then have the closing application can pass its current process ID to the second application. That way, the second app can obtain a handle to the first app's process and then pass that handle to the WaitForSingleObject() function to actually wait for the first app to fully shut down before then continuing with the install and restarting of the first app. > Ideally, I would like to close the application, update the > files and then automatically restart the updated application. You need a second helper application for that. The alternative is to move your main app's functionality to DLLs, and then have the app simply unload the DLLs while they are being updated and then re-load them afterwards, all while the app itself is still running. Of course, if you need to update the exe itself, you will stll have to shut it down fully. Gambit
Technical Details
Message-ID:
<4033379d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40332606$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,96d6688d5f3db8a7 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-18 02:09:54 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40332606$1@newsgroups.borland.com> Subject: Re: Automatic Software Update Date: Wed, 18 Feb 2004 02:07:50 -0800 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.22.138.253 Message-ID: <4033379d$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077098397 67.22.138.253 (18 Feb 2004 01:59:57 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail