Wubi, Windows Ubuntu Installer

Merge lp:~bcbc/wubi/lp-862003-plus3more into lp:wubi

Proposed by bcbc on 2012-02-24
Reviewer Review Type Date Requested Status
Ubuntu Installer Team 2012-02-24 Pending
Review via email: mp+94507@code.launchpad.net

Description of the Change

* Correct NameError exceptions on missing attributes
  when running CD boot helper or a CD is rejected (LP: #876154).

I tested this by installing from a USB with a partition > 900,000,000 bytes so that it fails the size check. This results in a NameError on self.info.cd_path. I had to tweak some code to test this, because it ignored the size failure because it was an alpha release.
I tested the NameError on self.info.iso_path by using the "help me to boot' option from the CD boot menu (from the same USB stick). I got the NameError on rev 256 but not with my change.
------

* Ignore Permission denied when copying wubildr everywhere
  (LP: #862003)

I tested my fix by running it on Windows 7 with the Microsoft office Q: drive. I got the Permission Denied error with rev 256, but not with my version. It installed and booted successfully.
---------
* Don't fail if Windows' startup folder is missing or mis-
  configured (LP: #910948)

I have regression tested this on my Windows 7 - my fix doesn't cause any issues. I tried to rename my Startup folder but Win7 was overriding my attempts and I don't feel like breaking it just yet. The code change is pretty straightforward.
---------

* If bcdedit fails when uninstalling, it shouldn't be fatal
  (LP: #925779)

Not tested yet, but the code change is pretty straightforward.
----------------------------

To post a comment you must log in.
bcbc (bcbc) wrote :

The fix I described as "Correct NameError exceptions on missing attributes when running CD boot helper or a CD is rejected (LP: #876154)." also fixes bug 891577.

Preview Diff

1=== modified file 'debian/changelog'
2--- debian/changelog 2012-02-01 16:32:10 +0000
3+++ debian/changelog 2012-02-24 09:15:22 +0000
4@@ -1,5 +1,15 @@
5 wubi (12.04) UNRELEASED; urgency=low
6
7+ [ bcbc ]
8+ * Correct NameError exceptions on missing attributes
9+ when running CD boot helper or a CD is rejected (LP: #876154).
10+ * Ignore Permission denied when copying wubildr everywhere
11+ (LP: #862003)
12+ * Don't fail if Windows' startup folder is missing or mis-
13+ configured (LP: #910948)
14+ * If bcdedit fails when uninstalling, it shouldn't be fatal
15+ (LP: #925779)
16+
17 [ Evan Dandrea ]
18 * Remove partially downloaded files that Windows does not consider
19 files when the bit torrent tracker falls over (LP: #873268).
20
21=== modified file 'src/wubi/backends/common/backend.py'
22--- src/wubi/backends/common/backend.py 2012-02-01 16:32:10 +0000
23+++ src/wubi/backends/common/backend.py 2012-02-24 09:15:22 +0000
24@@ -120,6 +120,7 @@
25 return tasklist
26
27 def get_cdboot_tasklist(self):
28+ self.cache_cd_path()
29 tasks = [
30 Task(self.select_target_dir, description=_("Selecting the target directory")),
31 Task(self.create_dir_structure, description=_("Creating the installation directories")),
32@@ -345,6 +346,7 @@
33 return urls
34
35 def cache_cd_path(self):
36+ self.iso_path = None
37 self.cd_path = None
38 if self.info.cd_distro \
39 and self.info.distro == self.info.cd_distro \
40@@ -355,7 +357,6 @@
41 self.cd_path = self.find_cd()
42
43 if not self.cd_path:
44- self.iso_path = None
45 if self.info.iso_distro \
46 and self.info.distro == self.info.iso_distro \
47 and os.path.isfile(self.info.iso_path):
48
49=== modified file 'src/wubi/backends/win32/backend.py'
50--- src/wubi/backends/win32/backend.py 2011-10-11 09:30:51 +0000
51+++ src/wubi/backends/win32/backend.py 2012-02-24 09:15:22 +0000
52@@ -160,7 +160,11 @@
53 shutil.copyfile(src, dest)
54
55 def remove_existing_binary(self):
56- binary = os.path.join(self.get_startup_folder(), 'wubi.exe')
57+ try:
58+ binary = os.path.join(self.get_startup_folder(), 'wubi.exe')
59+ except: # if the startup folder is missing, there is nothing to remove
60+ return
61+
62 if os.path.exists(binary):
63 try:
64 MOVEFILE_DELAY_UNTIL_REBOOT = 4
65@@ -478,7 +482,10 @@
66 if drive.type not in ('removable', 'hd'):
67 continue
68 dest = join_path(drive.path, 'wubildr')
69- shutil.copyfile(src, dest)
70+ try:
71+ shutil.copyfile(src, dest)
72+ except: # don't need to worry about failure here
73+ pass
74 os.unlink(src)
75
76 def get_usb_search_paths(self):
77@@ -741,12 +748,15 @@
78 return
79 log.debug("Removing bcd entry %s" % id)
80 command = [bcdedit, '/delete', id , '/f']
81- run_command(command)
82- registry.set_value(
83- 'HKEY_LOCAL_MACHINE',
84- self.info.registry_key,
85- 'VistaBootDrive',
86- "")
87+ try:
88+ run_command(command)
89+ registry.set_value(
90+ 'HKEY_LOCAL_MACHINE',
91+ self.info.registry_key,
92+ 'VistaBootDrive',
93+ "")
94+ except Exception, err: #this shouldn't be fatal
95+ log.error(err)
96
97 def get_arch(self):
98 cpuid = ctypes.windll.LoadLibrary(self.info.cpuid)

Subscribers

People subscribed via source and target branches

to status/vote changes: