AppPkg/Applications/Python: Add Python 2.7.2 sources since the release of Python 2.7.3 made them unavailable from the python.org web site.

These files are a subset of the python-2.7.2.tgz distribution from python.org.  Changed files from PyMod-2.7.2 have been copied into the corresponding directories of this tree, replacing the original files in the distribution.

Signed-off-by: daryl.mcdaniel@intel.com


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13197 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
darylm503
2012-04-16 22:12:42 +00:00
parent cbc6b5e545
commit 4710c53dca
2106 changed files with 871583 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
Packaging Python as a Microsoft Installer Package (MSI)
=======================================================
Using this library, Python can be packaged as a MS-Windows
MSI file. To generate an installer package, you need
a build tree. By default, the build tree root directory
is assumed to be in "../..". This location can be changed
by adding a file config.py; see the beginning of msi.py
for additional customization options.
The packaging process assumes that binaries have been
generated according to the instructions in PCBuild/README.txt,
and that you have either Visual Studio or the Platform SDK
installed. In addition, you need the Python COM extensions,
either from PythonWin, or from ActivePython.
To invoke the script, open a cmd.exe window which has
cabarc.exe in its PATH (e.g. "Visual Studio .NET 2003
Command Prompt"). Then invoke
<path-to-python.exe> msi.py
If everything succeeds, pythonX.Y.Z.msi is generated
in the current directory.

View File

@@ -0,0 +1,44 @@
Additional Conditions for this Windows binary build
---------------------------------------------------
This program is linked with and uses Microsoft Distributable Code,
copyrighted by Microsoft Corporation. The Microsoft Distributable Code
includes the following files:
msvcr90.dll
msvcp90.dll
msvcm90.dll
If you further distribute programs that include the Microsoft
Distributable Code, you must comply with the restrictions on
distribution specified by Microsoft. In particular, you must require
distributors and external end users to agree to terms that protect the
Microsoft Distributable Code at least as much as Microsoft's own
requirements for the Distributable Code. See Microsoft's documentation
(included in its developer tools and on its website at microsoft.com)
for specific details.
Redistribution of the Windows binary build of the Python interpreter
complies with this agreement, provided that you do not:
- alter any copyright, trademark or patent notice in Microsoft's
Distributable Code;
- use Microsoft's trademarks in your programs' names or in a way that
suggests your programs come from or are endorsed by Microsoft;
- distribute Microsoft's Distributable Code to run on a platform other
than Microsoft operating systems, run-time technologies or application
platforms; or
- include Microsoft Distributable Code in malicious, deceptive or
unlawful programs.
These restrictions apply only to the Microsoft Distributable Code as
defined above, not to Python itself or any programs running on the
Python interpreter. The redistribution of the Python interpreter and
libraries is governed by the Python Software License included with this
file, or by other licenses as marked.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,692 @@
# Microsoft Installer Library
# (C) 2003 Martin v. Loewis
import win32com.client.gencache
import win32com.client
import pythoncom, pywintypes
from win32com.client import constants
import re, string, os, sets, glob, subprocess, sys, _winreg, struct
try:
basestring
except NameError:
basestring = (str, unicode)
# Partially taken from Wine
datasizemask= 0x00ff
type_valid= 0x0100
type_localizable= 0x0200
typemask= 0x0c00
type_long= 0x0000
type_short= 0x0400
type_string= 0x0c00
type_binary= 0x0800
type_nullable= 0x1000
type_key= 0x2000
# XXX temporary, localizable?
knownbits = datasizemask | type_valid | type_localizable | \
typemask | type_nullable | type_key
# Summary Info Property IDs
PID_CODEPAGE=1
PID_TITLE=2
PID_SUBJECT=3
PID_AUTHOR=4
PID_KEYWORDS=5
PID_COMMENTS=6
PID_TEMPLATE=7
PID_LASTAUTHOR=8
PID_REVNUMBER=9
PID_LASTPRINTED=11
PID_CREATE_DTM=12
PID_LASTSAVE_DTM=13
PID_PAGECOUNT=14
PID_WORDCOUNT=15
PID_CHARCOUNT=16
PID_APPNAME=18
PID_SECURITY=19
def reset():
global _directories
_directories = sets.Set()
def EnsureMSI():
win32com.client.gencache.EnsureModule('{000C1092-0000-0000-C000-000000000046}', 1033, 1, 0)
def EnsureMSM():
try:
win32com.client.gencache.EnsureModule('{0ADDA82F-2C26-11D2-AD65-00A0C9AF11A6}', 0, 1, 0)
except pywintypes.com_error:
win32com.client.gencache.EnsureModule('{0ADDA82F-2C26-11D2-AD65-00A0C9AF11A6}', 0, 2, 0)
_Installer=None
def MakeInstaller():
global _Installer
if _Installer is None:
EnsureMSI()
_Installer = win32com.client.Dispatch('WindowsInstaller.Installer',
resultCLSID='{000C1090-0000-0000-C000-000000000046}')
return _Installer
_Merge=None
def MakeMerge2():
global _Merge
if _Merge is None:
EnsureMSM()
_Merge = win32com.client.Dispatch("Msm.Merge2.1")
return _Merge
class Table:
def __init__(self, name):
self.name = name
self.fields = []
def add_field(self, index, name, type):
self.fields.append((index,name,type))
def sql(self):
fields = []
keys = []
self.fields.sort()
fields = [None]*len(self.fields)
for index, name, type in self.fields:
index -= 1
unk = type & ~knownbits
if unk:
print "%s.%s unknown bits %x" % (self.name, name, unk)
size = type & datasizemask
dtype = type & typemask
if dtype == type_string:
if size:
tname="CHAR(%d)" % size
else:
tname="CHAR"
elif dtype == type_short:
assert size==2
tname = "SHORT"
elif dtype == type_long:
assert size==4
tname="LONG"
elif dtype == type_binary:
assert size==0
tname="OBJECT"
else:
tname="unknown"
print "%s.%sunknown integer type %d" % (self.name, name, size)
if type & type_nullable:
flags = ""
else:
flags = " NOT NULL"
if type & type_localizable:
flags += " LOCALIZABLE"
fields[index] = "`%s` %s%s" % (name, tname, flags)
if type & type_key:
keys.append("`%s`" % name)
fields = ", ".join(fields)
keys = ", ".join(keys)
return "CREATE TABLE %s (%s PRIMARY KEY %s)" % (self.name, fields, keys)
def create(self, db):
v = db.OpenView(self.sql())
v.Execute(None)
v.Close()
class Binary:
def __init__(self, fname):
self.name = fname
def __repr__(self):
return 'msilib.Binary(os.path.join(dirname,"%s"))' % self.name
def gen_schema(destpath, schemapath):
d = MakeInstaller()
schema = d.OpenDatabase(schemapath,
win32com.client.constants.msiOpenDatabaseModeReadOnly)
# XXX ORBER BY
v=schema.OpenView("SELECT * FROM _Columns")
curtable=None
tables = []
v.Execute(None)
f = open(destpath, "wt")
f.write("from msilib import Table\n")
while 1:
r=v.Fetch()
if not r:break
name=r.StringData(1)
if curtable != name:
f.write("\n%s = Table('%s')\n" % (name,name))
curtable = name
tables.append(name)
f.write("%s.add_field(%d,'%s',%d)\n" %
(name, r.IntegerData(2), r.StringData(3), r.IntegerData(4)))
v.Close()
f.write("\ntables=[%s]\n\n" % (", ".join(tables)))
# Fill the _Validation table
f.write("_Validation_records = [\n")
v = schema.OpenView("SELECT * FROM _Validation")
v.Execute(None)
while 1:
r = v.Fetch()
if not r:break
# Table, Column, Nullable
f.write("(%s,%s,%s," %
(`r.StringData(1)`, `r.StringData(2)`, `r.StringData(3)`))
def put_int(i):
if r.IsNull(i):f.write("None, ")
else:f.write("%d," % r.IntegerData(i))
def put_str(i):
if r.IsNull(i):f.write("None, ")
else:f.write("%s," % `r.StringData(i)`)
put_int(4) # MinValue
put_int(5) # MaxValue
put_str(6) # KeyTable
put_int(7) # KeyColumn
put_str(8) # Category
put_str(9) # Set
put_str(10)# Description
f.write("),\n")
f.write("]\n\n")
f.close()
def gen_sequence(destpath, msipath):
dir = os.path.dirname(destpath)
d = MakeInstaller()
seqmsi = d.OpenDatabase(msipath,
win32com.client.constants.msiOpenDatabaseModeReadOnly)
v = seqmsi.OpenView("SELECT * FROM _Tables");
v.Execute(None)
f = open(destpath, "w")
print >>f, "import msilib,os;dirname=os.path.dirname(__file__)"
tables = []
while 1:
r = v.Fetch()
if not r:break
table = r.StringData(1)
tables.append(table)
f.write("%s = [\n" % table)
v1 = seqmsi.OpenView("SELECT * FROM `%s`" % table)
v1.Execute(None)
info = v1.ColumnInfo(constants.msiColumnInfoTypes)
while 1:
r = v1.Fetch()
if not r:break
rec = []
for i in range(1,r.FieldCount+1):
if r.IsNull(i):
rec.append(None)
elif info.StringData(i)[0] in "iI":
rec.append(r.IntegerData(i))
elif info.StringData(i)[0] in "slSL":
rec.append(r.StringData(i))
elif info.StringData(i)[0]=="v":
size = r.DataSize(i)
bytes = r.ReadStream(i, size, constants.msiReadStreamBytes)
bytes = bytes.encode("latin-1") # binary data represented "as-is"
if table == "Binary":
fname = rec[0]+".bin"
open(os.path.join(dir,fname),"wb").write(bytes)
rec.append(Binary(fname))
else:
rec.append(bytes)
else:
raise "Unsupported column type", info.StringData(i)
f.write(repr(tuple(rec))+",\n")
v1.Close()
f.write("]\n\n")
v.Close()
f.write("tables=%s\n" % repr(map(str,tables)))
f.close()
class _Unspecified:pass
def change_sequence(seq, action, seqno=_Unspecified, cond = _Unspecified):
"Change the sequence number of an action in a sequence list"
for i in range(len(seq)):
if seq[i][0] == action:
if cond is _Unspecified:
cond = seq[i][1]
if seqno is _Unspecified:
seqno = seq[i][2]
seq[i] = (action, cond, seqno)
return
raise ValueError, "Action not found in sequence"
def add_data(db, table, values):
d = MakeInstaller()
v = db.OpenView("SELECT * FROM `%s`" % table)
count = v.ColumnInfo(0).FieldCount
r = d.CreateRecord(count)
for value in values:
assert len(value) == count, value
for i in range(count):
field = value[i]
if isinstance(field, (int, long)):
r.SetIntegerData(i+1,field)
elif isinstance(field, basestring):
r.SetStringData(i+1,field)
elif field is None:
pass
elif isinstance(field, Binary):
r.SetStream(i+1, field.name)
else:
raise TypeError, "Unsupported type %s" % field.__class__.__name__
v.Modify(win32com.client.constants.msiViewModifyInsert, r)
r.ClearData()
v.Close()
def add_stream(db, name, path):
d = MakeInstaller()
v = db.OpenView("INSERT INTO _Streams (Name, Data) VALUES ('%s', ?)" % name)
r = d.CreateRecord(1)
r.SetStream(1, path)
v.Execute(r)
v.Close()
def init_database(name, schema,
ProductName, ProductCode, ProductVersion,
Manufacturer,
request_uac = False):
try:
os.unlink(name)
except OSError:
pass
ProductCode = ProductCode.upper()
d = MakeInstaller()
# Create the database
db = d.OpenDatabase(name,
win32com.client.constants.msiOpenDatabaseModeCreate)
# Create the tables
for t in schema.tables:
t.create(db)
# Fill the validation table
add_data(db, "_Validation", schema._Validation_records)
# Initialize the summary information, allowing atmost 20 properties
si = db.GetSummaryInformation(20)
si.SetProperty(PID_TITLE, "Installation Database")
si.SetProperty(PID_SUBJECT, ProductName)
si.SetProperty(PID_AUTHOR, Manufacturer)
si.SetProperty(PID_TEMPLATE, msi_type)
si.SetProperty(PID_REVNUMBER, gen_uuid())
if request_uac:
wc = 2 # long file names, compressed, original media
else:
wc = 2 | 8 # +never invoke UAC
si.SetProperty(PID_WORDCOUNT, wc)
si.SetProperty(PID_PAGECOUNT, 200)
si.SetProperty(PID_APPNAME, "Python MSI Library")
# XXX more properties
si.Persist()
add_data(db, "Property", [
("ProductName", ProductName),
("ProductCode", ProductCode),
("ProductVersion", ProductVersion),
("Manufacturer", Manufacturer),
("ProductLanguage", "1033")])
db.Commit()
return db
def add_tables(db, module):
for table in module.tables:
add_data(db, table, getattr(module, table))
def make_id(str):
#str = str.replace(".", "_") # colons are allowed
str = str.replace(" ", "_")
str = str.replace("-", "_")
str = str.replace("+", "_")
if str[0] in string.digits:
str = "_"+str
assert re.match("^[A-Za-z_][A-Za-z0-9_.]*$", str), "FILE"+str
return str
def gen_uuid():
return str(pythoncom.CreateGuid())
class CAB:
def __init__(self, name):
self.name = name
self.file = open(name+".txt", "wt")
self.filenames = sets.Set()
self.index = 0
def gen_id(self, dir, file):
logical = _logical = make_id(file)
pos = 1
while logical in self.filenames:
logical = "%s.%d" % (_logical, pos)
pos += 1
self.filenames.add(logical)
return logical
def append(self, full, file, logical = None):
if os.path.isdir(full):
return
if not logical:
logical = self.gen_id(dir, file)
self.index += 1
if full.find(" ")!=-1:
print >>self.file, '"%s" %s' % (full, logical)
else:
print >>self.file, '%s %s' % (full, logical)
return self.index, logical
def commit(self, db):
self.file.close()
try:
os.unlink(self.name+".cab")
except OSError:
pass
for k, v in [(r"Software\Microsoft\VisualStudio\7.1\Setup\VS", "VS7CommonBinDir"),
(r"Software\Microsoft\VisualStudio\8.0\Setup\VS", "VS7CommonBinDir"),
(r"Software\Microsoft\VisualStudio\9.0\Setup\VS", "VS7CommonBinDir"),
(r"Software\Microsoft\Win32SDK\Directories", "Install Dir"),
]:
try:
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, k)
dir = _winreg.QueryValueEx(key, v)[0]
_winreg.CloseKey(key)
except (WindowsError, IndexError):
continue
cabarc = os.path.join(dir, r"Bin", "cabarc.exe")
if not os.path.exists(cabarc):
continue
break
else:
print "WARNING: cabarc.exe not found in registry"
cabarc = "cabarc.exe"
cmd = r'"%s" -m lzx:21 n %s.cab @%s.txt' % (cabarc, self.name, self.name)
p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in p.stdout:
if line.startswith(" -- adding "):
sys.stdout.write(".")
else:
sys.stdout.write(line)
sys.stdout.flush()
if not os.path.exists(self.name+".cab"):
raise IOError, "cabarc failed"
add_data(db, "Media",
[(1, self.index, None, "#"+self.name, None, None)])
add_stream(db, self.name, self.name+".cab")
os.unlink(self.name+".txt")
os.unlink(self.name+".cab")
db.Commit()
_directories = sets.Set()
class Directory:
def __init__(self, db, cab, basedir, physical, _logical, default, componentflags=None):
"""Create a new directory in the Directory table. There is a current component
at each point in time for the directory, which is either explicitly created
through start_component, or implicitly when files are added for the first
time. Files are added into the current component, and into the cab file.
To create a directory, a base directory object needs to be specified (can be
None), the path to the physical directory, and a logical directory name.
Default specifies the DefaultDir slot in the directory table. componentflags
specifies the default flags that new components get."""
index = 1
_logical = make_id(_logical)
logical = _logical
while logical in _directories:
logical = "%s%d" % (_logical, index)
index += 1
_directories.add(logical)
self.db = db
self.cab = cab
self.basedir = basedir
self.physical = physical
self.logical = logical
self.component = None
self.short_names = sets.Set()
self.ids = sets.Set()
self.keyfiles = {}
self.componentflags = componentflags
if basedir:
self.absolute = os.path.join(basedir.absolute, physical)
blogical = basedir.logical
else:
self.absolute = physical
blogical = None
add_data(db, "Directory", [(logical, blogical, default)])
def start_component(self, component = None, feature = None, flags = None, keyfile = None, uuid=None):
"""Add an entry to the Component table, and make this component the current for this
directory. If no component name is given, the directory name is used. If no feature
is given, the current feature is used. If no flags are given, the directory's default
flags are used. If no keyfile is given, the KeyPath is left null in the Component
table."""
if flags is None:
flags = self.componentflags
if uuid is None:
uuid = gen_uuid()
else:
uuid = uuid.upper()
if component is None:
component = self.logical
self.component = component
if Win64:
flags |= 256
if keyfile:
keyid = self.cab.gen_id(self.absolute, keyfile)
self.keyfiles[keyfile] = keyid
else:
keyid = None
add_data(self.db, "Component",
[(component, uuid, self.logical, flags, None, keyid)])
if feature is None:
feature = current_feature
add_data(self.db, "FeatureComponents",
[(feature.id, component)])
def make_short(self, file):
file = re.sub(r'[\?|><:/*"+,;=\[\]]', '_', file) # restrictions on short names
parts = file.split(".")
if len(parts)>1:
suffix = parts[-1].upper()
else:
suffix = None
prefix = parts[0].upper()
if len(prefix) <= 8 and (not suffix or len(suffix)<=3):
if suffix:
file = prefix+"."+suffix
else:
file = prefix
assert file not in self.short_names
else:
prefix = prefix[:6]
if suffix:
suffix = suffix[:3]
pos = 1
while 1:
if suffix:
file = "%s~%d.%s" % (prefix, pos, suffix)
else:
file = "%s~%d" % (prefix, pos)
if file not in self.short_names: break
pos += 1
assert pos < 10000
if pos in (10, 100, 1000):
prefix = prefix[:-1]
self.short_names.add(file)
return file
def add_file(self, file, src=None, version=None, language=None):
"""Add a file to the current component of the directory, starting a new one
one if there is no current component. By default, the file name in the source
and the file table will be identical. If the src file is specified, it is
interpreted relative to the current directory. Optionally, a version and a
language can be specified for the entry in the File table."""
if not self.component:
self.start_component(self.logical, current_feature)
if not src:
# Allow relative paths for file if src is not specified
src = file
file = os.path.basename(file)
absolute = os.path.join(self.absolute, src)
assert not re.search(r'[\?|><:/*]"', file) # restrictions on long names
if self.keyfiles.has_key(file):
logical = self.keyfiles[file]
else:
logical = None
sequence, logical = self.cab.append(absolute, file, logical)
assert logical not in self.ids
self.ids.add(logical)
short = self.make_short(file)
full = "%s|%s" % (short, file)
filesize = os.stat(absolute).st_size
# constants.msidbFileAttributesVital
# Compressed omitted, since it is the database default
# could add r/o, system, hidden
attributes = 512
add_data(self.db, "File",
[(logical, self.component, full, filesize, version,
language, attributes, sequence)])
if not version:
# Add hash if the file is not versioned
filehash = MakeInstaller().FileHash(absolute, 0)
add_data(self.db, "MsiFileHash",
[(logical, 0, filehash.IntegerData(1),
filehash.IntegerData(2), filehash.IntegerData(3),
filehash.IntegerData(4))])
# Automatically remove .pyc/.pyo files on uninstall (2)
# XXX: adding so many RemoveFile entries makes installer unbelievably
# slow. So instead, we have to use wildcard remove entries
# if file.endswith(".py"):
# add_data(self.db, "RemoveFile",
# [(logical+"c", self.component, "%sC|%sc" % (short, file),
# self.logical, 2),
# (logical+"o", self.component, "%sO|%so" % (short, file),
# self.logical, 2)])
def glob(self, pattern, exclude = None):
"""Add a list of files to the current component as specified in the
glob pattern. Individual files can be excluded in the exclude list."""
files = glob.glob1(self.absolute, pattern)
for f in files:
if exclude and f in exclude: continue
self.add_file(f)
return files
def remove_pyc(self):
"Remove .pyc/.pyo files on uninstall"
add_data(self.db, "RemoveFile",
[(self.component+"c", self.component, "*.pyc", self.logical, 2),
(self.component+"o", self.component, "*.pyo", self.logical, 2)])
def removefile(self, key, pattern):
"Add a RemoveFile entry"
add_data(self.db, "RemoveFile", [(self.component+key, self.component, pattern, self.logical, 2)])
class Feature:
def __init__(self, db, id, title, desc, display, level = 1,
parent=None, directory = None, attributes=0):
self.id = id
if parent:
parent = parent.id
add_data(db, "Feature",
[(id, parent, title, desc, display,
level, directory, attributes)])
def set_current(self):
global current_feature
current_feature = self
class Control:
def __init__(self, dlg, name):
self.dlg = dlg
self.name = name
def event(self, ev, arg, cond = "1", order = None):
add_data(self.dlg.db, "ControlEvent",
[(self.dlg.name, self.name, ev, arg, cond, order)])
def mapping(self, ev, attr):
add_data(self.dlg.db, "EventMapping",
[(self.dlg.name, self.name, ev, attr)])
def condition(self, action, condition):
add_data(self.dlg.db, "ControlCondition",
[(self.dlg.name, self.name, action, condition)])
class RadioButtonGroup(Control):
def __init__(self, dlg, name, property):
self.dlg = dlg
self.name = name
self.property = property
self.index = 1
def add(self, name, x, y, w, h, text, value = None):
if value is None:
value = name
add_data(self.dlg.db, "RadioButton",
[(self.property, self.index, value,
x, y, w, h, text, None)])
self.index += 1
class Dialog:
def __init__(self, db, name, x, y, w, h, attr, title, first, default, cancel):
self.db = db
self.name = name
self.x, self.y, self.w, self.h = x,y,w,h
add_data(db, "Dialog", [(name, x,y,w,h,attr,title,first,default,cancel)])
def control(self, name, type, x, y, w, h, attr, prop, text, next, help):
add_data(self.db, "Control",
[(self.name, name, type, x, y, w, h, attr, prop, text, next, help)])
return Control(self, name)
def text(self, name, x, y, w, h, attr, text):
return self.control(name, "Text", x, y, w, h, attr, None,
text, None, None)
def bitmap(self, name, x, y, w, h, text):
return self.control(name, "Bitmap", x, y, w, h, 1, None, text, None, None)
def line(self, name, x, y, w, h):
return self.control(name, "Line", x, y, w, h, 1, None, None, None, None)
def pushbutton(self, name, x, y, w, h, attr, text, next):
return self.control(name, "PushButton", x, y, w, h, attr, None, text, next, None)
def radiogroup(self, name, x, y, w, h, attr, prop, text, next):
add_data(self.db, "Control",
[(self.name, name, "RadioButtonGroup",
x, y, w, h, attr, prop, text, next, None)])
return RadioButtonGroup(self, name, prop)
def checkbox(self, name, x, y, w, h, attr, prop, text, next):
return self.control(name, "CheckBox", x, y, w, h, attr, prop, text, next, None)
def pe_type(path):
header = open(path, "rb").read(1000)
# offset of PE header is at offset 0x3c
pe_offset = struct.unpack("<i", header[0x3c:0x40])[0]
assert header[pe_offset:pe_offset+4] == "PE\0\0"
machine = struct.unpack("<H", header[pe_offset+4:pe_offset+6])[0]
return machine
def set_arch_from_file(path):
global msi_type, Win64, arch_ext
machine = pe_type(path)
if machine == 0x14c:
# i386
msi_type = "Intel"
Win64 = 0
arch_ext = ''
elif machine == 0x200:
# Itanium
msi_type = "Intel64"
Win64 = 1
arch_ext = '.ia64'
elif machine == 0x8664:
# AMD64
msi_type = "x64"
Win64 = 1
arch_ext = '.amd64'
else:
raise ValueError, "Unsupported architecture"
msi_type += ";1033"

