From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18776 invoked by alias); 24 Apr 2011 16:18:28 -0000 Received: (qmail 18764 invoked by uid 22791); 24 Apr 2011 16:18:27 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from nm1.bullet.mail.sp2.yahoo.com (HELO nm1.bullet.mail.sp2.yahoo.com) (98.139.91.71) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sun, 24 Apr 2011 16:18:12 +0000 Received: from [98.139.91.66] by nm1.bullet.mail.sp2.yahoo.com with NNFMP; 24 Apr 2011 16:18:12 -0000 Received: from [98.136.185.43] by tm6.bullet.mail.sp2.yahoo.com with NNFMP; 24 Apr 2011 16:18:12 -0000 Received: from [127.0.0.1] by smtp104.mail.gq1.yahoo.com with NNFMP; 24 Apr 2011 16:18:12 -0000 Received: from cgf.cx (cgf@96.252.118.15 with login) by smtp104.mail.gq1.yahoo.com with SMTP; 24 Apr 2011 09:18:11 -0700 PDT X-Yahoo-SMTP: jenXL62swBAWhMTL3wnej93oaS0ClBQOAKs8jbEbx_o- Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id C8EA24A801A for ; Sun, 24 Apr 2011 12:18:10 -0400 (EDT) Date: Sun, 24 Apr 2011 16:18:00 -0000 From: Christopher Faylor To: cygwin-apps@cygwin.com Subject: Re: [PATCH 5/5] Add a self-update mechanism for setup.exe Message-ID: <20110424161810.GE23944@ednor.casa.cgf.cx> Reply-To: cygwin-apps@cygwin.com Mail-Followup-To: cygwin-apps@cygwin.com References: <1303650357-3668-1-git-send-email-jon.turney@dronecode.org.uk> <1303650357-3668-6-git-send-email-jon.turney@dronecode.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1303650357-3668-6-git-send-email-jon.turney@dronecode.org.uk> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com X-SW-Source: 2011-04/txt/msg00059.txt.bz2 On Sun, Apr 24, 2011 at 02:05:57PM +0100, Jon TURNEY wrote: >Updating setup.exe has 3 stages: >1) Download updated setup.exe to a temporary location >2) Execute that temporary copy of setup.exe with --copy-to instructing >it to copy itself over the setup.exe to be updated >3) Execute the updated setup.exe with --remove-from instructing it >to delete the temporary copy > >A named mutex is used to ensure setup exits from each stage before >the next stage can start. > >Unfortunately, at the moment, we don't usefully check the setup version number >until after we have downloaded and parsed setup.ini, which is perhaps a bit >late to offer to update setup.exe > >v2: Address comments from Dave Korn >Properly quote arguments to ensure spaces in paths are handled safely >Place the setup URL in a string resouce > >2011-03-29 Jon TURNEY > > * res.rc (IDS_OLD_SETUP_VERSION): Change text to offer to download > new version of setup. > (IDS_SETUP_URL): Added string resource. > * resource.h (IDS_SETUP_URL): Added resource identifier. > * main.cc (wait_for_exit, self_update_remove_from, > self_update_copy_to, WinMain): Add -copy-to and --remove-from options > for self-update process. > * ini.cc (self_update_download): New function to download updated > setup. > (do_ini_thread): Prompt to download updated setup if a newer > version exists. Return a result indicating what should happen > next. > * threebar.h (PropertyPage::OnFinish): Add an implementation of > OnFinish virtual function for this class. > * threebar.cc (OnFinish): Ditto. > (OnMessageApp): Setup should finish on WM_APP_SETUP_INI_DOWNLOAD_COMPLETE > if an updated setup was downloaded. > >2011-03-29 Jon TURNEY > > * include/getopt++/DefaultFormatter.h (DefaultFormatter): Fix option string > formatting when it has no short option. Sounds wonderful but couldn't you just rename the original setup.exe out of the way, copy a new version over it in place, and then re-execute? cgf