Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333355

Summary: When checking for software updates Backup of file D:\ProgramFiles\Eclipse 3.6\eclipse.exe failed. File that was copied to backup could not be deleted: D:\ProgramFiles\Eclipse 3.6\eclipse.exe
Product: [Eclipse Project] Equinox Reporter: jraven <jraven>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: bcclo, david_williams, henrik.lindberg, lokhande.harshad, luis.robledano, mailtoarlo, mknauer, pascal, remy.suen, Sebastian.Dietrich, simon, volker.glave
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description jraven CLA 2010-12-30 20:40:21 EST
Build Identifier: 20100917-0705

I ran check for updates everything seemed to work OK until near the end. I got the following message:
An error occurred while uninstalling
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86 1.0.0.I20100608-0911 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
Backup of file D:\ProgramFiles\Eclipse 3.6\eclipse.exe failed.
File that was copied to backup could not be deleted: D:\ProgramFiles\Eclipse 3.6\eclipse.exe

I decided that not being able to delete eclipse while it was running was only to be expected. So I reamed eclipse.exe to eclispedummy.exe and ran this. The check update completed. Whether it really worked I am not sure, but there does seem to be a bug.

The reason I wanted to get updates was to get full support for Tomcat 7 including hot deployment of individual classes. Which after the update seems only to go up to 5.x (see preferences window -> Tomcat).

I am not sure whether to log a separate bug for this.Should support of Tomcat 7 be available?

Many thanks in advance.

Reproducible: Always

Steps to Reproduce:
1.Start Eclipse
2.Help => Check for updates
3. Say yes to everything
4. Wait for the problem
Comment 1 Remy Suen CLA 2010-12-30 20:55:09 EST
(In reply to comment #0)
> I ran check for updates everything seemed to work OK until near the end.

Which version of Eclipse were you originally trying to update from?

> The reason I wanted to get updates was to get full support for Tomcat 7
> including hot deployment of individual classes. Which after the update seems
> only to go up to 5.x (see preferences window -> Tomcat).
> 
> I am not sure whether to log a separate bug for this.Should support of Tomcat 7
> be available?

Yes, please open another bug.
Comment 2 Sebastian Dietrich CLA 2012-08-12 05:41:24 EDT
Happens for me on eclipse Juno release 20120614-1722 (64 bit) when trying to install M2Eclipse from http://download.eclipse.org/technology/m2e/releases on a clean, new eclipse installation.

An error occurred while uninstalling
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86_64 1.0.0.I20120608-1400 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
Backup of file C:\Program Files\eclipse\eclipse.exe failed.
File that was copied to backup could not be deleted: C:\Program Files\eclipse\eclipse.exe

Renaming eclipse.exe works, but then the failure comes for eclipsec.exe. When renaming that too I get the following error:

An error occurred while configuring the installed items
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Configure, operand=[R]org.eclipse.equinox.launcher.win32.win32.x86 1.1.200.v20120522-1813 --> [R]org.eclipse.equinox.launcher.win32.win32.x86 1.1.200.v20120522-1813, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.AddProgramArgumentAction).
The artifact file for osgi.bundle,org.eclipse.equinox.launcher.win32.win32.x86,1.1.200.v20120522-1813 was not found.
Comment 3 Henrik Lindberg CLA 2012-08-17 21:16:55 EDT
This can be caused by anti-wirus software that prevents changes to Program Files.

I could also be caused by insufficient privileges (I am no Windows 7 / Vista expert by far, but there are issues with "Ownership" and system files being owned by the "Trusted Installer").

IIRC there should be more info in the logs regarding the problem - this to get a clue why the file could not be removed.
Comment 4 Simon Lightfoot CLA 2014-03-07 18:57:55 EST
Had this when I tried to update Keplar from Help > Check For Updates. Mine was not in the Program Files directory and I made sure it had permission. So it again seem's as though its simply because its trying to delete a file that is currently in use to run the update.. bit of a catch 22.

Here's the error I received:

An error occurred while uninstalling
session context was:(profile=epp.package.standard, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86_64 1.0.0.v20130521-1847 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
Backup of file C:\Android\kepler\eclipse.exe failed.
Can not remove : C:\Android\kepler\eclipse.exe


I resolved mine by renaming the eclipse.exe file and then running the updates from that version. When asked to restart after the end of installation. I said no. Exited manually and checked and the update had created a new eclipse.exe file. So I've deleted the old renamed file and now use the new one. Everything seems fine now.
Comment 5 harshad lokhande CLA 2014-03-10 22:51:00 EDT
(In reply to Simon Lightfoot from comment #4)
> Had this when I tried to update Keplar from Help > Check For Updates. Mine
> was not in the Program Files directory and I made sure it had permission. So
> it again seem's as though its simply because its trying to delete a file
> that is currently in use to run the update.. bit of a catch 22.
> 
> Here's the error I received:
> 
> An error occurred while uninstalling
> session context was:(profile=epp.package.standard,
> phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall,
> operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86_64
> 1.0.0.v20130521-1847 --> null,
> action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.
> CleanupzipAction).
> Backup of file C:\Android\kepler\eclipse.exe failed.
> Can not remove : C:\Android\kepler\eclipse.exe
> 
> 
> I resolved mine by renaming the eclipse.exe file and then running the
> updates from that version. When asked to restart after the end of
> installation. I said no. Exited manually and checked and the update had
> created a new eclipse.exe file. So I've deleted the old renamed file and now
> use the new one. Everything seems fine now.

Exactly same issue I have faced to update Kepler from Help>Check For Updates.
I am using Windows Home Premimum 64-bit, May be its software's bug.
Thanks for providing alternative solution of renaming file.
Comment 6 Luis Fernando Robledano-Esteban CLA 2014-04-22 05:17:11 EDT
Same problem here.

<<An error occurred while uninstalling
session context was:(profile=epp.package.standard, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86 1.0.0.v20130521-1847 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
Backup of file D:\eclipse\eclipse.exe failed.
Can not remove : D:\eclipse\eclipse.exe
>>

Updateing from Kepler SR1 to update which seem sin Feb. 2014.
Comment 7 Volker Glave CLA 2014-04-26 06:29:42 EDT
Same here. =>

An error occurred while uninstalling
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86 1.0.0.v20130521-1847 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
Backup of file D:\_\tools\eclipse\eclipse.exe failed.
Can not remove : D:\_\tools\eclipse\eclipse.exe

-/-
Currently running (Help | About Eclipse):

Eclipse IDE for Java Developers
Version: Kepler Service Release 1
Build id: 20130919-0819
...
Comment 8 Volker Glave CLA 2014-04-26 06:49:29 EDT
Addendum to prev comment.

Tried OP's eclispedummy.exe rename workaround procedure. Seems ok this time (no error popup). 'About Eclipse' is showing:

Eclipse IDE for Java Developers
Version: Kepler Service Release 2
Build id: 20140224-0627
...

-/-
OS: Microsoft Windows XP Professional, Build 2600.xpsp_sp3_qfe.130704-0421 (Service Pack 3)
Comment 9 Claudio Bottai CLA 2014-05-13 13:51:36 EDT
Siete ridicoli
Comment 10 Pascal Rapicault CLA 2014-05-13 14:05:26 EDT

*** This bug has been marked as a duplicate of bug 427148 ***