View File

@@ -0,0 +1,93 @@
#include "windows.h"
#include "msiquery.h"
/* Print a debug message to the installer log file.
* To see the debug messages, install with
* msiexec /i pythonxy.msi /l*v python.log
*/
static UINT debug(MSIHANDLE hInstall, LPCSTR msg)
{
MSIHANDLE hRec = MsiCreateRecord(1);
if (!hRec || MsiRecordSetStringA(hRec, 1, msg) != ERROR_SUCCESS) {
return ERROR_INSTALL_FAILURE;
}
MsiProcessMessage(hInstall, INSTALLMESSAGE_INFO, hRec);
MsiCloseHandle(hRec);
return ERROR_SUCCESS;
}
/* Check whether the TARGETDIR exists and is a directory.
* Set TargetExists appropriately.
*/
UINT __declspec(dllexport) __stdcall CheckDir(MSIHANDLE hInstall)
{
#define PSIZE 1024
WCHAR wpath[PSIZE];
char path[PSIZE];
UINT result;
DWORD size = PSIZE;
DWORD attributes;
result = MsiGetPropertyW(hInstall, L"TARGETDIR", wpath, &size);
if (result != ERROR_SUCCESS)
return result;
wpath[size] = L'\0';
path[size] = L'\0';
attributes = GetFileAttributesW(wpath);
if (attributes == INVALID_FILE_ATTRIBUTES ||
!(attributes & FILE_ATTRIBUTE_DIRECTORY))
{
return MsiSetPropertyA(hInstall, "TargetExists", "0");
} else {
return MsiSetPropertyA(hInstall, "TargetExists", "1");
}
}
/* Update the state of the REGISTRY.tcl component according to the
* Extension and TclTk features. REGISTRY.tcl must be installed
* if both features are installed, and must be absent otherwise.
*/
UINT __declspec(dllexport) __stdcall UpdateEditIDLE(MSIHANDLE hInstall)
{
INSTALLSTATE ext_old, ext_new, tcl_old, tcl_new, reg_new;
UINT result;
result = MsiGetFeatureStateA(hInstall, "Extensions", &ext_old, &ext_new);
if (result != ERROR_SUCCESS)
return result;
result = MsiGetFeatureStateA(hInstall, "TclTk", &tcl_old, &tcl_new);
if (result != ERROR_SUCCESS)
return result;
/* If the current state is Absent, and the user did not select
the feature in the UI, Installer apparently sets the "selected"
state to unknown. Update it to the current value, then. */
if (ext_new == INSTALLSTATE_UNKNOWN)
ext_new = ext_old;
if (tcl_new == INSTALLSTATE_UNKNOWN)
tcl_new = tcl_old;
// XXX consider current state of REGISTRY.tcl?
if (((tcl_new == INSTALLSTATE_LOCAL) ||
(tcl_new == INSTALLSTATE_SOURCE) ||
(tcl_new == INSTALLSTATE_DEFAULT)) &&
((ext_new == INSTALLSTATE_LOCAL) ||
(ext_new == INSTALLSTATE_SOURCE) ||
(ext_new == INSTALLSTATE_DEFAULT))) {
reg_new = INSTALLSTATE_SOURCE;
} else {
reg_new = INSTALLSTATE_ABSENT;
}
result = MsiSetComponentStateA(hInstall, "REGISTRY.tcl", reg_new);
return result;
}
BOOL APIENTRY DllMain(HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved)
{
return TRUE;
}

