2007-08-15 11:28:22 -03:00
|
|
|
:mod:`msilib` --- Read and write Microsoft Installer files
|
|
|
|
==========================================================
|
|
|
|
|
|
|
|
.. module:: msilib
|
|
|
|
:platform: Windows
|
|
|
|
:synopsis: Creation of Microsoft Installer files, and CAB files.
|
2016-06-11 16:02:54 -03:00
|
|
|
|
2007-08-15 11:28:22 -03:00
|
|
|
.. moduleauthor:: Martin v. Löwis <martin@v.loewis.de>
|
|
|
|
.. sectionauthor:: Martin v. Löwis <martin@v.loewis.de>
|
|
|
|
|
2016-06-11 16:02:54 -03:00
|
|
|
**Source code:** :source:`Lib/msilib/__init__.py`
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. index:: single: msi
|
|
|
|
|
2016-06-11 16:02:54 -03:00
|
|
|
--------------
|
|
|
|
|
2007-08-15 11:28:22 -03:00
|
|
|
The :mod:`msilib` supports the creation of Microsoft Installer (``.msi``) files.
|
|
|
|
Because these files often contain an embedded "cabinet" file (``.cab``), it also
|
|
|
|
exposes an API to create CAB files. Support for reading ``.cab`` files is
|
|
|
|
currently not implemented; read support for the ``.msi`` database is possible.
|
|
|
|
|
|
|
|
This package aims to provide complete access to all tables in an ``.msi`` file,
|
2021-09-07 07:34:27 -03:00
|
|
|
therefore, it is a fairly low-level API. One primary application of this
|
|
|
|
package is the creation of Python installer package itself (although that currently
|
|
|
|
uses a different version of ``msilib``).
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
The package contents can be roughly split into four parts: low-level CAB
|
|
|
|
routines, low-level MSI routines, higher-level MSI routines, and standard table
|
|
|
|
structures.
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: FCICreate(cabname, files)
|
|
|
|
|
|
|
|
Create a new CAB file named *cabname*. *files* must be a list of tuples, each
|
|
|
|
containing the name of the file on disk, and the name of the file inside the CAB
|
|
|
|
file.
|
|
|
|
|
|
|
|
The files are added to the CAB file in the order they appear in the list. All
|
|
|
|
files are added into a single CAB file, using the MSZIP compression algorithm.
|
|
|
|
|
|
|
|
Callbacks to Python for the various steps of MSI creation are currently not
|
|
|
|
exposed.
|
|
|
|
|
|
|
|
|
Merged revisions 59703-59773 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59704 | christian.heimes | 2008-01-04 04:15:05 +0100 (Fri, 04 Jan 2008) | 1 line
Moved include "Python.h" in front of other imports to silence a warning.
........
r59706 | raymond.hettinger | 2008-01-04 04:22:53 +0100 (Fri, 04 Jan 2008) | 10 lines
Minor fix-ups to named tuples:
* Make the _replace() method respect subclassing.
* Using property() to make _fields read-only wasn't a good idea.
It caused len(Point._fields) to fail.
* Add note to _cast() about length checking and alternative with the star-operator.
........
r59707 | jeffrey.yasskin | 2008-01-04 09:01:23 +0100 (Fri, 04 Jan 2008) | 3 lines
Make math.{floor,ceil}({int,long}) return float again for backwards
compatibility after r59671 made them return integral types.
........
r59709 | christian.heimes | 2008-01-04 14:21:07 +0100 (Fri, 04 Jan 2008) | 1 line
Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a mountpoint.
........
r59712 | lars.gustaebel | 2008-01-04 15:00:33 +0100 (Fri, 04 Jan 2008) | 5 lines
Issue #1735: TarFile.extractall() now correctly sets
directory permissions and times.
(will backport to 2.5)
........
r59714 | andrew.kuchling | 2008-01-04 15:47:17 +0100 (Fri, 04 Jan 2008) | 1 line
Update links to bug/patch tracker
........
r59716 | christian.heimes | 2008-01-04 16:23:30 +0100 (Fri, 04 Jan 2008) | 1 line
Added interface to Windows' WSAIoctl and a simple example for a network sniffer.
........
r59717 | christian.heimes | 2008-01-04 16:29:00 +0100 (Fri, 04 Jan 2008) | 1 line
And here is the rest of Hirokazu Yamamoto's patch for VS6.0 support. Thanks Hiro!
........
r59719 | christian.heimes | 2008-01-04 16:34:06 +0100 (Fri, 04 Jan 2008) | 1 line
Reverted last transaction. It's the wrong branch.
........
r59721 | christian.heimes | 2008-01-04 16:48:06 +0100 (Fri, 04 Jan 2008) | 1 line
socket.ioctl is only available on Windows
........
r59722 | andrew.kuchling | 2008-01-04 19:24:41 +0100 (Fri, 04 Jan 2008) | 1 line
Fix markup
........
r59723 | andrew.kuchling | 2008-01-04 19:25:05 +0100 (Fri, 04 Jan 2008) | 1 line
Fix markup
........
r59725 | guido.van.rossum | 2008-01-05 01:59:59 +0100 (Sat, 05 Jan 2008) | 3 lines
Patch #1725 by Mark Dickinson, fixes incorrect conversion of -1e1000
and adds errors for -0x.
........
r59726 | guido.van.rossum | 2008-01-05 02:21:57 +0100 (Sat, 05 Jan 2008) | 2 lines
Patch #1698 by Senthil: allow '@' in username when parsed by urlparse.py.
........
r59727 | raymond.hettinger | 2008-01-05 02:35:43 +0100 (Sat, 05 Jan 2008) | 1 line
Improve namedtuple's _cast() method with a docstring, new name, and error-checking.
........
r59728 | raymond.hettinger | 2008-01-05 03:17:24 +0100 (Sat, 05 Jan 2008) | 1 line
Add error-checking to namedtuple's _replace() method.
........
r59730 | fred.drake | 2008-01-05 05:38:38 +0100 (Sat, 05 Jan 2008) | 2 lines
clean up a comment
........
r59731 | jeffrey.yasskin | 2008-01-05 09:47:13 +0100 (Sat, 05 Jan 2008) | 11 lines
Continue rolling back pep-3141 changes that changed behavior from 2.5. This
round included:
* Revert round to its 2.6 behavior (half away from 0).
* Because round, floor, and ceil always return float again, it's no
longer necessary to have them delegate to __xxx___, so I've ripped
that out of their implementations and the Real ABC. This also helps
in implementing types that work in both 2.6 and 3.0: you return int
from the __xxx__ methods, and let it get enabled by the version
upgrade.
* Make pow(-1, .5) raise a ValueError again.
........
r59736 | andrew.kuchling | 2008-01-05 16:13:49 +0100 (Sat, 05 Jan 2008) | 1 line
Fix comment typo
........
r59738 | thomas.heller | 2008-01-05 18:15:44 +0100 (Sat, 05 Jan 2008) | 1 line
Add myself.
........
r59739 | georg.brandl | 2008-01-05 18:49:17 +0100 (Sat, 05 Jan 2008) | 2 lines
Fix C++-style comment.
........
r59742 | georg.brandl | 2008-01-05 20:28:16 +0100 (Sat, 05 Jan 2008) | 2 lines
Remove with_statement future imports from 2.6 docs.
........
r59743 | georg.brandl | 2008-01-05 20:29:45 +0100 (Sat, 05 Jan 2008) | 2 lines
Simplify index entries; fix #1712.
........
r59744 | georg.brandl | 2008-01-05 20:44:22 +0100 (Sat, 05 Jan 2008) | 2 lines
Doc patch #1730 from Robin Stocker; minor corrections mostly to os.rst.
........
r59749 | georg.brandl | 2008-01-05 21:29:13 +0100 (Sat, 05 Jan 2008) | 2 lines
Revert socket.rst to unix-eol.
........
r59750 | georg.brandl | 2008-01-05 21:33:46 +0100 (Sat, 05 Jan 2008) | 2 lines
Set native svn:eol-style property for text files.
........
r59752 | georg.brandl | 2008-01-05 21:46:29 +0100 (Sat, 05 Jan 2008) | 2 lines
#1719: capitalization error in "UuidCreate".
........
r59753 | georg.brandl | 2008-01-05 22:02:25 +0100 (Sat, 05 Jan 2008) | 2 lines
Repair markup.
........
r59754 | georg.brandl | 2008-01-05 22:10:50 +0100 (Sat, 05 Jan 2008) | 2 lines
Use markup.
........
r59757 | christian.heimes | 2008-01-05 22:35:52 +0100 (Sat, 05 Jan 2008) | 1 line
Final adjustments for #1601
........
r59758 | guido.van.rossum | 2008-01-05 23:19:06 +0100 (Sat, 05 Jan 2008) | 3 lines
Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.
Fix by John Nagle.
........
r59759 | guido.van.rossum | 2008-01-05 23:20:01 +0100 (Sat, 05 Jan 2008) | 2 lines
Add John Nagle (of issue #1637).
........
r59765 | raymond.hettinger | 2008-01-06 10:02:24 +0100 (Sun, 06 Jan 2008) | 1 line
Small code simplification. Forgot that classmethods can be called from intances.
........
r59766 | martin.v.loewis | 2008-01-06 11:09:48 +0100 (Sun, 06 Jan 2008) | 2 lines
Use vcbuild for VS 2009.
........
r59767 | martin.v.loewis | 2008-01-06 12:03:43 +0100 (Sun, 06 Jan 2008) | 2 lines
Package using VS 2008.
........
r59768 | martin.v.loewis | 2008-01-06 12:13:16 +0100 (Sun, 06 Jan 2008) | 2 lines
Don't try to package msvcr90 for the moment.
........
r59769 | georg.brandl | 2008-01-06 15:17:36 +0100 (Sun, 06 Jan 2008) | 4 lines
#1696393: don't check for '.' and '..' in ntpath.walk since
they aren't returned from os.listdir anymore.
Reported by Michael Haggerty.
........
r59770 | georg.brandl | 2008-01-06 15:27:15 +0100 (Sun, 06 Jan 2008) | 3 lines
#1742: don't raise exception on os.path.relpath("a", "a"), but return os.curdir.
Reported by Jesse Towner.
........
r59771 | georg.brandl | 2008-01-06 15:33:52 +0100 (Sun, 06 Jan 2008) | 2 lines
#1591: Clarify docstring of Popen3.
........
r59772 | georg.brandl | 2008-01-06 16:30:34 +0100 (Sun, 06 Jan 2008) | 2 lines
#1680: fix context manager example function name.
........
r59773 | georg.brandl | 2008-01-06 16:34:57 +0100 (Sun, 06 Jan 2008) | 2 lines
#1755097: document default values for [].sort() and sorted().
........
2008-01-06 12:59:19 -04:00
|
|
|
.. function:: UuidCreate()
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
Return the string representation of a new unique identifier. This wraps the
|
2010-10-06 07:11:56 -03:00
|
|
|
Windows API functions :c:func:`UuidCreate` and :c:func:`UuidToString`.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. function:: OpenDatabase(path, persist)
|
|
|
|
|
|
|
|
Return a new database object by calling MsiOpenDatabase. *path* is the file
|
|
|
|
name of the MSI file; *persist* can be one of the constants
|
|
|
|
``MSIDBOPEN_CREATEDIRECT``, ``MSIDBOPEN_CREATE``, ``MSIDBOPEN_DIRECT``,
|
|
|
|
``MSIDBOPEN_READONLY``, or ``MSIDBOPEN_TRANSACT``, and may include the flag
|
|
|
|
``MSIDBOPEN_PATCHFILE``. See the Microsoft documentation for the meaning of
|
|
|
|
these flags; depending on the flags, an existing database is opened, or a new
|
|
|
|
one created.
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: CreateRecord(count)
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Return a new record object by calling :c:func:`MSICreateRecord`. *count* is the
|
2007-08-15 11:28:22 -03:00
|
|
|
number of fields of the record.
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: init_database(name, schema, ProductName, ProductCode, ProductVersion, Manufacturer)
|
|
|
|
|
Merged revisions 61003-61033 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r61004 | georg.brandl | 2008-02-23 19:47:04 +0100 (Sat, 23 Feb 2008) | 2 lines
Documentation coverage builder, part 1.
........
r61006 | andrew.kuchling | 2008-02-23 20:02:33 +0100 (Sat, 23 Feb 2008) | 1 line
#1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik Lundh.
........
r61008 | andrew.kuchling | 2008-02-23 20:28:58 +0100 (Sat, 23 Feb 2008) | 1 line
#1389051, #1092502: fix excessively large allocations when using read() on a socket
........
r61011 | jeffrey.yasskin | 2008-02-23 20:40:54 +0100 (Sat, 23 Feb 2008) | 13 lines
Prevent classes like:
class RunSelfFunction(object):
def __init__(self):
self.thread = threading.Thread(target=self._run)
self.thread.start()
def _run(self):
pass
from creating a permanent cycle between the object and the thread by having the
Thread delete its references to the object when it completes.
As an example of the effect of this bug, paramiko.Transport inherits from
Thread to avoid it.
........
r61013 | jeffrey.yasskin | 2008-02-23 21:40:35 +0100 (Sat, 23 Feb 2008) | 3 lines
Followup to r61011: Also avoid the reference cycle when the Thread's target
raises an exception.
........
r61017 | georg.brandl | 2008-02-23 22:59:11 +0100 (Sat, 23 Feb 2008) | 2 lines
#2101: fix removeAttribute docs.
........
r61018 | georg.brandl | 2008-02-23 23:05:38 +0100 (Sat, 23 Feb 2008) | 2 lines
Add examples to modulefinder docs. Written for GHOP by Josip Dzolonga.
........
r61019 | georg.brandl | 2008-02-23 23:09:24 +0100 (Sat, 23 Feb 2008) | 2 lines
Use os.closerange() in popen2.
........
r61020 | georg.brandl | 2008-02-23 23:14:02 +0100 (Sat, 23 Feb 2008) | 2 lines
Use os.closerange().
........
r61021 | georg.brandl | 2008-02-23 23:35:33 +0100 (Sat, 23 Feb 2008) | 3 lines
In test_heapq and test_bisect, test both the Python and the C implementation.
Originally written for GHOP by Josip Dzolonga, heavily patched by me.
........
r61024 | facundo.batista | 2008-02-23 23:54:12 +0100 (Sat, 23 Feb 2008) | 3 lines
Added simple test case. Thanks Benjamin Peterson.
........
r61025 | georg.brandl | 2008-02-23 23:55:18 +0100 (Sat, 23 Feb 2008) | 2 lines
#1825: correctly document msilib.add_data.
........
r61027 | georg.brandl | 2008-02-24 00:02:23 +0100 (Sun, 24 Feb 2008) | 2 lines
#1826: allow dotted attribute paths in operator.attrgetter.
........
r61028 | georg.brandl | 2008-02-24 00:04:35 +0100 (Sun, 24 Feb 2008) | 2 lines
#1506171: added operator.methodcaller().
........
r61029 | georg.brandl | 2008-02-24 00:25:26 +0100 (Sun, 24 Feb 2008) | 2 lines
Document import ./. threading issues. #1720705.
........
r61032 | georg.brandl | 2008-02-24 00:43:01 +0100 (Sun, 24 Feb 2008) | 2 lines
Specify what kind of warning -3 emits.
........
r61033 | christian.heimes | 2008-02-24 00:59:45 +0100 (Sun, 24 Feb 2008) | 1 line
MS Windows doesn't have mode_t but stat.st_mode is defined as unsigned short.
........
2008-02-23 20:38:49 -04:00
|
|
|
Create and return a new database *name*, initialize it with *schema*, and set
|
2007-08-15 11:28:22 -03:00
|
|
|
the properties *ProductName*, *ProductCode*, *ProductVersion*, and
|
|
|
|
*Manufacturer*.
|
|
|
|
|
|
|
|
*schema* must be a module object containing ``tables`` and
|
|
|
|
``_Validation_records`` attributes; typically, :mod:`msilib.schema` should be
|
|
|
|
used.
|
|
|
|
|
|
|
|
The database will contain just the schema and the validation records when this
|
|
|
|
function returns.
|
|
|
|
|
|
|
|
|
Merged revisions 61003-61033 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r61004 | georg.brandl | 2008-02-23 19:47:04 +0100 (Sat, 23 Feb 2008) | 2 lines
Documentation coverage builder, part 1.
........
r61006 | andrew.kuchling | 2008-02-23 20:02:33 +0100 (Sat, 23 Feb 2008) | 1 line
#1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik Lundh.
........
r61008 | andrew.kuchling | 2008-02-23 20:28:58 +0100 (Sat, 23 Feb 2008) | 1 line
#1389051, #1092502: fix excessively large allocations when using read() on a socket
........
r61011 | jeffrey.yasskin | 2008-02-23 20:40:54 +0100 (Sat, 23 Feb 2008) | 13 lines
Prevent classes like:
class RunSelfFunction(object):
def __init__(self):
self.thread = threading.Thread(target=self._run)
self.thread.start()
def _run(self):
pass
from creating a permanent cycle between the object and the thread by having the
Thread delete its references to the object when it completes.
As an example of the effect of this bug, paramiko.Transport inherits from
Thread to avoid it.
........
r61013 | jeffrey.yasskin | 2008-02-23 21:40:35 +0100 (Sat, 23 Feb 2008) | 3 lines
Followup to r61011: Also avoid the reference cycle when the Thread's target
raises an exception.
........
r61017 | georg.brandl | 2008-02-23 22:59:11 +0100 (Sat, 23 Feb 2008) | 2 lines
#2101: fix removeAttribute docs.
........
r61018 | georg.brandl | 2008-02-23 23:05:38 +0100 (Sat, 23 Feb 2008) | 2 lines
Add examples to modulefinder docs. Written for GHOP by Josip Dzolonga.
........
r61019 | georg.brandl | 2008-02-23 23:09:24 +0100 (Sat, 23 Feb 2008) | 2 lines
Use os.closerange() in popen2.
........
r61020 | georg.brandl | 2008-02-23 23:14:02 +0100 (Sat, 23 Feb 2008) | 2 lines
Use os.closerange().
........
r61021 | georg.brandl | 2008-02-23 23:35:33 +0100 (Sat, 23 Feb 2008) | 3 lines
In test_heapq and test_bisect, test both the Python and the C implementation.
Originally written for GHOP by Josip Dzolonga, heavily patched by me.
........
r61024 | facundo.batista | 2008-02-23 23:54:12 +0100 (Sat, 23 Feb 2008) | 3 lines
Added simple test case. Thanks Benjamin Peterson.
........
r61025 | georg.brandl | 2008-02-23 23:55:18 +0100 (Sat, 23 Feb 2008) | 2 lines
#1825: correctly document msilib.add_data.
........
r61027 | georg.brandl | 2008-02-24 00:02:23 +0100 (Sun, 24 Feb 2008) | 2 lines
#1826: allow dotted attribute paths in operator.attrgetter.
........
r61028 | georg.brandl | 2008-02-24 00:04:35 +0100 (Sun, 24 Feb 2008) | 2 lines
#1506171: added operator.methodcaller().
........
r61029 | georg.brandl | 2008-02-24 00:25:26 +0100 (Sun, 24 Feb 2008) | 2 lines
Document import ./. threading issues. #1720705.
........
r61032 | georg.brandl | 2008-02-24 00:43:01 +0100 (Sun, 24 Feb 2008) | 2 lines
Specify what kind of warning -3 emits.
........
r61033 | christian.heimes | 2008-02-24 00:59:45 +0100 (Sun, 24 Feb 2008) | 1 line
MS Windows doesn't have mode_t but stat.st_mode is defined as unsigned short.
........
2008-02-23 20:38:49 -04:00
|
|
|
.. function:: add_data(database, table, records)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
Merged revisions 61003-61033 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r61004 | georg.brandl | 2008-02-23 19:47:04 +0100 (Sat, 23 Feb 2008) | 2 lines
Documentation coverage builder, part 1.
........
r61006 | andrew.kuchling | 2008-02-23 20:02:33 +0100 (Sat, 23 Feb 2008) | 1 line
#1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik Lundh.
........
r61008 | andrew.kuchling | 2008-02-23 20:28:58 +0100 (Sat, 23 Feb 2008) | 1 line
#1389051, #1092502: fix excessively large allocations when using read() on a socket
........
r61011 | jeffrey.yasskin | 2008-02-23 20:40:54 +0100 (Sat, 23 Feb 2008) | 13 lines
Prevent classes like:
class RunSelfFunction(object):
def __init__(self):
self.thread = threading.Thread(target=self._run)
self.thread.start()
def _run(self):
pass
from creating a permanent cycle between the object and the thread by having the
Thread delete its references to the object when it completes.
As an example of the effect of this bug, paramiko.Transport inherits from
Thread to avoid it.
........
r61013 | jeffrey.yasskin | 2008-02-23 21:40:35 +0100 (Sat, 23 Feb 2008) | 3 lines
Followup to r61011: Also avoid the reference cycle when the Thread's target
raises an exception.
........
r61017 | georg.brandl | 2008-02-23 22:59:11 +0100 (Sat, 23 Feb 2008) | 2 lines
#2101: fix removeAttribute docs.
........
r61018 | georg.brandl | 2008-02-23 23:05:38 +0100 (Sat, 23 Feb 2008) | 2 lines
Add examples to modulefinder docs. Written for GHOP by Josip Dzolonga.
........
r61019 | georg.brandl | 2008-02-23 23:09:24 +0100 (Sat, 23 Feb 2008) | 2 lines
Use os.closerange() in popen2.
........
r61020 | georg.brandl | 2008-02-23 23:14:02 +0100 (Sat, 23 Feb 2008) | 2 lines
Use os.closerange().
........
r61021 | georg.brandl | 2008-02-23 23:35:33 +0100 (Sat, 23 Feb 2008) | 3 lines
In test_heapq and test_bisect, test both the Python and the C implementation.
Originally written for GHOP by Josip Dzolonga, heavily patched by me.
........
r61024 | facundo.batista | 2008-02-23 23:54:12 +0100 (Sat, 23 Feb 2008) | 3 lines
Added simple test case. Thanks Benjamin Peterson.
........
r61025 | georg.brandl | 2008-02-23 23:55:18 +0100 (Sat, 23 Feb 2008) | 2 lines
#1825: correctly document msilib.add_data.
........
r61027 | georg.brandl | 2008-02-24 00:02:23 +0100 (Sun, 24 Feb 2008) | 2 lines
#1826: allow dotted attribute paths in operator.attrgetter.
........
r61028 | georg.brandl | 2008-02-24 00:04:35 +0100 (Sun, 24 Feb 2008) | 2 lines
#1506171: added operator.methodcaller().
........
r61029 | georg.brandl | 2008-02-24 00:25:26 +0100 (Sun, 24 Feb 2008) | 2 lines
Document import ./. threading issues. #1720705.
........
r61032 | georg.brandl | 2008-02-24 00:43:01 +0100 (Sun, 24 Feb 2008) | 2 lines
Specify what kind of warning -3 emits.
........
r61033 | christian.heimes | 2008-02-24 00:59:45 +0100 (Sun, 24 Feb 2008) | 1 line
MS Windows doesn't have mode_t but stat.st_mode is defined as unsigned short.
........
2008-02-23 20:38:49 -04:00
|
|
|
Add all *records* to the table named *table* in *database*.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
Merged revisions 61003-61033 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r61004 | georg.brandl | 2008-02-23 19:47:04 +0100 (Sat, 23 Feb 2008) | 2 lines
Documentation coverage builder, part 1.
........
r61006 | andrew.kuchling | 2008-02-23 20:02:33 +0100 (Sat, 23 Feb 2008) | 1 line
#1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik Lundh.
........
r61008 | andrew.kuchling | 2008-02-23 20:28:58 +0100 (Sat, 23 Feb 2008) | 1 line
#1389051, #1092502: fix excessively large allocations when using read() on a socket
........
r61011 | jeffrey.yasskin | 2008-02-23 20:40:54 +0100 (Sat, 23 Feb 2008) | 13 lines
Prevent classes like:
class RunSelfFunction(object):
def __init__(self):
self.thread = threading.Thread(target=self._run)
self.thread.start()
def _run(self):
pass
from creating a permanent cycle between the object and the thread by having the
Thread delete its references to the object when it completes.
As an example of the effect of this bug, paramiko.Transport inherits from
Thread to avoid it.
........
r61013 | jeffrey.yasskin | 2008-02-23 21:40:35 +0100 (Sat, 23 Feb 2008) | 3 lines
Followup to r61011: Also avoid the reference cycle when the Thread's target
raises an exception.
........
r61017 | georg.brandl | 2008-02-23 22:59:11 +0100 (Sat, 23 Feb 2008) | 2 lines
#2101: fix removeAttribute docs.
........
r61018 | georg.brandl | 2008-02-23 23:05:38 +0100 (Sat, 23 Feb 2008) | 2 lines
Add examples to modulefinder docs. Written for GHOP by Josip Dzolonga.
........
r61019 | georg.brandl | 2008-02-23 23:09:24 +0100 (Sat, 23 Feb 2008) | 2 lines
Use os.closerange() in popen2.
........
r61020 | georg.brandl | 2008-02-23 23:14:02 +0100 (Sat, 23 Feb 2008) | 2 lines
Use os.closerange().
........
r61021 | georg.brandl | 2008-02-23 23:35:33 +0100 (Sat, 23 Feb 2008) | 3 lines
In test_heapq and test_bisect, test both the Python and the C implementation.
Originally written for GHOP by Josip Dzolonga, heavily patched by me.
........
r61024 | facundo.batista | 2008-02-23 23:54:12 +0100 (Sat, 23 Feb 2008) | 3 lines
Added simple test case. Thanks Benjamin Peterson.
........
r61025 | georg.brandl | 2008-02-23 23:55:18 +0100 (Sat, 23 Feb 2008) | 2 lines
#1825: correctly document msilib.add_data.
........
r61027 | georg.brandl | 2008-02-24 00:02:23 +0100 (Sun, 24 Feb 2008) | 2 lines
#1826: allow dotted attribute paths in operator.attrgetter.
........
r61028 | georg.brandl | 2008-02-24 00:04:35 +0100 (Sun, 24 Feb 2008) | 2 lines
#1506171: added operator.methodcaller().
........
r61029 | georg.brandl | 2008-02-24 00:25:26 +0100 (Sun, 24 Feb 2008) | 2 lines
Document import ./. threading issues. #1720705.
........
r61032 | georg.brandl | 2008-02-24 00:43:01 +0100 (Sun, 24 Feb 2008) | 2 lines
Specify what kind of warning -3 emits.
........
r61033 | christian.heimes | 2008-02-24 00:59:45 +0100 (Sun, 24 Feb 2008) | 1 line
MS Windows doesn't have mode_t but stat.st_mode is defined as unsigned short.
........
2008-02-23 20:38:49 -04:00
|
|
|
The *table* argument must be one of the predefined tables in the MSI schema,
|
|
|
|
e.g. ``'Feature'``, ``'File'``, ``'Component'``, ``'Dialog'``, ``'Control'``,
|
|
|
|
etc.
|
|
|
|
|
|
|
|
*records* should be a list of tuples, each one containing all fields of a
|
|
|
|
record according to the schema of the table. For optional fields,
|
|
|
|
``None`` can be passed.
|
|
|
|
|
2013-08-27 13:40:23 -03:00
|
|
|
Field values can be ints, strings, or instances of the Binary class.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. class:: Binary(filename)
|
|
|
|
|
|
|
|
Represents entries in the Binary table; inserting such an object using
|
|
|
|
:func:`add_data` reads the file named *filename* into the table.
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: add_tables(database, module)
|
|
|
|
|
|
|
|
Add all table content from *module* to *database*. *module* must contain an
|
|
|
|
attribute *tables* listing all tables for which content should be added, and one
|
|
|
|
attribute per table that has the actual content.
|
|
|
|
|
|
|
|
This is typically used to install the sequence tables.
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: add_stream(database, name, path)
|
|
|
|
|
|
|
|
Add the file *path* into the ``_Stream`` table of *database*, with the stream
|
|
|
|
name *name*.
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: gen_uuid()
|
|
|
|
|
|
|
|
Return a new UUID, in the format that MSI typically requires (i.e. in curly
|
2021-05-28 17:54:25 -03:00
|
|
|
braces, and with all hexdigits in uppercase).
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-11-14 19:06:15 -04:00
|
|
|
`FCICreate <https://msdn.microsoft.com/en-us/library/bb432265.aspx>`_
|
|
|
|
`UuidCreate <https://msdn.microsoft.com/en-us/library/windows/desktop/aa379205.aspx>`_
|
|
|
|
`UuidToString <https://msdn.microsoft.com/en-us/library/windows/desktop/aa379352.aspx>`_
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. _database-objects:
|
|
|
|
|
|
|
|
Database Objects
|
|
|
|
----------------
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: Database.OpenView(sql)
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the SQL
|
2007-08-15 11:28:22 -03:00
|
|
|
statement to execute.
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: Database.Commit()
|
|
|
|
|
|
|
|
Commit the changes pending in the current transaction, by calling
|
2010-10-06 07:11:56 -03:00
|
|
|
:c:func:`MSIDatabaseCommit`.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. method:: Database.GetSummaryInformation(count)
|
|
|
|
|
|
|
|
Return a new summary information object, by calling
|
2010-10-06 07:11:56 -03:00
|
|
|
:c:func:`MsiGetSummaryInformation`. *count* is the maximum number of updated
|
2007-08-15 11:28:22 -03:00
|
|
|
values.
|
|
|
|
|
2017-11-07 08:58:53 -04:00
|
|
|
.. method:: Database.Close()
|
|
|
|
|
|
|
|
Close the database object, through :c:func:`MsiCloseHandle`.
|
|
|
|
|
|
|
|
.. versionadded:: 3.7
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-11-14 19:06:15 -04:00
|
|
|
`MSIDatabaseOpenView <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370082.aspx>`_
|
|
|
|
`MSIDatabaseCommit <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370075.aspx>`_
|
|
|
|
`MSIGetSummaryInformation <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370301.aspx>`_
|
|
|
|
`MsiCloseHandle <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370067.aspx>`_
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. _view-objects:
|
|
|
|
|
|
|
|
View Objects
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
Merged revisions 64475,64544-64545,64550,64557-64558,64565,64570,64577,64582-64583,64585,64590,64592-64593,64625,64630,64638,64647,64655-64656,64663-64664 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r64475 | raymond.hettinger | 2008-06-22 22:29:28 -0500 (Sun, 22 Jun 2008) | 1 line
Issue 3161: Missing import and test.
........
r64544 | georg.brandl | 2008-06-26 16:12:55 -0500 (Thu, 26 Jun 2008) | 2 lines
Use newer versions of externals.
........
r64545 | benjamin.peterson | 2008-06-26 16:23:30 -0500 (Thu, 26 Jun 2008) | 1 line
add a htmlview directive
........
r64550 | brett.cannon | 2008-06-26 19:32:16 -0500 (Thu, 26 Jun 2008) | 2 lines
Ignore .pyc and .pyo files.
........
r64557 | mark.dickinson | 2008-06-27 05:11:52 -0500 (Fri, 27 Jun 2008) | 3 lines
Remove trailing 'L's from numerator and denominator in the
repr() of a Fraction instance.
........
r64558 | mark.dickinson | 2008-06-27 06:03:21 -0500 (Fri, 27 Jun 2008) | 2 lines
Add Jean Brouwers for his work on math.sum
........
r64565 | raymond.hettinger | 2008-06-27 16:34:24 -0500 (Fri, 27 Jun 2008) | 1 line
Fix whitespace in example code.
........
r64570 | hyeshik.chang | 2008-06-27 20:04:31 -0500 (Fri, 27 Jun 2008) | 8 lines
Give information for compililation of _multiprocessing.SemLock on FreeBSD:
FreeBSD's P1003.1b semaphore support is highly experimental and
it's disabled by default. Even if a user loads the experimental
kernel module manually, _multiprocessing doesn't work correctly due
to several known incompatibilities around sem_unlink and sem_getvalue,
yet.
........
r64577 | raymond.hettinger | 2008-06-28 17:16:53 -0500 (Sat, 28 Jun 2008) | 1 line
Issue 3230: Do not the set specific size macro.
........
r64582 | benjamin.peterson | 2008-06-28 18:06:05 -0500 (Sat, 28 Jun 2008) | 2 lines
convert test_audioop to unittest. Thanks to Giampaolo Rodola.
........
r64583 | benjamin.peterson | 2008-06-28 18:06:49 -0500 (Sat, 28 Jun 2008) | 1 line
rewrap
........
r64585 | benjamin.peterson | 2008-06-28 18:35:31 -0500 (Sat, 28 Jun 2008) | 1 line
fix typo
........
r64590 | benjamin.peterson | 2008-06-29 08:43:07 -0500 (Sun, 29 Jun 2008) | 1 line
reinstate the ending backtick. thanks Nick :)
........
r64592 | vinay.sajip | 2008-06-29 16:25:28 -0500 (Sun, 29 Jun 2008) | 2 lines
Removed out-of-date comment in _install_handlers and
used issubclass in place of equality comparison of classes.
........
r64593 | vinay.sajip | 2008-06-29 16:27:15 -0500 (Sun, 29 Jun 2008) | 1 line
Updated to reflect change in logging.config to remove out-of-date comment in _install_handlers and the use of issubclass in place of equality comparison of classes.
........
r64625 | georg.brandl | 2008-07-01 14:59:00 -0500 (Tue, 01 Jul 2008) | 2 lines
Add a link to PEP 324.
........
r64630 | georg.brandl | 2008-07-01 15:18:10 -0500 (Tue, 01 Jul 2008) | 2 lines
#3216: fix Execute's parameter description.
........
r64638 | georg.brandl | 2008-07-01 15:50:02 -0500 (Tue, 01 Jul 2008) | 2 lines
#1410739: add a footnote about "is" and "unusual" behavior.
........
r64647 | benjamin.peterson | 2008-07-01 18:33:06 -0500 (Tue, 01 Jul 2008) | 1 line
add ABC to the glossary
........
r64655 | mark.dickinson | 2008-07-02 04:37:01 -0500 (Wed, 02 Jul 2008) | 7 lines
Replace occurrences of '\d' with '[0-9]' in Decimal regex, to make sure
that the behaviour of Decimal doesn't change if/when re.UNICODE becomes
assumed in Python 3.0.
Also add a check that alternative Unicode digits (e.g. u'\N{FULLWIDTH
DIGIT ONE}') are *not* accepted in a numeric string.
........
r64656 | nick.coghlan | 2008-07-02 08:09:19 -0500 (Wed, 02 Jul 2008) | 1 line
Issue 3190: pydoc now hides module __package__ attributes
........
r64663 | jesse.noller | 2008-07-02 11:44:09 -0500 (Wed, 02 Jul 2008) | 1 line
Reenable the manager tests with Amaury's threading fix
........
r64664 | facundo.batista | 2008-07-02 11:52:55 -0500 (Wed, 02 Jul 2008) | 4 lines
Issue #449227: Now with the rlcompleter module, callable objects are
added a '(' when completed.
........
2008-07-02 17:22:54 -03:00
|
|
|
.. method:: View.Execute(params)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If
|
Merged revisions 64475,64544-64545,64550,64557-64558,64565,64570,64577,64582-64583,64585,64590,64592-64593,64625,64630,64638,64647,64655-64656,64663-64664 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r64475 | raymond.hettinger | 2008-06-22 22:29:28 -0500 (Sun, 22 Jun 2008) | 1 line
Issue 3161: Missing import and test.
........
r64544 | georg.brandl | 2008-06-26 16:12:55 -0500 (Thu, 26 Jun 2008) | 2 lines
Use newer versions of externals.
........
r64545 | benjamin.peterson | 2008-06-26 16:23:30 -0500 (Thu, 26 Jun 2008) | 1 line
add a htmlview directive
........
r64550 | brett.cannon | 2008-06-26 19:32:16 -0500 (Thu, 26 Jun 2008) | 2 lines
Ignore .pyc and .pyo files.
........
r64557 | mark.dickinson | 2008-06-27 05:11:52 -0500 (Fri, 27 Jun 2008) | 3 lines
Remove trailing 'L's from numerator and denominator in the
repr() of a Fraction instance.
........
r64558 | mark.dickinson | 2008-06-27 06:03:21 -0500 (Fri, 27 Jun 2008) | 2 lines
Add Jean Brouwers for his work on math.sum
........
r64565 | raymond.hettinger | 2008-06-27 16:34:24 -0500 (Fri, 27 Jun 2008) | 1 line
Fix whitespace in example code.
........
r64570 | hyeshik.chang | 2008-06-27 20:04:31 -0500 (Fri, 27 Jun 2008) | 8 lines
Give information for compililation of _multiprocessing.SemLock on FreeBSD:
FreeBSD's P1003.1b semaphore support is highly experimental and
it's disabled by default. Even if a user loads the experimental
kernel module manually, _multiprocessing doesn't work correctly due
to several known incompatibilities around sem_unlink and sem_getvalue,
yet.
........
r64577 | raymond.hettinger | 2008-06-28 17:16:53 -0500 (Sat, 28 Jun 2008) | 1 line
Issue 3230: Do not the set specific size macro.
........
r64582 | benjamin.peterson | 2008-06-28 18:06:05 -0500 (Sat, 28 Jun 2008) | 2 lines
convert test_audioop to unittest. Thanks to Giampaolo Rodola.
........
r64583 | benjamin.peterson | 2008-06-28 18:06:49 -0500 (Sat, 28 Jun 2008) | 1 line
rewrap
........
r64585 | benjamin.peterson | 2008-06-28 18:35:31 -0500 (Sat, 28 Jun 2008) | 1 line
fix typo
........
r64590 | benjamin.peterson | 2008-06-29 08:43:07 -0500 (Sun, 29 Jun 2008) | 1 line
reinstate the ending backtick. thanks Nick :)
........
r64592 | vinay.sajip | 2008-06-29 16:25:28 -0500 (Sun, 29 Jun 2008) | 2 lines
Removed out-of-date comment in _install_handlers and
used issubclass in place of equality comparison of classes.
........
r64593 | vinay.sajip | 2008-06-29 16:27:15 -0500 (Sun, 29 Jun 2008) | 1 line
Updated to reflect change in logging.config to remove out-of-date comment in _install_handlers and the use of issubclass in place of equality comparison of classes.
........
r64625 | georg.brandl | 2008-07-01 14:59:00 -0500 (Tue, 01 Jul 2008) | 2 lines
Add a link to PEP 324.
........
r64630 | georg.brandl | 2008-07-01 15:18:10 -0500 (Tue, 01 Jul 2008) | 2 lines
#3216: fix Execute's parameter description.
........
r64638 | georg.brandl | 2008-07-01 15:50:02 -0500 (Tue, 01 Jul 2008) | 2 lines
#1410739: add a footnote about "is" and "unusual" behavior.
........
r64647 | benjamin.peterson | 2008-07-01 18:33:06 -0500 (Tue, 01 Jul 2008) | 1 line
add ABC to the glossary
........
r64655 | mark.dickinson | 2008-07-02 04:37:01 -0500 (Wed, 02 Jul 2008) | 7 lines
Replace occurrences of '\d' with '[0-9]' in Decimal regex, to make sure
that the behaviour of Decimal doesn't change if/when re.UNICODE becomes
assumed in Python 3.0.
Also add a check that alternative Unicode digits (e.g. u'\N{FULLWIDTH
DIGIT ONE}') are *not* accepted in a numeric string.
........
r64656 | nick.coghlan | 2008-07-02 08:09:19 -0500 (Wed, 02 Jul 2008) | 1 line
Issue 3190: pydoc now hides module __package__ attributes
........
r64663 | jesse.noller | 2008-07-02 11:44:09 -0500 (Wed, 02 Jul 2008) | 1 line
Reenable the manager tests with Amaury's threading fix
........
r64664 | facundo.batista | 2008-07-02 11:52:55 -0500 (Wed, 02 Jul 2008) | 4 lines
Issue #449227: Now with the rlcompleter module, callable objects are
added a '(' when completed.
........
2008-07-02 17:22:54 -03:00
|
|
|
*params* is not ``None``, it is a record describing actual values of the
|
|
|
|
parameter tokens in the query.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. method:: View.GetColumnInfo(kind)
|
|
|
|
|
|
|
|
Return a record describing the columns of the view, through calling
|
2010-10-06 07:11:56 -03:00
|
|
|
:c:func:`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or
|
2007-08-15 11:28:22 -03:00
|
|
|
``MSICOLINFO_TYPES``.
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: View.Fetch()
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Return a result record of the query, through calling :c:func:`MsiViewFetch`.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. method:: View.Modify(kind, data)
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of
|
2007-08-15 11:28:22 -03:00
|
|
|
``MSIMODIFY_SEEK``, ``MSIMODIFY_REFRESH``, ``MSIMODIFY_INSERT``,
|
|
|
|
``MSIMODIFY_UPDATE``, ``MSIMODIFY_ASSIGN``, ``MSIMODIFY_REPLACE``,
|
|
|
|
``MSIMODIFY_MERGE``, ``MSIMODIFY_DELETE``, ``MSIMODIFY_INSERT_TEMPORARY``,
|
|
|
|
``MSIMODIFY_VALIDATE``, ``MSIMODIFY_VALIDATE_NEW``,
|
|
|
|
``MSIMODIFY_VALIDATE_FIELD``, or ``MSIMODIFY_VALIDATE_DELETE``.
|
|
|
|
|
|
|
|
*data* must be a record describing the new data.
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: View.Close()
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Close the view, through :c:func:`MsiViewClose`.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-11-14 19:06:15 -04:00
|
|
|
`MsiViewExecute <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370513.aspx>`_
|
|
|
|
`MSIViewGetColumnInfo <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370516.aspx>`_
|
|
|
|
`MsiViewFetch <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370514.aspx>`_
|
|
|
|
`MsiViewModify <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370519.aspx>`_
|
|
|
|
`MsiViewClose <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370510.aspx>`_
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. _summary-objects:
|
|
|
|
|
|
|
|
Summary Information Objects
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: SummaryInformation.GetProperty(field)
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Return a property of the summary, through :c:func:`MsiSummaryInfoGetProperty`.
|
2007-08-15 11:28:22 -03:00
|
|
|
*field* is the name of the property, and can be one of the constants
|
|
|
|
``PID_CODEPAGE``, ``PID_TITLE``, ``PID_SUBJECT``, ``PID_AUTHOR``,
|
|
|
|
``PID_KEYWORDS``, ``PID_COMMENTS``, ``PID_TEMPLATE``, ``PID_LASTAUTHOR``,
|
|
|
|
``PID_REVNUMBER``, ``PID_LASTPRINTED``, ``PID_CREATE_DTM``,
|
|
|
|
``PID_LASTSAVE_DTM``, ``PID_PAGECOUNT``, ``PID_WORDCOUNT``, ``PID_CHARCOUNT``,
|
|
|
|
``PID_APPNAME``, or ``PID_SECURITY``.
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: SummaryInformation.GetPropertyCount()
|
|
|
|
|
|
|
|
Return the number of summary properties, through
|
2010-10-06 07:11:56 -03:00
|
|
|
:c:func:`MsiSummaryInfoGetPropertyCount`.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. method:: SummaryInformation.SetProperty(field, value)
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have the
|
2007-08-15 11:28:22 -03:00
|
|
|
same values as in :meth:`GetProperty`, *value* is the new value of the property.
|
|
|
|
Possible value types are integer and string.
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: SummaryInformation.Persist()
|
|
|
|
|
|
|
|
Write the modified properties to the summary information stream, using
|
2010-10-06 07:11:56 -03:00
|
|
|
:c:func:`MsiSummaryInfoPersist`.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-11-14 19:06:15 -04:00
|
|
|
`MsiSummaryInfoGetProperty <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370409.aspx>`_
|
|
|
|
`MsiSummaryInfoGetPropertyCount <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370488.aspx>`_
|
|
|
|
`MsiSummaryInfoSetProperty <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370491.aspx>`_
|
|
|
|
`MsiSummaryInfoPersist <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370490.aspx>`_
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. _record-objects:
|
|
|
|
|
|
|
|
Record Objects
|
|
|
|
--------------
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: Record.GetFieldCount()
|
|
|
|
|
|
|
|
Return the number of fields of the record, through
|
2010-10-06 07:11:56 -03:00
|
|
|
:c:func:`MsiRecordGetFieldCount`.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-06-02 07:08:54 -03:00
|
|
|
.. method:: Record.GetInteger(field)
|
|
|
|
|
|
|
|
Return the value of *field* as an integer where possible. *field* must
|
|
|
|
be an integer.
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: Record.GetString(field)
|
|
|
|
|
|
|
|
Return the value of *field* as a string where possible. *field* must
|
|
|
|
be an integer.
|
|
|
|
|
|
|
|
|
2007-08-15 11:28:22 -03:00
|
|
|
.. method:: Record.SetString(field, value)
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be an
|
2007-08-15 11:28:22 -03:00
|
|
|
integer; *value* a string.
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: Record.SetStream(field, value)
|
|
|
|
|
|
|
|
Set *field* to the contents of the file named *value*, through
|
2010-10-06 07:11:56 -03:00
|
|
|
:c:func:`MsiRecordSetStream`. *field* must be an integer; *value* a string.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. method:: Record.SetInteger(field, value)
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* and
|
2007-08-15 11:28:22 -03:00
|
|
|
*value* must be an integer.
|
|
|
|
|
|
|
|
|
|
|
|
.. method:: Record.ClearData()
|
|
|
|
|
2010-10-06 07:11:56 -03:00
|
|
|
Set all fields of the record to 0, through :c:func:`MsiRecordClearData`.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-11-14 19:06:15 -04:00
|
|
|
`MsiRecordGetFieldCount <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370366.aspx>`_
|
|
|
|
`MsiRecordSetString <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370373.aspx>`_
|
|
|
|
`MsiRecordSetStream <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370372.aspx>`_
|
|
|
|
`MsiRecordSetInteger <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370371.aspx>`_
|
|
|
|
`MsiRecordClearData <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370364.aspx>`_
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. _msi-errors:
|
|
|
|
|
|
|
|
Errors
|
|
|
|
------
|
|
|
|
|
2017-10-07 11:55:00 -03:00
|
|
|
All wrappers around MSI functions raise :exc:`MSIError`; the string inside the
|
2007-08-15 11:28:22 -03:00
|
|
|
exception will contain more detail.
|
|
|
|
|
|
|
|
|
|
|
|
.. _cab:
|
|
|
|
|
|
|
|
CAB Objects
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
|
|
.. class:: CAB(name)
|
|
|
|
|
|
|
|
The class :class:`CAB` represents a CAB file. During MSI construction, files
|
|
|
|
will be added simultaneously to the ``Files`` table, and to a CAB file. Then,
|
|
|
|
when all files have been added, the CAB file can be written, then added to the
|
|
|
|
MSI file.
|
|
|
|
|
|
|
|
*name* is the name of the CAB file in the MSI file.
|
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: append(full, file, logical)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add the file with the pathname *full* to the CAB file, under the name
|
|
|
|
*logical*. If there is already a file named *logical*, a new file name is
|
|
|
|
created.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Return the index of the file in the CAB file, and the new name of the file
|
|
|
|
inside the CAB file.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: commit(database)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Generate a CAB file, add it as a stream to the MSI file, put it into the
|
|
|
|
``Media`` table, and remove the generated file from the disk.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. _msi-directory:
|
|
|
|
|
|
|
|
Directory Objects
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
2010-12-25 22:38:05 -04:00
|
|
|
.. class:: Directory(database, cab, basedir, physical, logical, default, [componentflags])
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
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
|
|
|
|
:meth:`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.
|
|
|
|
|
|
|
|
|
2009-06-08 06:13:45 -03:00
|
|
|
.. method:: start_component(component=None, feature=None, flags=None, keyfile=None, uuid=None)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add an entry to the Component table, and make this component the current
|
|
|
|
component 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.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2009-06-08 06:13:45 -03:00
|
|
|
.. method:: add_file(file, src=None, version=None, language=None)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add a file to the current component of the directory, starting a new 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.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2009-06-08 06:13:45 -03:00
|
|
|
.. method:: glob(pattern, exclude=None)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add a list of files to the current component as specified in the glob
|
|
|
|
pattern. Individual files can be excluded in the *exclude* list.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: remove_pyc()
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2017-11-19 06:04:25 -04:00
|
|
|
Remove ``.pyc`` files on uninstall.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-11-14 19:06:15 -04:00
|
|
|
`Directory Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368295.aspx>`_
|
|
|
|
`File Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368596.aspx>`_
|
|
|
|
`Component Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368007.aspx>`_
|
|
|
|
`FeatureComponents Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368579.aspx>`_
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. _features:
|
|
|
|
|
|
|
|
Features
|
|
|
|
--------
|
|
|
|
|
|
|
|
|
2009-06-08 06:13:45 -03:00
|
|
|
.. class:: Feature(db, id, title, desc, display, level=1, parent=None, directory=None, attributes=0)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
Add a new record to the ``Feature`` table, using the values *id*, *parent.id*,
|
|
|
|
*title*, *desc*, *display*, *level*, *directory*, and *attributes*. The
|
|
|
|
resulting feature object can be passed to the :meth:`start_component` method of
|
|
|
|
:class:`Directory`.
|
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: set_current()
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Make this feature the current feature of :mod:`msilib`. New components are
|
|
|
|
automatically added to the default feature, unless a feature is explicitly
|
|
|
|
specified.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-11-14 19:06:15 -04:00
|
|
|
`Feature Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368585.aspx>`_
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. _msi-gui:
|
|
|
|
|
|
|
|
GUI classes
|
|
|
|
-----------
|
|
|
|
|
|
|
|
:mod:`msilib` provides several classes that wrap the GUI tables in an MSI
|
2021-09-07 07:34:27 -03:00
|
|
|
database. However, no standard user interface is provided.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. class:: Control(dlg, name)
|
|
|
|
|
|
|
|
Base class of the dialog controls. *dlg* is the dialog object the control
|
|
|
|
belongs to, and *name* is the control's name.
|
|
|
|
|
|
|
|
|
2009-06-08 06:13:45 -03:00
|
|
|
.. method:: event(event, argument, condition=1, ordering=None)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Make an entry into the ``ControlEvent`` table for this control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: mapping(event, attribute)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Make an entry into the ``EventMapping`` table for this control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: condition(action, condition)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Make an entry into the ``ControlCondition`` table for this control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. class:: RadioButtonGroup(dlg, name, property)
|
|
|
|
|
|
|
|
Create a radio button control named *name*. *property* is the installer property
|
|
|
|
that gets set when a radio button is selected.
|
|
|
|
|
|
|
|
|
2009-06-08 06:13:45 -03:00
|
|
|
.. method:: add(name, x, y, width, height, text, value=None)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add a radio button named *name* to the group, at the coordinates *x*, *y*,
|
2009-06-08 06:13:45 -03:00
|
|
|
*width*, *height*, and with the label *text*. If *value* is ``None``, it
|
2008-04-24 22:59:09 -03:00
|
|
|
defaults to *name*.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. class:: Dialog(db, name, x, y, w, h, attr, title, first, default, cancel)
|
|
|
|
|
|
|
|
Return a new :class:`Dialog` object. An entry in the ``Dialog`` table is made,
|
|
|
|
with the specified coordinates, dialog attributes, title, name of the first,
|
|
|
|
default, and cancel controls.
|
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: control(name, type, x, y, width, height, attributes, property, text, control_next, help)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Return a new :class:`Control` object. An entry in the ``Control`` table is
|
|
|
|
made with the specified parameters.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
This is a generic method; for specific types, specialized methods are
|
|
|
|
provided.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: text(name, x, y, width, height, attributes, text)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add and return a ``Text`` control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: bitmap(name, x, y, width, height, text)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add and return a ``Bitmap`` control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: line(name, x, y, width, height)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add and return a ``Line`` control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: pushbutton(name, x, y, width, height, attributes, text, next_control)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add and return a ``PushButton`` control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: radiogroup(name, x, y, width, height, attributes, property, text, next_control)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add and return a ``RadioButtonGroup`` control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
.. method:: checkbox(name, x, y, width, height, attributes, property, text, next_control)
|
2007-08-15 11:28:22 -03:00
|
|
|
|
2008-04-24 22:59:09 -03:00
|
|
|
Add and return a ``CheckBox`` control.
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-11-14 19:06:15 -04:00
|
|
|
`Dialog Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368286.aspx>`_
|
|
|
|
`Control Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368044.aspx>`_
|
|
|
|
`Control Types <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368039.aspx>`_
|
|
|
|
`ControlCondition Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368035.aspx>`_
|
|
|
|
`ControlEvent Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368037.aspx>`_
|
|
|
|
`EventMapping Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa368559.aspx>`_
|
|
|
|
`RadioButton Table <https://msdn.microsoft.com/en-us/library/windows/desktop/aa370962.aspx>`_
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
.. _msi-tables:
|
|
|
|
|
|
|
|
Precomputed tables
|
|
|
|
------------------
|
|
|
|
|
|
|
|
:mod:`msilib` provides a few subpackages that contain only schema and table
|
|
|
|
definitions. Currently, these definitions are based on MSI version 2.0.
|
|
|
|
|
|
|
|
|
|
|
|
.. data:: schema
|
|
|
|
|
|
|
|
This is the standard MSI schema for MSI 2.0, with the *tables* variable
|
|
|
|
providing a list of table definitions, and *_Validation_records* providing the
|
|
|
|
data for MSI validation.
|
|
|
|
|
|
|
|
|
|
|
|
.. data:: sequence
|
|
|
|
|
|
|
|
This module contains table contents for the standard sequence tables:
|
|
|
|
*AdminExecuteSequence*, *AdminUISequence*, *AdvtExecuteSequence*,
|
|
|
|
*InstallExecuteSequence*, and *InstallUISequence*.
|
|
|
|
|
|
|
|
|
|
|
|
.. data:: text
|
|
|
|
|
|
|
|
This module contains definitions for the UIText and ActionText tables, for the
|
|
|
|
standard installer actions.
|