wubi.exe for ubuntu 11.10 fails if the default startup folder doesn't exist

Bug #910948 reported by Tariq Ahmed Khan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Wubi
Fix Committed
Undecided
Unassigned

Bug Description

wubi.exe file in ubuntu-11.10-desktop-i386.iso & only wubi.exe both doesn't start in windows 7 , 32 bit. also don't give any error.

wubi.exe from ubuntu-11.10-desktop-i386.iso log result:
---wubi-11.10-rev241----

01-03 01:09 INFO root: === wubi 11.10 rev241 ===
01-03 01:09 DEBUG root: Logfile is c:\users\****\appdata\local\temp\wubi-11.10-rev241.log
01-03 01:09 DEBUG root: sys.argv = ['main.pyo', '--exefile="H:\\wubi.exe"', '--cdmenu']
01-03 01:09 DEBUG CommonBackend: data_dir=C:\Users\****\AppData\Local\Temp\pyl627D.tmp\data
01-03 01:09 DEBUG WindowsBackend: 7z=C:\Users\****\AppData\Local\Temp\pyl627D.tmp\bin\7z.exe
01-03 01:09 DEBUG WindowsBackend: startup_folder=None
01-03 01:09 ERROR root: unsubscriptable object
Traceback (most recent call last):
  File "\lib\wubi\application.py", line 56, in run
  File "\lib\wubi\backends\win32\backend.py", line 164, in remove_existing_binary
  File "\lib\ntpath.py", line 90, in join
TypeError: unsubscriptable object

for only wubi.exe log result:
-----wubi-11.10-rev245---

01-03 01:13 INFO root: === wubi 11.10 rev245 ===
01-03 01:13 DEBUG root: Logfile is c:\users\****\appdata\local\temp\wubi-11.10-rev245.log
01-03 01:13 DEBUG root: sys.argv = ['main.pyo', '--exefile="C:\\Users\\****\\Downloads\\Programs\\wubi.exe"']
01-03 01:13 DEBUG CommonBackend: data_dir=C:\Users\****\AppData\Local\Temp\pyl6902.tmp\data
01-03 01:13 DEBUG WindowsBackend: 7z=C:\Users\****\AppData\Local\Temp\pyl6902.tmp\bin\7z.exe
01-03 01:13 DEBUG WindowsBackend: startup_folder=None
01-03 01:13 ERROR root: unsubscriptable object
Traceback (most recent call last):
  File "\lib\wubi\application.py", line 56, in run
  File "\lib\wubi\backends\win32\backend.py", line 164, in remove_existing_binary
  File "\lib\ntpath.py", line 90, in join
TypeError: unsubscriptable object

Tags: oneiric

Related branches

Revision history for this message
bcbc (bcbc) wrote :

This looks like a bug caused by the attempt to remove "wubi.exe" from the startup folder. This logic was introduced in 11.04 I believe, which inserts wubi.exe in the startup folder if a user tries to do a normal dual boot but all four primary partitions are used.

The problem is that the startup folder is not set. It looks like ntpath.py should handle this, but it probably isn't. The workaround is likely to set the startup environment variable by editing the registry (regedit) and setting:
                 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\Windows\CurrentVersion'
                '\Explorer\Shell Folders',
                'Common Startup'

Relevant code:
\lib\wubi\backends\win32\backend.py

    def remove_existing_binary(self):
        binary = os.path.join(self.get_startup_folder(), 'wubi.exe')
        if os.path.exists(binary):
            try:
                MOVEFILE_DELAY_UNTIL_REBOOT = 4
                ctypes.windll.kernel32.MoveFileExW(binary, None,
                        MOVEFILE_DELAY_UNTIL_REBOOT)
            except (OSError, IOError):
                log.exception("Couldn't remove Wubi from startup:")
============

\lib\wubi\backends\win32\backend.py

def join(a, *p):
    """Join two or more pathname components, inserting "\\" as needed"""
    path = a
    for b in p:
        b_wins = 0 # set to 1 iff b makes path irrelevant
        if path == "":
            b_wins = 1

        elif isabs(b):
            # This probably wipes out path so far. However, it's more
            # complicated if path begins with a drive letter:
            # 1. join('c:', '/a') == 'c:/a'
            # 2. join('c:/', '/a') == 'c:/a'
                # But
            # 3. join('c:/a', '/b') == '/b'
            # 4. join('c:', 'd:/') = 'd:/'
            # 5. join('c:/', 'd:/') = 'd:/'
            if path[1:2] != ":" or b[1:2] == ":":
                # Path doesn't start with a drive letter, or cases 4 and 5.
                b_wins = 1

            # Else path has a drive letter, and b doesn't but is absolute.
            elif len(path) > 3 or (len(path) == 3 and
                                   path[-1] not in "/\\"):
                # case 3
                b_wins = 1

        if b_wins:
            path = b
        else:
            # Join, and ensure there's a separator.
            assert len(path) > 0
            if path[-1] in "/\\": <== line 90, should never get here

Revision history for this message
bcbc (bcbc) wrote :

Problem was due to the startup folder not existing. i.e. deleted. Re-creating it manually solved the problem.

The code should probably handle this more gracefully as the startup folder is not required to install or run ubuntu with Wubi.

Revision history for this message
bcbc (bcbc) wrote :
bcbc (bcbc)
summary: - wubi.exe for ubuntu 11.10 isn't start in win7 32bit
+ wubi.exe for ubuntu 11.10 fails if the default startup folder doesn't
+ exist
tags: added: oneiric
Changed in wubi:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.