X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 7 Apr 2010 13:14:49 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Setup 2.693 unable to replace files through reboot Message-ID: <20100407111449.GZ18530@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20100406182421 DOT GA19588 AT ednor DOT casa DOT cgf DOT cx> <20100407082714 DOT GC27428 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100407082714.GC27428@calimero.vinschen.de> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Apr 7 10:27, Corinna Vinschen wrote: > On Apr 6 14:24, Christopher Faylor wrote: > > On Tue, Apr 06, 2010 at 07:23:08PM +0300, Matthias Andree wrote: > > >Greetings, > > > > > >I have observed multiple times, and reproduced, that Setup 2.693 > > >overwriting "in-use files" and rebooting WILL NOT replace those in-use > > >files. Notably cygwin1.dll. > > >[...] > > > > It works fine on Windows XP. I can't test Windows 7 easily. Corinna > > do you have time to test this? > > I'll have a look. I can confirm the problem on W7. The mechanism in setup apparently works fine at the first glance. After the call to MoveFileEx, a new registry entry "PendingFileNameOperations" in the "Session Manager" key has been created, as expected. The content looks sound. After reboot, the PendingFileNameOperations entry has disappeared from the registry, but the Cygwin DLL hasn't changed. I can reproduce the same issue with any other file on the C: drive. MoveFileEx works, but the file is not renamed after reboot. Here's the catch. Per the documentation in http://msdn.microsoft.com/en-us/library/aa381498%28VS.85%29.aspx there's an additional registry value "AllowProtectedRenames" to set, if WFP protected files have to be replaced on reboot, apparently already starting with Windows Server 2003 R2, or 2003 SP1. I was surprised that this covered all files on the C: drive, but looking into the "System Protection" tab in the "System Properties" dialog shows that the entire C: drive is under protection by default. That means, if we want the replacement mechanism to work, we must also create the "AllowProtectedRenames" value in the "Session Manager" registry key every time the MoveFileEx is called successfully. I'll create a patch in the next couple of days if nobody beats me to it. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple