Wubi 9.04 uninstaller cannot delete the directory containing the uninstaller itself

Bug #341605 reported by Agostino Russo on 2009-03-12
12
Affects Status Importance Assigned to Milestone
Wubi
High
Agostino Russo
Ubuntu
Critical
Evan
Jaunty
Critical
Evan

Bug Description

The uninstaller cannot delete the directory that contains the executable, even though the executable is self extracted to a temp folder and run from there. The pylauncher self-extracting code runs synchronously, so it does not exit until wubi code has exited. This results in the uninstaller failing.

Related branches

Agostino Russo (ago) on 2009-03-12
Changed in wubi:
assignee: nobody → ago
importance: Undecided → High
status: New → Confirmed
Agostino Russo (ago) on 2009-03-12
Changed in wubi:
milestone: none → 9.04
Dave Morley (davmor2) wrote :

This only occurs from the installed version of wubi. From both the uninstall option and fro windows add/remove program.

If you however reuse the cd it will happily remove the current version of wubi.

Agostino Russo (ago) wrote :

This seems a different error:

Traceback (most recent call last):
  File "Z:\home\evan\bzr\wubi.trunk\build\wubi\files\lib\wubi\backends\common\tasklist.py", line 196, in __call__
  File "Z:\home\evan\bzr\wubi.trunk\build\wubi\files\lib\wubi\backends\win32\backend.py", line 491, in undo_bootloader
  File "Z:\home\evan\bzr\wubi.trunk\build\wubi\files\lib\wubi\backends\win32\backend.py", line 668, in undo_bcd
  File "Z:\home\evan\bzr\wubi.trunk\build\wubi\files\lib\wubi\backends\common\utils.py", line 60, in run_command
Exception: Error executing command
>>command=C:\Windows\System32\bcdedit.exe /delete {3455fe3d-a4f9-11dd-87a4-001c2568a34f} /f

Do you have bcdedit in C:\Windows\System32\bcdedit.exe? Do you have an boot menu entry ID 3455fe3d-a4f9-11dd-87a4-001c2568a34f (use EasyBCD)

Agostino Russo (ago) wrote :

In reply to the first comment, the reason the uninstaller works when launched from another wubi instance, is that an existing version of wubi will first copy the old uninstaller to a temp folder, and the main wubi instance will not normally be sitting in the folder being uninstalled. However the logic is not generic and it does not work if the uninstaller is run directly (via add/remove or simply clicking on it).

Agostino Russo (ago) wrote :

I will need something like that using a batch file (a batch file can delete itself) or an asynchronous command with delay (or repeatedly trying to deleting the target binary).

http://www.codeproject.com/KB/files/cpselfdestruct2.aspx

Dave Morley (davmor2) wrote :

This now seems to be slightly worse today after a successful install on vista (1 bug fixed) I now can't remove wubi at all.

Normal inserting the cd again will allow you to remove wubi from the cd's uninstaller however today even this didn't work.

Log attached.

Agostino Russo (ago) wrote :

Same issue as before, the behaviour seems different because when the installed version and the running versions are different there are different code paths.
As a temporary workaround, copy the old uninstaller to a different directory and run it from there.

Evan (ev) wrote :

Subscribing ubuntu-release in order to get approval to update the stable symlink on rookery to point to Wubi r108, which has this fix, so that Wubi r108 is used on new CD builds. Steve, or anyone else on the release team, can you give a thumbs up / thumbs down to this?

Thanks!

Changed in ubuntu:
importance: Undecided → Critical
status: New → Confirmed
Agostino Russo (ago) wrote :

New code splits the self-extracting executable from the pythonlauncher , so that the launcher/cleanup code is always run from a temp folder, the pythonlauncher code simply invokes python.exe with appropriate arguments and then runs cleanup code to remove the temporary folder and itself. Rev might also address #347529 and #341607 (haven't tested those aspects yet).

Changed in wubi:
status: Confirmed → Fix Committed
Agostino Russo (ago) wrote :

Small regression, XP themes have been lost. The windows resource that declares that XP themes have to be used is associated to pylauncher, which in turns runs python.exe, but python.exe is a separate process without that "decoration".

Also might need to properly escape arguments. Will do some further edits over the week=end.

Changed in wubi:
status: Fix Committed → In Progress
Dave Morley (davmor2) wrote :

I added wubi-r108 to a cd and it installed but as soon as I try to remove it it breaks.

The log below is the result of trying to remove using the cd.

Agostino Russo (ago) wrote :

Dave, it seems that BCD is called twice (once for each drive) and the second invocation fails. I do not think this is a regression, I have opened a new bug for that: 354882

Agostino Russo (ago) wrote :

 rev 109 should have fixed it, tested it and seems ok. Had to create a third launcher to support themes. Also fixes #347529 and #341607. Would appreciate some further testing though.

Changed in wubi:
status: In Progress → Fix Committed
Agostino Russo (ago) wrote :

r111 is actually required

Evan (ev) wrote :

I've uploaded r115, and with the approval of the Release Team I'll update the symlink so that it gets picked up by new CD builds.

Dave Morley (davmor2) wrote :

Log is from adding wubi-r115.exe to a standard i386 cd dated 20090406

Dave Morley (davmor2) wrote :

Ago

This is fixed in r118

Of course as soon as it hits the cd's I'll try and break it by installing kubuntu over ubuntu :)

Steve Langasek (vorlon) wrote :

Per discussion with Evan on IRC, this change is ok to make on the basis of the Wubi developers' own judgement (i.e., the decision is delegated to them). For a number of reasons, Wubi changes don't fit very well into the Ubuntu freeze exception process, so this is probably the best approach.

Agostino Russo (ago) wrote :

Steve I do think that this is an important bug fix, the code ended up being a bit more invasive than I would have liked and anticipated. I could have taken some shortcuts to minimize the delta (like saving the uninstaller in the system folder), but the patch should hopefully address the issue(s) properly and will be easier to maintain in the long run.

Steve Langasek (vorlon) wrote :

Agostino,

I agree that this is an important bugfix, and my previous comment should be interpreted as a green light to make that change.:)

Steve Langasek (vorlon) wrote :

The link has been changed to point at r118 as of yesterday, so AIUI this is done.

Agostino Russo (ago) on 2009-04-09
Changed in wubi:
status: Fix Committed → Fix Released
tags: added: iso-testing
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers