Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

Location:
python/vendor/current/Tools/msi
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Tools/msi/msi.py

    r2 r388  
    22# (C) 2003 Martin v. Loewis
    33# See "FOO" in comments refers to MSDN sections with the title FOO.
    4 import msilib, schema, sequence, os, glob, time, re, shutil
     4import msilib, schema, sequence, os, glob, time, re, shutil, zipfile
    55from msilib import Feature, CAB, Directory, Dialog, Binary, add_data
    66import uisample
     
    88from distutils.spawn import find_executable
    99from uuids import product_codes
     10import tempfile
    1011
    1112# Settings can be overridden in config.py below
     
    2930# msvcrt version
    3031MSVCR = "90"
     32# Name of certificate in default store to sign MSI with
     33certname = None
     34# Make a zip file containing the PDB files for this build?
     35pdbzip = True
    3136
    3237try:
     
    112117    "25":"{2e41b118-38bd-4c1b-a840-6977efd1b911}",
    113118    "26":"{34ebecac-f046-4e1c-b0e3-9bac3cdaacfa}",
     119    "27":"{4fe21c76-1760-437b-a2f2-99909130a175}",
    114120    } [major+minor]
    115121
    116122# Compute the name that Sphinx gives to the docfile
    117123docfile = ""
    118 if micro:
    119     docfile = str(micro)
     124if int(micro):
     125    docfile = micro
    120126if level < 0xf:
    121     docfile += '%x%s' % (level, serial)
     127    if level == 0xC:
     128        docfile += "rc%s" % (serial,)
     129    else:
     130        docfile += '%x%s' % (level, serial)
    122131docfile = 'python%s%s%s.chm' % (major, minor, docfile)
    123132
     
    168177have_mingw = build_mingw_lib(lib_file, def_file, dll_file, mingw_lib)
    169178
    170 # Determine the target architechture
     179# Determine the target architecture
     180if os.system("nmake /nologo /c /f msisupport.mak") != 0:
     181    raise RuntimeError("'nmake /f msisupport.mak' failed")
    171182dll_path = os.path.join(srcdir, PCBUILD, dll_file)
    172183msilib.set_arch_from_file(dll_path)
     
    215226    # sequence is the set of standard sequences
    216227    # (ui/execute, admin/advt/install)
    217     db = msilib.init_database("python-%s%s.msi" % (full_current_version, msilib.arch_ext),
     228    msiname = "python-%s%s.msi" % (full_current_version, msilib.arch_ext)
     229    db = msilib.init_database(msiname,
    218230                  schema, ProductName="Python "+full_current_version+productsuffix,
    219231                  ProductCode=product_code,
     
    238250                             ])
    239251    db.Commit()
    240     return db
     252    return db, msiname
    241253
    242254def remove_old_versions(db):
     
    365377    # the installed/uninstalled state according to both the
    366378    # Extensions and TclTk features.
    367     if os.system("nmake /nologo /c /f msisupport.mak") != 0:
    368         raise "'nmake /f msisupport.mak' failed"
    369379    add_data(db, "Binary", [("Script", msilib.Binary("msisupport.dll"))])
    370380    # See "Custom Action Type 1"
     
    399409             ])
    400410
    401     compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x bad_coding|badsyntax|site-packages|py3_ "[TARGETDIR]Lib"'
     411    compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py3_" "[TARGETDIR]Lib"'
    402412    lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"'
    403413    # See "CustomAction Table"
     
    486496    exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title,
    487497                         "Finish", "Finish", "Finish")
    488     exit_dialog.title("Completing the [ProductName] Installer")
     498    exit_dialog.title("Complete the [ProductName] Installer")
    489499    exit_dialog.back("< Back", "Finish", active = 0)
    490500    exit_dialog.cancel("Cancel", "Back", active = 0)
     
    496506
    497507    c = exit_dialog.text("warning", 135, 200, 220, 40, 0x30003,
    498             "{\\VerdanaRed9}Warning: Python 2.5.x is the last "
    499             "Python release for Windows 9x.")
    500     c.condition("Hide", "NOT Version9X")
     508            "{\\VerdanaRed9}Warning: Python 3.3.0 is the last "
     509            "Python release for Windows 2000.")
     510    c.condition("Hide", "VersionNT > 500")
    501511
    502512    exit_dialog.text("Description", 135, 235, 220, 20, 0x30003,
     
    10021012            lib.add_file("cfgparser.1")
    10031013            lib.add_file("sgml_input.html")
    1004             lib.add_file("test.xml")
    1005             lib.add_file("test.xml.out")
    10061014            lib.add_file("testtar.tar")
    10071015            lib.add_file("test_difflib_expect.html")
     
    10121020            lib.glob("*.pem")
    10131021            lib.glob("*.pck")
    1014             lib.add_file("readme.txt", src="README")
    10151022            lib.add_file("zipdir.zip")
     1023        if dir=='tests' and parent.physical=='distutils':
     1024            lib.add_file("Setup.sample")
    10161025        if dir=='decimaltestdata':
    10171026            lib.glob("*.decTest")
     1027        if dir=='xmltestdata':
     1028            lib.glob("*.xml")
     1029            lib.add_file("test.xml.out")
    10181030        if dir=='output':
    10191031            lib.glob("test_*")
     
    11881200        tcl_verbs=[
    11891201             ("py.IDLE", -1, pat % (testprefix, "", ewi), "",
    1190               r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
     1202              r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -e "%1"',
    11911203              "REGISTRY.tcl"),
    11921204             ("pyw.IDLE", -1, pat % (testprefix, "NoCon", ewi), "",
    1193               r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
     1205              r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -e "%1"',
    11941206              "REGISTRY.tcl"),
    11951207        ]
     
    12901302    db.Commit()
    12911303
    1292 db = build_database()
     1304def build_pdbzip():
     1305    pdbexclude = ['kill_python.pdb', 'make_buildinfo.pdb',
     1306                  'make_versioninfo.pdb']
     1307    path = "python-%s%s-pdb.zip" % (full_current_version, msilib.arch_ext)
     1308    pdbzip = zipfile.ZipFile(path, 'w')
     1309    for f in glob.glob1(os.path.join(srcdir, PCBUILD), "*.pdb"):
     1310        if f not in pdbexclude and not f.endswith('_d.pdb'):
     1311            pdbzip.write(os.path.join(srcdir, PCBUILD, f), f)
     1312    pdbzip.close()
     1313
     1314db,msiname = build_database()
    12931315try:
    12941316    add_features(db)
     
    13001322finally:
    13011323    del db
     1324
     1325# Merge CRT into MSI file. This requires the database to be closed.
     1326mod_dir = os.path.join(os.environ["ProgramFiles"], "Common Files", "Merge Modules")
     1327if msilib.Win64:
     1328    modules = ["Microsoft_VC90_CRT_x86_x64.msm", "policy_9_0_Microsoft_VC90_CRT_x86_x64.msm"]
     1329else:
     1330    modules = ["Microsoft_VC90_CRT_x86.msm","policy_9_0_Microsoft_VC90_CRT_x86.msm"]
     1331
     1332for i, n in enumerate(modules):
     1333    modules[i] = os.path.join(mod_dir, n)
     1334
     1335def merge(msi, feature, rootdir, modules):
     1336    cab_and_filecount = []
     1337    # Step 1: Merge databases, extract cabfiles
     1338    m = msilib.MakeMerge2()
     1339    m.OpenLog("merge.log")
     1340    m.OpenDatabase(msi)
     1341    for module in modules:
     1342        print module
     1343        m.OpenModule(module,0)
     1344        m.Merge(feature, rootdir)
     1345        print "Errors:"
     1346        for e in m.Errors:
     1347            print e.Type, e.ModuleTable, e.DatabaseTable
     1348            print "   Modkeys:",
     1349            for s in e.ModuleKeys: print s,
     1350            print
     1351            print "   DBKeys:",
     1352            for s in e.DatabaseKeys: print s,
     1353            print
     1354        cabname = tempfile.mktemp(suffix=".cab")
     1355        m.ExtractCAB(cabname)
     1356        cab_and_filecount.append((cabname, len(m.ModuleFiles)))
     1357        m.CloseModule()
     1358    m.CloseDatabase(True)
     1359    m.CloseLog()
     1360
     1361    # Step 2: Add CAB files
     1362    i = msilib.MakeInstaller()
     1363    db = i.OpenDatabase(msi, constants.msiOpenDatabaseModeTransact)
     1364
     1365    v = db.OpenView("SELECT LastSequence FROM Media")
     1366    v.Execute(None)
     1367    maxmedia = -1
     1368    while 1:
     1369        r = v.Fetch()
     1370        if not r: break
     1371        seq = r.IntegerData(1)
     1372        if seq > maxmedia:
     1373            maxmedia = seq
     1374    print "Start of Media", maxmedia
     1375
     1376    for cabname, count in cab_and_filecount:
     1377        stream = "merged%d" % maxmedia
     1378        msilib.add_data(db, "Media",
     1379                [(maxmedia+1, maxmedia+count, None, "#"+stream, None, None)])
     1380        msilib.add_stream(db, stream,  cabname)
     1381        os.unlink(cabname)
     1382        maxmedia += count
     1383    # The merge module sets ALLUSERS to 1 in the property table.
     1384    # This is undesired; delete that
     1385    v = db.OpenView("DELETE FROM Property WHERE Property='ALLUSERS'")
     1386    v.Execute(None)
     1387    v.Close()
     1388    db.Commit()
     1389
     1390merge(msiname, "SharedCRT", "TARGETDIR", modules)
     1391
     1392# certname (from config.py) should be (a substring of)
     1393# the certificate subject, e.g. "Python Software Foundation"
     1394if certname:
     1395    os.system('signtool sign /n "%s" '
     1396      '/t http://timestamp.verisign.com/scripts/timestamp.dll '
     1397      '/d "Python %s" '
     1398      '%s' % (certname, full_current_version, msiname))
     1399
     1400if pdbzip:
     1401    build_pdbzip()
  • python/vendor/current/Tools/msi/msilib.py

    r2 r388  
    306306    # Fill the validation table
    307307    add_data(db, "_Validation", schema._Validation_records)
    308     # Initialize the summary information, allowing atmost 20 properties
     308    # Initialize the summary information, allowing at most 20 properties
    309309    si = db.GetSummaryInformation(20)
    310310    si.SetProperty(PID_TITLE, "Installation Database")
     
    517517    def add_file(self, file, src=None, version=None, language=None):
    518518        """Add a file to the current component of the directory, starting a new one
    519         one if there is no current component. By default, the file name in the source
     519        if there is no current component. By default, the file name in the source
    520520        and the file table will be identical. If the src file is specified, it is
    521521        interpreted relative to the current directory. Optionally, a version and a
  • python/vendor/current/Tools/msi/msisupport.c

    r2 r388  
    88static UINT debug(MSIHANDLE hInstall, LPCSTR msg)
    99{
    10         MSIHANDLE hRec = MsiCreateRecord(1);
    11         if (!hRec || MsiRecordSetStringA(hRec, 1, msg) != ERROR_SUCCESS) {
    12                 return ERROR_INSTALL_FAILURE;
    13         }
    14         MsiProcessMessage(hInstall, INSTALLMESSAGE_INFO, hRec);
    15         MsiCloseHandle(hRec);
    16         return ERROR_SUCCESS;
     10    MSIHANDLE hRec = MsiCreateRecord(1);
     11    if (!hRec || MsiRecordSetStringA(hRec, 1, msg) != ERROR_SUCCESS) {
     12        return ERROR_INSTALL_FAILURE;
     13    }
     14    MsiProcessMessage(hInstall, INSTALLMESSAGE_INFO, hRec);
     15    MsiCloseHandle(hRec);
     16    return ERROR_SUCCESS;
    1717}
    1818
     
    2323{
    2424#define PSIZE 1024
    25         WCHAR wpath[PSIZE];
    26         char path[PSIZE];
    27         UINT result;
    28         DWORD size = PSIZE;
    29         DWORD attributes;
     25    WCHAR wpath[PSIZE];
     26    char path[PSIZE];
     27    UINT result;
     28    DWORD size = PSIZE;
     29    DWORD attributes;
    3030
    31        
    32         result = MsiGetPropertyW(hInstall, L"TARGETDIR", wpath, &size);
    33         if (result != ERROR_SUCCESS)
    34                 return result;
    35         wpath[size] = L'\0';
    36         path[size] = L'\0';
    3731
    38         attributes = GetFileAttributesW(wpath);
    39         if (attributes == INVALID_FILE_ATTRIBUTES ||
    40                 !(attributes & FILE_ATTRIBUTE_DIRECTORY))
    41         {
    42                 return MsiSetPropertyA(hInstall, "TargetExists", "0");
    43         } else {
    44                 return MsiSetPropertyA(hInstall, "TargetExists", "1");
    45         }
     32    result = MsiGetPropertyW(hInstall, L"TARGETDIR", wpath, &size);
     33    if (result != ERROR_SUCCESS)
     34        return result;
     35    wpath[size] = L'\0';
     36    path[size] = L'\0';
     37
     38    attributes = GetFileAttributesW(wpath);
     39    if (attributes == INVALID_FILE_ATTRIBUTES ||
     40        !(attributes & FILE_ATTRIBUTE_DIRECTORY))
     41    {
     42        return MsiSetPropertyA(hInstall, "TargetExists", "0");
     43    } else {
     44        return MsiSetPropertyA(hInstall, "TargetExists", "1");
     45    }
    4646}
    4747
     
    5252UINT __declspec(dllexport) __stdcall UpdateEditIDLE(MSIHANDLE hInstall)
    5353{
    54         INSTALLSTATE ext_old, ext_new, tcl_old, tcl_new, reg_new;
    55         UINT result;
     54    INSTALLSTATE ext_old, ext_new, tcl_old, tcl_new, reg_new;
     55    UINT result;
    5656
    57         result = MsiGetFeatureStateA(hInstall, "Extensions", &ext_old, &ext_new);
    58         if (result != ERROR_SUCCESS)
    59                 return result;
    60         result = MsiGetFeatureStateA(hInstall, "TclTk", &tcl_old, &tcl_new);
    61         if (result != ERROR_SUCCESS)
    62                 return result;
     57    result = MsiGetFeatureStateA(hInstall, "Extensions", &ext_old, &ext_new);
     58    if (result != ERROR_SUCCESS)
     59        return result;
     60    result = MsiGetFeatureStateA(hInstall, "TclTk", &tcl_old, &tcl_new);
     61    if (result != ERROR_SUCCESS)
     62        return result;
    6363
    64         /* If the current state is Absent, and the user did not select
    65            the feature in the UI, Installer apparently sets the "selected"
    66            state to unknown. Update it to the current value, then. */
    67         if (ext_new == INSTALLSTATE_UNKNOWN)
    68                 ext_new = ext_old;
    69         if (tcl_new == INSTALLSTATE_UNKNOWN)
    70                 tcl_new = tcl_old;
     64    /* If the current state is Absent, and the user did not select
     65       the feature in the UI, Installer apparently sets the "selected"
     66       state to unknown. Update it to the current value, then. */
     67    if (ext_new == INSTALLSTATE_UNKNOWN)
     68        ext_new = ext_old;
     69    if (tcl_new == INSTALLSTATE_UNKNOWN)
     70        tcl_new = tcl_old;
    7171
    72         // XXX consider current state of REGISTRY.tcl?
    73         if (((tcl_new == INSTALLSTATE_LOCAL) ||
    74                 (tcl_new == INSTALLSTATE_SOURCE) ||
    75                 (tcl_new == INSTALLSTATE_DEFAULT)) &&
    76                 ((ext_new == INSTALLSTATE_LOCAL) ||
    77                 (ext_new == INSTALLSTATE_SOURCE) ||
    78                 (ext_new == INSTALLSTATE_DEFAULT))) {
    79                 reg_new = INSTALLSTATE_SOURCE;
    80         } else {
    81                 reg_new = INSTALLSTATE_ABSENT;
    82         }
    83         result = MsiSetComponentStateA(hInstall, "REGISTRY.tcl", reg_new);
    84         return result;
     72    // XXX consider current state of REGISTRY.tcl?
     73    if (((tcl_new == INSTALLSTATE_LOCAL) ||
     74            (tcl_new == INSTALLSTATE_SOURCE) ||
     75            (tcl_new == INSTALLSTATE_DEFAULT)) &&
     76        ((ext_new == INSTALLSTATE_LOCAL) ||
     77        (ext_new == INSTALLSTATE_SOURCE) ||
     78        (ext_new == INSTALLSTATE_DEFAULT))) {
     79        reg_new = INSTALLSTATE_SOURCE;
     80    } else {
     81        reg_new = INSTALLSTATE_ABSENT;
     82    }
     83    result = MsiSetComponentStateA(hInstall, "REGISTRY.tcl", reg_new);
     84    return result;
    8585}
    8686
    87 BOOL APIENTRY DllMain(HANDLE hModule, 
    88                       DWORD  ul_reason_for_call, 
     87BOOL APIENTRY DllMain(HANDLE hModule,
     88                      DWORD  ul_reason_for_call,
    8989                      LPVOID lpReserved)
    9090{
  • python/vendor/current/Tools/msi/uuids.py

    r2 r388  
    88# so people can refer to them.
    99product_codes = {
    10     '2.4.101': '{0e9b4d8e-6cda-446e-a208-7b92f3ddffa0}', # 2.4a1, released as a snapshot
    11     '2.4.102': '{1b998745-4901-4edb-bc52-213689e1b922}', # 2.4a2
    12     '2.4.103': '{33fc8bd2-1e8f-4add-a40a-ade2728d5942}', # 2.4a3
    13     '2.4.111': '{51a7e2a8-2025-4ef0-86ff-e6aab742d1fa}', # 2.4b1
    14     '2.4.112': '{4a5e7c1d-c659-4fe3-b8c9-7c65bd9c95a5}', # 2.4b2
    15     '2.4.121': '{75508821-a8e9-40a8-95bd-dbe6033ddbea}', # 2.4c1
    16     '2.4.122': '{83a9118b-4bdd-473b-afc3-bcb142feca9e}', # 2.4c2
    17     '2.4.150': '{82d9302e-f209-4805-b548-52087047483a}', # 2.4.0
    18     '2.4.1121':'{be027411-8e6b-4440-a29b-b07df0690230}', # 2.4.1c1
    19     '2.4.1122':'{02818752-48bf-4074-a281-7a4114c4f1b1}', # 2.4.1c2
    20     '2.4.1150':'{4d4f5346-7e4a-40b5-9387-fdb6181357fc}', # 2.4.1
    21     '2.4.2121':'{5ef9d6b6-df78-45d2-ab09-14786a3c5a99}', # 2.4.2c1
    22     '2.4.2150':'{b191e49c-ea23-43b2-b28a-14e0784069b8}', # 2.4.2
    23     '2.4.3121':'{f669ed4d-1dce-41c4-9617-d985397187a1}', # 2.4.3c1
    24     '2.4.3150':'{75e71add-042c-4f30-bfac-a9ec42351313}', # 2.4.3
    25     '2.4.4121':'{cd2862db-22a4-4688-8772-85407ea21550}', # 2.4.4c1
    26     '2.4.4150':'{60e2c8c9-6cf3-4b1a-9618-e304946c94e6}', # 2.4.4
    2710    '2.5.101': '{bc14ce3e-5e72-4a64-ac1f-bf59a571898c}', # 2.5a1
    2811    '2.5.102': '{5eed51c1-8e9d-4071-94c5-b40de5d49ba5}', # 2.5a2
     
    5942    '2.6.5122':'{fa227b76-0671-4dc6-b826-c2ff2a70dfd5}', # 2.6.5c2
    6043    '2.6.5150':'{4723f199-fa64-4233-8e6e-9fccc95a18ee}', # 2.6.5
     44    '2.7.101': '{eca1bbef-432c-49ae-a667-c213cc7bbf22}', # 2.7a1
     45    '2.7.102': '{21ce16ed-73c4-460d-9b11-522f417b2090}', # 2.7a2
     46    '2.7.103': '{6e7dbd55-ba4a-48ac-a688-6c75db4d7500}', # 2.7a3
     47    '2.7.104': '{ee774ba3-74a5-48d9-b425-b35a287260c8}', # 2.7a4
     48    '2.7.111': '{9cfd9ec7-a9c7-4980-a1c6-054fc6493eb3}', # 2.7b1
     49    '2.7.112': '{9a72faf6-c304-4165-8595-9291ff30cac6}', # 2.7b2
     50    '2.7.121': '{f530c94a-dd53-4de9-948e-b632b9cb48d2}', # 2.7c1
     51    '2.7.122': '{f80905d2-dd8d-4b8e-8a40-c23c93dca07d}', # 2.7c2
     52    '2.7.150': '{20c31435-2a0a-4580-be8b-ac06fc243ca4}', # 2.7.0
     53    '2.7.1121':'{60a4036a-374c-4fd2-84b9-bfae7db03931}', # 2.7.1rc1
     54    '2.7.1122':'{5965e7d1-5584-4de9-b13a-694e0b2ee3a6}', # 2.7.1rc2
     55    '2.7.1150':'{32939827-d8e5-470a-b126-870db3c69fdf}', # 2.7.1
     56    '2.7.2121':'{B2E1F06E-F719-4786-972A-488A336EB2A0}', # 2.7.2rc1
     57    '2.7.2150':'{2E295B5B-1AD4-4d36-97C2-A316084722CF}', # 2.7.2
     58    '2.7.3121':'{1ACB88BF-1425-4f11-B664-6C89A3D7699C}', # 2.7.3rc1
     59    '2.7.3122':'{B12311BE-6364-4b2a-A49A-551EEE10F3E4}', # 2.7.3rc2
     60    '2.7.3150':'{C0C31BCC-56FB-42a7-8766-D29E1BD74C7C}', # 2.7.3
     61    '2.7.4121':'{47F45F45-72D7-4e54-AF41-26767EDE95CF}', # 2.7.4rc1
     62    '2.7.4150':'{84ADC96C-B7E0-4938-9D6E-2B640D5DA224}', # 2.7.4
     63    '2.7.5150':'{DBDD570E-0952-475f-9453-AB88F3DD5659}', # 2.7.5
     64    '2.7.6121':'{D1EBC07F-A7B1-4163-83DB-AE813CEF392F}', # 2.7.6rc1
     65    '2.7.6150':'{C3CC4DF5-39A5-4027-B136-2B3E1F5AB6E2}', # 2.7.6
    6166}
Note: See TracChangeset for help on using the changeset viewer.