Changeset 5497

Show
Ignore:
Timestamp:
06/06/12 06:19:41 (7 years ago)
Author:
albert
Message:

Fix for #1059 (improved Win7 detection in all Python versions)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/dist/seattleinstaller.py

    r4904 r5497  
    5454SUPPORTED_OSES = ["Windows", "WindowsCE", "Linux", "Darwin"] 
    5555# Supported Windows Versions: XP, Vista, 7 
    56 #      NOTE: python versions later than 2.5 do not properly detect Windows 7. 
    57 #            Instead, it detects "post2008server". If the version of python 
    58 #            included in the seattle Windows installer is ever upgraded, 
    59 #            it must be checked that this is still the case (maybe a patch 
    60 #            will be created after this comment is written that will actually 
    61 #            allow python to detect that it is running on Windows 7, in which 
    62 #            case the function below 'get_filepath_of_win_startup_folder...()' 
    63 #            will need to be amended appropriately). 
     56# NOTE: 
     57#   To support newer versions of Windows (or when changing the Python version  
     58#   included with the Windows installer package), ammend the function  
     59#   get_filepath_of_win_startup_folder_with_link_to_seattle() below. 
    6460 
    6561RESOURCE_PERCENTAGE = 10 
     
    252248 
    253249 
    254   # Currently, the call to platform.release() on Windows 7 machines using 
    255   # a version of python LATER than Python2.5 returns "post2008server" rather 
    256   # than something indicating that python is running on Windows 7. 
    257   # For Python2.5 running on Windows 7, platform.release() returns "Vista". 
    258250  # The startup_path is the same for Vista and Windows 7. 
    259   version = platform.release() 
    260   if version == "Vista" or version == "post2008server": 
     251  # 
     252  # As discussed per ticket #1059, different Python versions return 
     253  # different names for Windows 7 (see also http://bugs.python.org/issue7863). 
     254  # Testing on Windows 7 Professional, 64 bits, German localization,  
     255  # platform.release() returns 
     256  #   "Vista" for Python versions 2.5.2 and 2.5.4, 
     257  #   "post2008Server" for versions 2.6.2 to 2.6.5, and 
     258  #   "7" for versions 2.6.6 and 2.7.0 to 2.7.3. 
     259  # Please adapt this once new Python/Windows versions become available. 
     260 
     261  release = platform.release() 
     262  if release == "Vista" or release == "post2008Server" or release == "7": 
    261263    startup_path = os.environ.get("HOMEDRIVE") + os.environ.get("HOMEPATH") \ 
    262264        + "\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs" \ 
     
    264266    return (startup_path, os.path.exists(startup_path)) 
    265267 
    266   elif version == "XP": 
     268  elif release == "XP": 
    267269    startup_path = os.environ.get("HOMEDRIVE") + os.environ.get("HOMEPATH") \ 
    268270        + "\\Start Menu\\Programs\\Startup" + os.sep \