View File

@@ -0,0 +1,9 @@
# /OPT: REF and ICF are added by VS.NET by default
msisupport.dll: msisupport.obj
link.exe /OUT:msisupport.dll /INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF msisupport.obj msi.lib kernel32.lib
# We request a static CRT, so that there will be no CRT dependencies
# for the target system. We cannot do without a CRT, since it provides
# the DLL entry point.
msisupport.obj: msisupport.c
cl /O2 /D WIN32 /D NDEBUG /D _WINDOWS /MT /W3 /c msisupport.c

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,126 @@
AdminExecuteSequence = [
(u'InstallInitialize', None, 1500),
(u'InstallFinalize', None, 6600),
(u'InstallFiles', None, 4000),
(u'InstallAdminPackage', None, 3900),
(u'FileCost', None, 900),
(u'CostInitialize', None, 800),
(u'CostFinalize', None, 1000),
(u'InstallValidate', None, 1400),
]
AdminUISequence = [
(u'FileCost', None, 900),
(u'CostInitialize', None, 800),
(u'CostFinalize', None, 1000),
(u'ExecuteAction', None, 1300),
(u'ExitDialog', None, -1),
(u'FatalError', None, -3),
(u'UserExit', None, -2),
]
AdvtExecuteSequence = [
(u'InstallInitialize', None, 1500),
(u'InstallFinalize', None, 6600),
(u'CostInitialize', None, 800),
(u'CostFinalize', None, 1000),
(u'InstallValidate', None, 1400),
(u'CreateShortcuts', None, 4500),
(u'MsiPublishAssemblies', None, 6250),
(u'PublishComponents', None, 6200),
(u'PublishFeatures', None, 6300),
(u'PublishProduct', None, 6400),
(u'RegisterClassInfo', None, 4600),
(u'RegisterExtensionInfo', None, 4700),
(u'RegisterMIMEInfo', None, 4900),
(u'RegisterProgIdInfo', None, 4800),
]
InstallExecuteSequence = [
(u'InstallInitialize', None, 1500),
(u'InstallFinalize', None, 6600),
(u'InstallFiles', None, 4000),
(u'FileCost', None, 900),
(u'CostInitialize', None, 800),
(u'CostFinalize', None, 1000),
(u'InstallValidate', None, 1400),
(u'CreateShortcuts', None, 4500),
(u'MsiPublishAssemblies', None, 6250),
(u'PublishComponents', None, 6200),
(u'PublishFeatures', None, 6300),
(u'PublishProduct', None, 6400),
(u'RegisterClassInfo', None, 4600),
(u'RegisterExtensionInfo', None, 4700),
(u'RegisterMIMEInfo', None, 4900),
(u'RegisterProgIdInfo', None, 4800),
(u'AllocateRegistrySpace', u'NOT Installed', 1550),
(u'AppSearch', None, 400),
(u'BindImage', None, 4300),
(u'CCPSearch', u'NOT Installed', 500),
(u'CreateFolders', None, 3700),
(u'DeleteServices', u'VersionNT', 2000),
(u'DuplicateFiles', None, 4210),
(u'FindRelatedProducts', None, 200),
(u'InstallODBC', None, 5400),
(u'InstallServices', u'VersionNT', 5800),
(u'IsolateComponents', None, 950),
(u'LaunchConditions', None, 100),
(u'MigrateFeatureStates', None, 1200),
(u'MoveFiles', None, 3800),
(u'PatchFiles', None, 4090),
(u'ProcessComponents', None, 1600),
(u'RegisterComPlus', None, 5700),
(u'RegisterFonts', None, 5300),
(u'RegisterProduct', None, 6100),
(u'RegisterTypeLibraries', None, 5500),
(u'RegisterUser', None, 6000),
(u'RemoveDuplicateFiles', None, 3400),
(u'RemoveEnvironmentStrings', None, 3300),
(u'RemoveExistingProducts', None, 6700),
(u'RemoveFiles', None, 3500),
(u'RemoveFolders', None, 3600),
(u'RemoveIniValues', None, 3100),
(u'RemoveODBC', None, 2400),
(u'RemoveRegistryValues', None, 2600),
(u'RemoveShortcuts', None, 3200),
(u'RMCCPSearch', u'NOT Installed', 600),
(u'SelfRegModules', None, 5600),
(u'SelfUnregModules', None, 2200),
(u'SetODBCFolders', None, 1100),
(u'StartServices', u'VersionNT', 5900),
(u'StopServices', u'VersionNT', 1900),
(u'MsiUnpublishAssemblies', None, 1750),
(u'UnpublishComponents', None, 1700),
(u'UnpublishFeatures', None, 1800),
(u'UnregisterClassInfo', None, 2700),
(u'UnregisterComPlus', None, 2100),
(u'UnregisterExtensionInfo', None, 2800),
(u'UnregisterFonts', None, 2500),
(u'UnregisterMIMEInfo', None, 3000),
(u'UnregisterProgIdInfo', None, 2900),
(u'UnregisterTypeLibraries', None, 2300),
(u'ValidateProductID', None, 700),
(u'WriteEnvironmentStrings', None, 5200),
(u'WriteIniValues', None, 5100),
(u'WriteRegistryValues', None, 5000),
]
InstallUISequence = [
(u'FileCost', None, 900),
(u'CostInitialize', None, 800),
(u'CostFinalize', None, 1000),
(u'ExecuteAction', None, 1300),
(u'ExitDialog', None, -1),
(u'FatalError', None, -3),
(u'UserExit', None, -2),
(u'AppSearch', None, 400),
(u'CCPSearch', u'NOT Installed', 500),
(u'FindRelatedProducts', None, 200),
(u'IsolateComponents', None, 950),
(u'LaunchConditions', None, 100),
(u'MigrateFeatureStates', None, 1200),
(u'RMCCPSearch', u'NOT Installed', 600),
(u'ValidateProductID', None, 700),
]
tables=['AdminExecuteSequence', 'AdminUISequence', 'AdvtExecuteSequence', 'InstallExecuteSequence', 'InstallUISequence']

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,58 @@
# This should be extended for each Python release.
# The product code must change whenever the name of the MSI file
# changes, and when new component codes are issued for existing
# components. See "Changing the Product Code". As we change the
# component codes with every build, we need a new product code
# each time. For intermediate (snapshot) releases, they are automatically
# generated. For official releases, we record the product codes,
# so people can refer to them.
product_codes = {
'2.5.101': '{bc14ce3e-5e72-4a64-ac1f-bf59a571898c}', # 2.5a1
'2.5.102': '{5eed51c1-8e9d-4071-94c5-b40de5d49ba5}', # 2.5a2
'2.5.103': '{73dcd966-ffec-415f-bb39-8342c1f47017}', # 2.5a3
'2.5.111': '{c797ecf8-a8e6-4fec-bb99-526b65f28626}', # 2.5b1
'2.5.112': '{32beb774-f625-439d-b587-7187487baf15}', # 2.5b2
'2.5.113': '{89f23918-11cf-4f08-be13-b9b2e6463fd9}', # 2.5b3
'2.5.121': '{8e9321bc-6b24-48a3-8fd4-c95f8e531e5f}', # 2.5c1
'2.5.122': '{a6cd508d-9599-45da-a441-cbffa9f7e070}', # 2.5c2
'2.5.150': '{0a2c5854-557e-48c8-835a-3b9f074bdcaa}', # 2.5.0
'2.5.1121':'{0378b43e-6184-4c2f-be1a-4a367781cd54}', # 2.5.1c1
'2.5.1150':'{31800004-6386-4999-a519-518f2d78d8f0}', # 2.5.1
'2.5.2150':'{6304a7da-1132-4e91-a343-a296269eab8a}', # 2.5.2c1
'2.5.2150':'{6b976adf-8ae8-434e-b282-a06c7f624d2f}', # 2.5.2
'2.6.101': '{0ba82e1b-52fd-4e03-8610-a6c76238e8a8}', # 2.6a1
'2.6.102': '{3b27e16c-56db-4570-a2d3-e9a26180c60b}', # 2.6a2
'2.6.103': '{cd06a9c5-bde5-4bd7-9874-48933997122a}', # 2.6a3
'2.6.104': '{dc6ed634-474a-4a50-a547-8de4b7491e53}', # 2.6a4
'2.6.111': '{3f82079a-5bee-4c4a-8a41-8292389e24ae}', # 2.6b1
'2.6.112': '{8a0e5970-f3e6-4737-9a2b-bc5ff0f15fb5}', # 2.6b2
'2.6.113': '{df4f5c21-6fcc-4540-95de-85feba634e76}', # 2.6b3
'2.6.121': '{bbd34464-ddeb-4028-99e5-f16c4a8fbdb3}', # 2.6c1
'2.6.122': '{8f64787e-a023-4c60-bfee-25d3a3f592c6}', # 2.6c2
'2.6.150': '{110eb5c4-e995-4cfb-ab80-a5f315bea9e8}', # 2.6.0
'2.6.1150':'{9cc89170-000b-457d-91f1-53691f85b223}', # 2.6.1
'2.6.2121':'{adac412b-b209-4c15-b6ab-dca1b6e47144}', # 2.6.2c1
'2.6.2150':'{24aab420-4e30-4496-9739-3e216f3de6ae}', # 2.6.2
'2.6.3121':'{a73e0254-dcda-4fe4-bf37-c7e1c4f4ebb6}', # 2.6.3c1
'2.6.3150':'{3d9ac095-e115-4e94-bdef-7f7edf17697d}', # 2.6.3
'2.6.4121':'{727de605-0359-4606-a94b-c2033652379b}', # 2.6.4c1
'2.6.4122':'{4f7603c6-6352-4299-a398-150a31b19acc}', # 2.6.4c2
'2.6.4150':'{e7394a0f-3f80-45b1-87fc-abcd51893246}', # 2.6.4
'2.6.5121':'{e0e273d7-7598-4701-8325-c90c069fd5ff}', # 2.6.5c1
'2.6.5122':'{fa227b76-0671-4dc6-b826-c2ff2a70dfd5}', # 2.6.5c2
'2.6.5150':'{4723f199-fa64-4233-8e6e-9fccc95a18ee}', # 2.6.5
'2.7.101': '{eca1bbef-432c-49ae-a667-c213cc7bbf22}', # 2.7a1
'2.7.102': '{21ce16ed-73c4-460d-9b11-522f417b2090}', # 2.7a2
'2.7.103': '{6e7dbd55-ba4a-48ac-a688-6c75db4d7500}', # 2.7a3
'2.7.104': '{ee774ba3-74a5-48d9-b425-b35a287260c8}', # 2.7a4
'2.7.111': '{9cfd9ec7-a9c7-4980-a1c6-054fc6493eb3}', # 2.7b1
'2.7.112': '{9a72faf6-c304-4165-8595-9291ff30cac6}', # 2.7b2
'2.7.121': '{f530c94a-dd53-4de9-948e-b632b9cb48d2}', # 2.7c1
'2.7.122': '{f80905d2-dd8d-4b8e-8a40-c23c93dca07d}', # 2.7c2
'2.7.150': '{20c31435-2a0a-4580-be8b-ac06fc243ca4}', # 2.7.0
'2.7.1121':'{60a4036a-374c-4fd2-84b9-bfae7db03931}', # 2.7.1rc1
'2.7.1122':'{5965e7d1-5584-4de9-b13a-694e0b2ee3a6}', # 2.7.1rc2
'2.7.1150':'{32939827-d8e5-470a-b126-870db3c69fdf}', # 2.7.1
'2.7.2121':'{B2E1F06E-F719-4786-972A-488A336EB2A0}', # 2.7.2rc1
'2.7.2150':'{2E295B5B-1AD4-4d36-97C2-A316084722CF}', # 2.7.2
}