diff --git a/Doc/library/msilib.rst b/Doc/library/msilib.rst deleted file mode 100644 index fbe55db9372..00000000000 --- a/Doc/library/msilib.rst +++ /dev/null @@ -1,565 +0,0 @@ -:mod:`msilib` --- Read and write Microsoft Installer files -========================================================== - -.. module:: msilib - :platform: Windows - :synopsis: Creation of Microsoft Installer files, and CAB files. - :deprecated: - -.. moduleauthor:: Martin v. Löwis -.. sectionauthor:: Martin v. Löwis - -**Source code:** :source:`Lib/msilib/__init__.py` - -.. index:: single: msi - -.. deprecated-removed:: 3.11 3.13 - The :mod:`msilib` module is deprecated - (see :pep:`PEP 594 <594#msilib>` for details). - --------------- - -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, -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``). - -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. - - -.. function:: UuidCreate() - - Return the string representation of a new unique identifier. This wraps the - Windows API functions :c:func:`UuidCreate` and :c:func:`UuidToString`. - - -.. 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) - - Return a new record object by calling :c:func:`MSICreateRecord`. *count* is the - number of fields of the record. - - -.. function:: init_database(name, schema, ProductName, ProductCode, ProductVersion, Manufacturer) - - Create and return a new database *name*, initialize it with *schema*, and set - 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. - - -.. function:: add_data(database, table, records) - - Add all *records* to the table named *table* in *database*. - - 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. - - Field values can be ints, strings, or instances of the Binary class. - - -.. 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 - braces, and with all hexdigits in uppercase). - - -.. seealso:: - - `FCICreate `_ - `UuidCreate `_ - `UuidToString `_ - -.. _database-objects: - -Database Objects ----------------- - - -.. method:: Database.OpenView(sql) - - Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the SQL - statement to execute. - - -.. method:: Database.Commit() - - Commit the changes pending in the current transaction, by calling - :c:func:`MSIDatabaseCommit`. - - -.. method:: Database.GetSummaryInformation(count) - - Return a new summary information object, by calling - :c:func:`MsiGetSummaryInformation`. *count* is the maximum number of updated - values. - -.. method:: Database.Close() - - Close the database object, through :c:func:`MsiCloseHandle`. - - .. versionadded:: 3.7 - -.. seealso:: - - `MSIDatabaseOpenView `_ - `MSIDatabaseCommit `_ - `MSIGetSummaryInformation `_ - `MsiCloseHandle `_ - -.. _view-objects: - -View Objects ------------- - - -.. method:: View.Execute(params) - - Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If - *params* is not ``None``, it is a record describing actual values of the - parameter tokens in the query. - - -.. method:: View.GetColumnInfo(kind) - - Return a record describing the columns of the view, through calling - :c:func:`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or - ``MSICOLINFO_TYPES``. - - -.. method:: View.Fetch() - - Return a result record of the query, through calling :c:func:`MsiViewFetch`. - - -.. method:: View.Modify(kind, data) - - Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of - ``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() - - Close the view, through :c:func:`MsiViewClose`. - - -.. seealso:: - - `MsiViewExecute `_ - `MSIViewGetColumnInfo `_ - `MsiViewFetch `_ - `MsiViewModify `_ - `MsiViewClose `_ - -.. _summary-objects: - -Summary Information Objects ---------------------------- - - -.. method:: SummaryInformation.GetProperty(field) - - Return a property of the summary, through :c:func:`MsiSummaryInfoGetProperty`. - *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 - :c:func:`MsiSummaryInfoGetPropertyCount`. - - -.. method:: SummaryInformation.SetProperty(field, value) - - Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have the - 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 - :c:func:`MsiSummaryInfoPersist`. - - -.. seealso:: - - `MsiSummaryInfoGetProperty `_ - `MsiSummaryInfoGetPropertyCount `_ - `MsiSummaryInfoSetProperty `_ - `MsiSummaryInfoPersist `_ - -.. _record-objects: - -Record Objects --------------- - - -.. method:: Record.GetFieldCount() - - Return the number of fields of the record, through - :c:func:`MsiRecordGetFieldCount`. - - -.. 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. - - -.. method:: Record.SetString(field, value) - - Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be an - integer; *value* a string. - - -.. method:: Record.SetStream(field, value) - - Set *field* to the contents of the file named *value*, through - :c:func:`MsiRecordSetStream`. *field* must be an integer; *value* a string. - - -.. method:: Record.SetInteger(field, value) - - Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* and - *value* must be an integer. - - -.. method:: Record.ClearData() - - Set all fields of the record to 0, through :c:func:`MsiRecordClearData`. - - -.. seealso:: - - `MsiRecordGetFieldCount `_ - `MsiRecordSetString `_ - `MsiRecordSetStream `_ - `MsiRecordSetInteger `_ - `MsiRecordClearData `_ - -.. _msi-errors: - -Errors ------- - -All wrappers around MSI functions raise :exc:`MSIError`; the string inside the -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. - - - .. method:: append(full, file, logical) - - 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. - - Return the index of the file in the CAB file, and the new name of the file - inside the CAB file. - - - .. method:: commit(database) - - 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. - - -.. _msi-directory: - -Directory Objects ------------------ - - -.. class:: Directory(database, cab, basedir, physical, logical, default, [componentflags]) - - 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. - - - .. method:: start_component(component=None, feature=None, flags=None, keyfile=None, uuid=None) - - 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. - - - .. method:: add_file(file, src=None, version=None, language=None) - - 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. - - - .. method:: glob(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. - - - .. method:: remove_pyc() - - Remove ``.pyc`` files on uninstall. - - -.. seealso:: - - `Directory Table `_ - `File Table `_ - `Component Table `_ - `FeatureComponents Table `_ - -.. _features: - -Features --------- - - -.. class:: Feature(db, id, title, desc, display, level=1, parent=None, directory=None, attributes=0) - - 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`. - - - .. method:: set_current() - - Make this feature the current feature of :mod:`msilib`. New components are - automatically added to the default feature, unless a feature is explicitly - specified. - - -.. seealso:: - - `Feature Table `_ - -.. _msi-gui: - -GUI classes ------------ - -:mod:`msilib` provides several classes that wrap the GUI tables in an MSI -database. However, no standard user interface is provided. - - -.. 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. - - - .. method:: event(event, argument, condition=1, ordering=None) - - Make an entry into the ``ControlEvent`` table for this control. - - - .. method:: mapping(event, attribute) - - Make an entry into the ``EventMapping`` table for this control. - - - .. method:: condition(action, condition) - - Make an entry into the ``ControlCondition`` table for this control. - - -.. 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. - - - .. method:: add(name, x, y, width, height, text, value=None) - - Add a radio button named *name* to the group, at the coordinates *x*, *y*, - *width*, *height*, and with the label *text*. If *value* is ``None``, it - defaults to *name*. - - -.. 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. - - - .. method:: control(name, type, x, y, width, height, attributes, property, text, control_next, help) - - Return a new :class:`Control` object. An entry in the ``Control`` table is - made with the specified parameters. - - This is a generic method; for specific types, specialized methods are - provided. - - - .. method:: text(name, x, y, width, height, attributes, text) - - Add and return a ``Text`` control. - - - .. method:: bitmap(name, x, y, width, height, text) - - Add and return a ``Bitmap`` control. - - - .. method:: line(name, x, y, width, height) - - Add and return a ``Line`` control. - - - .. method:: pushbutton(name, x, y, width, height, attributes, text, next_control) - - Add and return a ``PushButton`` control. - - - .. method:: radiogroup(name, x, y, width, height, attributes, property, text, next_control) - - Add and return a ``RadioButtonGroup`` control. - - - .. method:: checkbox(name, x, y, width, height, attributes, property, text, next_control) - - Add and return a ``CheckBox`` control. - - -.. seealso:: - - `Dialog Table `_ - `Control Table `_ - `Control Types `_ - `ControlCondition Table `_ - `ControlEvent Table `_ - `EventMapping Table `_ - `RadioButton Table `_ - -.. _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. diff --git a/Doc/library/superseded.rst b/Doc/library/superseded.rst index 5d05740ee81..1e7b3787f06 100644 --- a/Doc/library/superseded.rst +++ b/Doc/library/superseded.rst @@ -15,6 +15,5 @@ backwards compatibility. They have been superseded by other modules. chunk.rst crypt.rst imghdr.rst - msilib.rst optparse.rst uu.rst diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 7a374032525..9f3a99e90bc 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -161,7 +161,6 @@ Doc/library/logging.rst Doc/library/lzma.rst Doc/library/mailbox.rst Doc/library/mmap.rst -Doc/library/msilib.rst Doc/library/msvcrt.rst Doc/library/multiprocessing.rst Doc/library/multiprocessing.shared_memory.rst diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst index e57631ab4c9..5615b8867bd 100644 --- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -1422,7 +1422,7 @@ complete list of changes, or look through the SVN logs for all the details. (Contributed by Gregory K. Johnson. Funding was provided by Google's 2005 Summer of Code.) -* New module: the :mod:`msilib` module allows creating Microsoft Installer +* New module: the :mod:`!msilib` module allows creating Microsoft Installer :file:`.msi` files and CAB files. Some support for reading the :file:`.msi` database is also included. (Contributed by Martin von Löwis.) diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst index 0a8bad4e531..69170897ccc 100644 --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -3135,7 +3135,7 @@ Port-Specific Changes: Windows registry reflection for 32-bit processes running on 64-bit systems. (:issue:`1753245`) -* The :mod:`msilib` module's :class:`Record` object +* The :mod:`!msilib` module's :class:`Record` object gained :meth:`GetInteger` and :meth:`GetString` methods that return field values as an integer or a string. (Contributed by Floris Bruynooghe; :issue:`2125`.) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index afb1021cebe..2382500960c 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1731,7 +1731,7 @@ Modules slated for removal in Python 3.13: +---------------------+---------------------+---------------------+---------------------+---------------------+ - | :mod:`aifc` | :mod:`chunk` | :mod:`msilib` | :mod:`!pipes` | :mod:`!telnetlib` | + | :mod:`aifc` | :mod:`chunk` | :mod:`!msilib` | :mod:`!pipes` | :mod:`!telnetlib` | +---------------------+---------------------+---------------------+---------------------+---------------------+ | :mod:`audioop` | :mod:`crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`uu` | +---------------------+---------------------+---------------------+---------------------+---------------------+ diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 8de6cf4da88..f83409c2848 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -894,7 +894,7 @@ Modules (see :pep:`594`): * :mod:`crypt` * :mod:`imghdr` * :mod:`!mailcap` -* :mod:`msilib` +* :mod:`!msilib` * :mod:`!nis` * :mod:`!nntplib` * :mod:`!ossaudiodev` diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index a470680cdb5..bfd0995752b 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -198,6 +198,9 @@ Removed * :pep:`594`: Remove the :mod:`!xdrlib` module, deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:`104773`.) +* :pep:`594`: Remove the :mod:`!msilib` module, deprecated in Python 3.11. + (Contributed by Zachary Ware in :gh:`104773`.) + Porting to Python 3.13 ====================== diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 967608d512f..8b4aa17c214 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -1133,7 +1133,7 @@ The MIME type of .bmp has been changed from ``'image/x-ms-bmp'`` to msilib ------ -The new :meth:`Database.Close() ` method can be used +The new :meth:`!Database.Close()` method can be used to close the :abbr:`MSI` database. (Contributed by Berker Peksag in :issue:`20486`.) diff --git a/Lib/msilib/__init__.py b/Lib/msilib/__init__.py deleted file mode 100644 index 565bf631abd..00000000000 --- a/Lib/msilib/__init__.py +++ /dev/null @@ -1,484 +0,0 @@ -# Copyright (C) 2005 Martin v. Löwis -# Licensed to PSF under a Contributor Agreement. -from _msi import * -import fnmatch -import os -import re -import string -import sys -import warnings - -warnings._deprecated(__name__, remove=(3, 13)) - -AMD64 = "AMD64" in sys.version -# Keep msilib.Win64 around to preserve backwards compatibility. -Win64 = AMD64 - -# 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 - -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 _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): - v = db.OpenView("SELECT * FROM `%s`" % table) - count = v.GetColumnInfo(MSICOLINFO_NAMES).GetFieldCount() - r = CreateRecord(count) - for value in values: - assert len(value) == count, value - for i in range(count): - field = value[i] - if isinstance(field, int): - r.SetInteger(i+1,field) - elif isinstance(field, str): - r.SetString(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__) - try: - v.Modify(MSIMODIFY_INSERT, r) - except Exception: - raise MSIError("Could not insert "+repr(values)+" into "+table) - - r.ClearData() - v.Close() - - -def add_stream(db, name, path): - v = db.OpenView("INSERT INTO _Streams (Name, Data) VALUES ('%s', ?)" % name) - r = CreateRecord(1) - r.SetStream(1, path) - v.Execute(r) - v.Close() - -def init_database(name, schema, - ProductName, ProductCode, ProductVersion, - Manufacturer): - try: - os.unlink(name) - except OSError: - pass - ProductCode = ProductCode.upper() - # Create the database - db = OpenDatabase(name, MSIDBOPEN_CREATE) - # 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) - if AMD64: - si.SetProperty(PID_TEMPLATE, "x64;1033") - else: - si.SetProperty(PID_TEMPLATE, "Intel;1033") - si.SetProperty(PID_REVNUMBER, gen_uuid()) - si.SetProperty(PID_WORDCOUNT, 2) # long file names, compressed, original media - 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): - identifier_chars = string.ascii_letters + string.digits + "._" - str = "".join([c if c in identifier_chars else "_" for c in str]) - 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 "{"+UuidCreate().upper()+"}" - -class CAB: - def __init__(self, name): - self.name = name - self.files = [] - self.filenames = set() - self.index = 0 - - def gen_id(self, 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): - if os.path.isdir(full): - return - if not logical: - logical = self.gen_id(file) - self.index += 1 - self.files.append((full, logical)) - return self.index, logical - - def commit(self, db): - from tempfile import mktemp - filename = mktemp() - FCICreate(filename, self.files) - add_data(db, "Media", - [(1, self.index, None, "#"+self.name, None, None)]) - add_stream(db, self.name, filename) - os.unlink(filename) - db.Commit() - -_directories = 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 = set() - self.ids = 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 AMD64: - flags |= 256 - if keyfile: - keyid = self.cab.gen_id(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): - oldfile = file - file = file.replace('+', '_') - file = ''.join(c for c in file if not c in r' "/\[]:;=,') - parts = file.split(".") - if len(parts) > 1: - prefix = "".join(parts[:-1]).upper() - suffix = parts[-1].upper() - if not prefix: - prefix = suffix - suffix = None - else: - prefix = file.upper() - suffix = None - if len(parts) < 3 and len(prefix) <= 8 and file == oldfile and ( - not suffix or len(suffix) <= 3): - if suffix: - file = prefix+"."+suffix - else: - file = prefix - else: - file = None - if file is None or file in self.short_names: - 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) - assert not re.search(r'[\?|><:/*"+,;=\[\]]', file) # restrictions on short names - 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 - 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, 0) - 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 file in self.keyfiles: - 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 = 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 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)]) - return logical - - 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.""" - try: - files = os.listdir(self.absolute) - except OSError: - return [] - if pattern[:1] != '.': - files = (f for f in files if f[0] != '.') - files = fnmatch.filter(files, pattern) - for f in files: - if exclude and f in exclude: continue - self.add_file(f) - return files - - def remove_pyc(self): - "Remove .pyc files on uninstall" - add_data(self.db, "RemoveFile", - [(self.component+"c", self.component, "*.pyc", self.logical, 2)]) - -class Binary: - def __init__(self, fname): - self.name = fname - def __repr__(self): - return 'msilib.Binary(os.path.join(dirname,"%s"))' % self.name - -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, event, argument, condition = "1", ordering = None): - add_data(self.dlg.db, "ControlEvent", - [(self.dlg.name, self.name, event, argument, - condition, ordering)]) - - def mapping(self, event, attribute): - add_data(self.dlg.db, "EventMapping", - [(self.dlg.name, self.name, event, attribute)]) - - 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) diff --git a/Lib/msilib/schema.py b/Lib/msilib/schema.py deleted file mode 100644 index 9f5745cfb14..00000000000 --- a/Lib/msilib/schema.py +++ /dev/null @@ -1,1007 +0,0 @@ -from . import Table - -_Validation = Table('_Validation') -_Validation.add_field(1,'Table',11552) -_Validation.add_field(2,'Column',11552) -_Validation.add_field(3,'Nullable',3332) -_Validation.add_field(4,'MinValue',4356) -_Validation.add_field(5,'MaxValue',4356) -_Validation.add_field(6,'KeyTable',7679) -_Validation.add_field(7,'KeyColumn',5378) -_Validation.add_field(8,'Category',7456) -_Validation.add_field(9,'Set',7679) -_Validation.add_field(10,'Description',7679) - -ActionText = Table('ActionText') -ActionText.add_field(1,'Action',11592) -ActionText.add_field(2,'Description',7936) -ActionText.add_field(3,'Template',7936) - -AdminExecuteSequence = Table('AdminExecuteSequence') -AdminExecuteSequence.add_field(1,'Action',11592) -AdminExecuteSequence.add_field(2,'Condition',7679) -AdminExecuteSequence.add_field(3,'Sequence',5378) - -Condition = Table('Condition') -Condition.add_field(1,'Feature_',11558) -Condition.add_field(2,'Level',9474) -Condition.add_field(3,'Condition',7679) - -AdminUISequence = Table('AdminUISequence') -AdminUISequence.add_field(1,'Action',11592) -AdminUISequence.add_field(2,'Condition',7679) -AdminUISequence.add_field(3,'Sequence',5378) - -AdvtExecuteSequence = Table('AdvtExecuteSequence') -AdvtExecuteSequence.add_field(1,'Action',11592) -AdvtExecuteSequence.add_field(2,'Condition',7679) -AdvtExecuteSequence.add_field(3,'Sequence',5378) - -AdvtUISequence = Table('AdvtUISequence') -AdvtUISequence.add_field(1,'Action',11592) -AdvtUISequence.add_field(2,'Condition',7679) -AdvtUISequence.add_field(3,'Sequence',5378) - -AppId = Table('AppId') -AppId.add_field(1,'AppId',11558) -AppId.add_field(2,'RemoteServerName',7679) -AppId.add_field(3,'LocalService',7679) -AppId.add_field(4,'ServiceParameters',7679) -AppId.add_field(5,'DllSurrogate',7679) -AppId.add_field(6,'ActivateAtStorage',5378) -AppId.add_field(7,'RunAsInteractiveUser',5378) - -AppSearch = Table('AppSearch') -AppSearch.add_field(1,'Property',11592) -AppSearch.add_field(2,'Signature_',11592) - -Property = Table('Property') -Property.add_field(1,'Property',11592) -Property.add_field(2,'Value',3840) - -BBControl = Table('BBControl') -BBControl.add_field(1,'Billboard_',11570) -BBControl.add_field(2,'BBControl',11570) -BBControl.add_field(3,'Type',3378) -BBControl.add_field(4,'X',1282) -BBControl.add_field(5,'Y',1282) -BBControl.add_field(6,'Width',1282) -BBControl.add_field(7,'Height',1282) -BBControl.add_field(8,'Attributes',4356) -BBControl.add_field(9,'Text',7986) - -Billboard = Table('Billboard') -Billboard.add_field(1,'Billboard',11570) -Billboard.add_field(2,'Feature_',3366) -Billboard.add_field(3,'Action',7474) -Billboard.add_field(4,'Ordering',5378) - -Feature = Table('Feature') -Feature.add_field(1,'Feature',11558) -Feature.add_field(2,'Feature_Parent',7462) -Feature.add_field(3,'Title',8000) -Feature.add_field(4,'Description',8191) -Feature.add_field(5,'Display',5378) -Feature.add_field(6,'Level',1282) -Feature.add_field(7,'Directory_',7496) -Feature.add_field(8,'Attributes',1282) - -Binary = Table('Binary') -Binary.add_field(1,'Name',11592) -Binary.add_field(2,'Data',2304) - -BindImage = Table('BindImage') -BindImage.add_field(1,'File_',11592) -BindImage.add_field(2,'Path',7679) - -File = Table('File') -File.add_field(1,'File',11592) -File.add_field(2,'Component_',3400) -File.add_field(3,'FileName',4095) -File.add_field(4,'FileSize',260) -File.add_field(5,'Version',7496) -File.add_field(6,'Language',7444) -File.add_field(7,'Attributes',5378) -File.add_field(8,'Sequence',1282) - -CCPSearch = Table('CCPSearch') -CCPSearch.add_field(1,'Signature_',11592) - -CheckBox = Table('CheckBox') -CheckBox.add_field(1,'Property',11592) -CheckBox.add_field(2,'Value',7488) - -Class = Table('Class') -Class.add_field(1,'CLSID',11558) -Class.add_field(2,'Context',11552) -Class.add_field(3,'Component_',11592) -Class.add_field(4,'ProgId_Default',7679) -Class.add_field(5,'Description',8191) -Class.add_field(6,'AppId_',7462) -Class.add_field(7,'FileTypeMask',7679) -Class.add_field(8,'Icon_',7496) -Class.add_field(9,'IconIndex',5378) -Class.add_field(10,'DefInprocHandler',7456) -Class.add_field(11,'Argument',7679) -Class.add_field(12,'Feature_',3366) -Class.add_field(13,'Attributes',5378) - -Component = Table('Component') -Component.add_field(1,'Component',11592) -Component.add_field(2,'ComponentId',7462) -Component.add_field(3,'Directory_',3400) -Component.add_field(4,'Attributes',1282) -Component.add_field(5,'Condition',7679) -Component.add_field(6,'KeyPath',7496) - -Icon = Table('Icon') -Icon.add_field(1,'Name',11592) -Icon.add_field(2,'Data',2304) - -ProgId = Table('ProgId') -ProgId.add_field(1,'ProgId',11775) -ProgId.add_field(2,'ProgId_Parent',7679) -ProgId.add_field(3,'Class_',7462) -ProgId.add_field(4,'Description',8191) -ProgId.add_field(5,'Icon_',7496) -ProgId.add_field(6,'IconIndex',5378) - -ComboBox = Table('ComboBox') -ComboBox.add_field(1,'Property',11592) -ComboBox.add_field(2,'Order',9474) -ComboBox.add_field(3,'Value',3392) -ComboBox.add_field(4,'Text',8000) - -CompLocator = Table('CompLocator') -CompLocator.add_field(1,'Signature_',11592) -CompLocator.add_field(2,'ComponentId',3366) -CompLocator.add_field(3,'Type',5378) - -Complus = Table('Complus') -Complus.add_field(1,'Component_',11592) -Complus.add_field(2,'ExpType',13570) - -Directory = Table('Directory') -Directory.add_field(1,'Directory',11592) -Directory.add_field(2,'Directory_Parent',7496) -Directory.add_field(3,'DefaultDir',4095) - -Control = Table('Control') -Control.add_field(1,'Dialog_',11592) -Control.add_field(2,'Control',11570) -Control.add_field(3,'Type',3348) -Control.add_field(4,'X',1282) -Control.add_field(5,'Y',1282) -Control.add_field(6,'Width',1282) -Control.add_field(7,'Height',1282) -Control.add_field(8,'Attributes',4356) -Control.add_field(9,'Property',7474) -Control.add_field(10,'Text',7936) -Control.add_field(11,'Control_Next',7474) -Control.add_field(12,'Help',7986) - -Dialog = Table('Dialog') -Dialog.add_field(1,'Dialog',11592) -Dialog.add_field(2,'HCentering',1282) -Dialog.add_field(3,'VCentering',1282) -Dialog.add_field(4,'Width',1282) -Dialog.add_field(5,'Height',1282) -Dialog.add_field(6,'Attributes',4356) -Dialog.add_field(7,'Title',8064) -Dialog.add_field(8,'Control_First',3378) -Dialog.add_field(9,'Control_Default',7474) -Dialog.add_field(10,'Control_Cancel',7474) - -ControlCondition = Table('ControlCondition') -ControlCondition.add_field(1,'Dialog_',11592) -ControlCondition.add_field(2,'Control_',11570) -ControlCondition.add_field(3,'Action',11570) -ControlCondition.add_field(4,'Condition',11775) - -ControlEvent = Table('ControlEvent') -ControlEvent.add_field(1,'Dialog_',11592) -ControlEvent.add_field(2,'Control_',11570) -ControlEvent.add_field(3,'Event',11570) -ControlEvent.add_field(4,'Argument',11775) -ControlEvent.add_field(5,'Condition',15871) -ControlEvent.add_field(6,'Ordering',5378) - -CreateFolder = Table('CreateFolder') -CreateFolder.add_field(1,'Directory_',11592) -CreateFolder.add_field(2,'Component_',11592) - -CustomAction = Table('CustomAction') -CustomAction.add_field(1,'Action',11592) -CustomAction.add_field(2,'Type',1282) -CustomAction.add_field(3,'Source',7496) -CustomAction.add_field(4,'Target',7679) - -DrLocator = Table('DrLocator') -DrLocator.add_field(1,'Signature_',11592) -DrLocator.add_field(2,'Parent',15688) -DrLocator.add_field(3,'Path',15871) -DrLocator.add_field(4,'Depth',5378) - -DuplicateFile = Table('DuplicateFile') -DuplicateFile.add_field(1,'FileKey',11592) -DuplicateFile.add_field(2,'Component_',3400) -DuplicateFile.add_field(3,'File_',3400) -DuplicateFile.add_field(4,'DestName',8191) -DuplicateFile.add_field(5,'DestFolder',7496) - -Environment = Table('Environment') -Environment.add_field(1,'Environment',11592) -Environment.add_field(2,'Name',4095) -Environment.add_field(3,'Value',8191) -Environment.add_field(4,'Component_',3400) - -Error = Table('Error') -Error.add_field(1,'Error',9474) -Error.add_field(2,'Message',7936) - -EventMapping = Table('EventMapping') -EventMapping.add_field(1,'Dialog_',11592) -EventMapping.add_field(2,'Control_',11570) -EventMapping.add_field(3,'Event',11570) -EventMapping.add_field(4,'Attribute',3378) - -Extension = Table('Extension') -Extension.add_field(1,'Extension',11775) -Extension.add_field(2,'Component_',11592) -Extension.add_field(3,'ProgId_',7679) -Extension.add_field(4,'MIME_',7488) -Extension.add_field(5,'Feature_',3366) - -MIME = Table('MIME') -MIME.add_field(1,'ContentType',11584) -MIME.add_field(2,'Extension_',3583) -MIME.add_field(3,'CLSID',7462) - -FeatureComponents = Table('FeatureComponents') -FeatureComponents.add_field(1,'Feature_',11558) -FeatureComponents.add_field(2,'Component_',11592) - -FileSFPCatalog = Table('FileSFPCatalog') -FileSFPCatalog.add_field(1,'File_',11592) -FileSFPCatalog.add_field(2,'SFPCatalog_',11775) - -SFPCatalog = Table('SFPCatalog') -SFPCatalog.add_field(1,'SFPCatalog',11775) -SFPCatalog.add_field(2,'Catalog',2304) -SFPCatalog.add_field(3,'Dependency',7424) - -Font = Table('Font') -Font.add_field(1,'File_',11592) -Font.add_field(2,'FontTitle',7552) - -IniFile = Table('IniFile') -IniFile.add_field(1,'IniFile',11592) -IniFile.add_field(2,'FileName',4095) -IniFile.add_field(3,'DirProperty',7496) -IniFile.add_field(4,'Section',3936) -IniFile.add_field(5,'Key',3968) -IniFile.add_field(6,'Value',4095) -IniFile.add_field(7,'Action',1282) -IniFile.add_field(8,'Component_',3400) - -IniLocator = Table('IniLocator') -IniLocator.add_field(1,'Signature_',11592) -IniLocator.add_field(2,'FileName',3583) -IniLocator.add_field(3,'Section',3424) -IniLocator.add_field(4,'Key',3456) -IniLocator.add_field(5,'Field',5378) -IniLocator.add_field(6,'Type',5378) - -InstallExecuteSequence = Table('InstallExecuteSequence') -InstallExecuteSequence.add_field(1,'Action',11592) -InstallExecuteSequence.add_field(2,'Condition',7679) -InstallExecuteSequence.add_field(3,'Sequence',5378) - -InstallUISequence = Table('InstallUISequence') -InstallUISequence.add_field(1,'Action',11592) -InstallUISequence.add_field(2,'Condition',7679) -InstallUISequence.add_field(3,'Sequence',5378) - -IsolatedComponent = Table('IsolatedComponent') -IsolatedComponent.add_field(1,'Component_Shared',11592) -IsolatedComponent.add_field(2,'Component_Application',11592) - -LaunchCondition = Table('LaunchCondition') -LaunchCondition.add_field(1,'Condition',11775) -LaunchCondition.add_field(2,'Description',4095) - -ListBox = Table('ListBox') -ListBox.add_field(1,'Property',11592) -ListBox.add_field(2,'Order',9474) -ListBox.add_field(3,'Value',3392) -ListBox.add_field(4,'Text',8000) - -ListView = Table('ListView') -ListView.add_field(1,'Property',11592) -ListView.add_field(2,'Order',9474) -ListView.add_field(3,'Value',3392) -ListView.add_field(4,'Text',8000) -ListView.add_field(5,'Binary_',7496) - -LockPermissions = Table('LockPermissions') -LockPermissions.add_field(1,'LockObject',11592) -LockPermissions.add_field(2,'Table',11552) -LockPermissions.add_field(3,'Domain',15871) -LockPermissions.add_field(4,'User',11775) -LockPermissions.add_field(5,'Permission',4356) - -Media = Table('Media') -Media.add_field(1,'DiskId',9474) -Media.add_field(2,'LastSequence',1282) -Media.add_field(3,'DiskPrompt',8000) -Media.add_field(4,'Cabinet',7679) -Media.add_field(5,'VolumeLabel',7456) -Media.add_field(6,'Source',7496) - -MoveFile = Table('MoveFile') -MoveFile.add_field(1,'FileKey',11592) -MoveFile.add_field(2,'Component_',3400) -MoveFile.add_field(3,'SourceName',8191) -MoveFile.add_field(4,'DestName',8191) -MoveFile.add_field(5,'SourceFolder',7496) -MoveFile.add_field(6,'DestFolder',3400) -MoveFile.add_field(7,'Options',1282) - -MsiAssembly = Table('MsiAssembly') -MsiAssembly.add_field(1,'Component_',11592) -MsiAssembly.add_field(2,'Feature_',3366) -MsiAssembly.add_field(3,'File_Manifest',7496) -MsiAssembly.add_field(4,'File_Application',7496) -MsiAssembly.add_field(5,'Attributes',5378) - -MsiAssemblyName = Table('MsiAssemblyName') -MsiAssemblyName.add_field(1,'Component_',11592) -MsiAssemblyName.add_field(2,'Name',11775) -MsiAssemblyName.add_field(3,'Value',3583) - -MsiDigitalCertificate = Table('MsiDigitalCertificate') -MsiDigitalCertificate.add_field(1,'DigitalCertificate',11592) -MsiDigitalCertificate.add_field(2,'CertData',2304) - -MsiDigitalSignature = Table('MsiDigitalSignature') -MsiDigitalSignature.add_field(1,'Table',11552) -MsiDigitalSignature.add_field(2,'SignObject',11592) -MsiDigitalSignature.add_field(3,'DigitalCertificate_',3400) -MsiDigitalSignature.add_field(4,'Hash',6400) - -MsiFileHash = Table('MsiFileHash') -MsiFileHash.add_field(1,'File_',11592) -MsiFileHash.add_field(2,'Options',1282) -MsiFileHash.add_field(3,'HashPart1',260) -MsiFileHash.add_field(4,'HashPart2',260) -MsiFileHash.add_field(5,'HashPart3',260) -MsiFileHash.add_field(6,'HashPart4',260) - -MsiPatchHeaders = Table('MsiPatchHeaders') -MsiPatchHeaders.add_field(1,'StreamRef',11558) -MsiPatchHeaders.add_field(2,'Header',2304) - -ODBCAttribute = Table('ODBCAttribute') -ODBCAttribute.add_field(1,'Driver_',11592) -ODBCAttribute.add_field(2,'Attribute',11560) -ODBCAttribute.add_field(3,'Value',8191) - -ODBCDriver = Table('ODBCDriver') -ODBCDriver.add_field(1,'Driver',11592) -ODBCDriver.add_field(2,'Component_',3400) -ODBCDriver.add_field(3,'Description',3583) -ODBCDriver.add_field(4,'File_',3400) -ODBCDriver.add_field(5,'File_Setup',7496) - -ODBCDataSource = Table('ODBCDataSource') -ODBCDataSource.add_field(1,'DataSource',11592) -ODBCDataSource.add_field(2,'Component_',3400) -ODBCDataSource.add_field(3,'Description',3583) -ODBCDataSource.add_field(4,'DriverDescription',3583) -ODBCDataSource.add_field(5,'Registration',1282) - -ODBCSourceAttribute = Table('ODBCSourceAttribute') -ODBCSourceAttribute.add_field(1,'DataSource_',11592) -ODBCSourceAttribute.add_field(2,'Attribute',11552) -ODBCSourceAttribute.add_field(3,'Value',8191) - -ODBCTranslator = Table('ODBCTranslator') -ODBCTranslator.add_field(1,'Translator',11592) -ODBCTranslator.add_field(2,'Component_',3400) -ODBCTranslator.add_field(3,'Description',3583) -ODBCTranslator.add_field(4,'File_',3400) -ODBCTranslator.add_field(5,'File_Setup',7496) - -Patch = Table('Patch') -Patch.add_field(1,'File_',11592) -Patch.add_field(2,'Sequence',9474) -Patch.add_field(3,'PatchSize',260) -Patch.add_field(4,'Attributes',1282) -Patch.add_field(5,'Header',6400) -Patch.add_field(6,'StreamRef_',7462) - -PatchPackage = Table('PatchPackage') -PatchPackage.add_field(1,'PatchId',11558) -PatchPackage.add_field(2,'Media_',1282) - -PublishComponent = Table('PublishComponent') -PublishComponent.add_field(1,'ComponentId',11558) -PublishComponent.add_field(2,'Qualifier',11775) -PublishComponent.add_field(3,'Component_',11592) -PublishComponent.add_field(4,'AppData',8191) -PublishComponent.add_field(5,'Feature_',3366) - -RadioButton = Table('RadioButton') -RadioButton.add_field(1,'Property',11592) -RadioButton.add_field(2,'Order',9474) -RadioButton.add_field(3,'Value',3392) -RadioButton.add_field(4,'X',1282) -RadioButton.add_field(5,'Y',1282) -RadioButton.add_field(6,'Width',1282) -RadioButton.add_field(7,'Height',1282) -RadioButton.add_field(8,'Text',8000) -RadioButton.add_field(9,'Help',7986) - -Registry = Table('Registry') -Registry.add_field(1,'Registry',11592) -Registry.add_field(2,'Root',1282) -Registry.add_field(3,'Key',4095) -Registry.add_field(4,'Name',8191) -Registry.add_field(5,'Value',7936) -Registry.add_field(6,'Component_',3400) - -RegLocator = Table('RegLocator') -RegLocator.add_field(1,'Signature_',11592) -RegLocator.add_field(2,'Root',1282) -RegLocator.add_field(3,'Key',3583) -RegLocator.add_field(4,'Name',7679) -RegLocator.add_field(5,'Type',5378) - -RemoveFile = Table('RemoveFile') -RemoveFile.add_field(1,'FileKey',11592) -RemoveFile.add_field(2,'Component_',3400) -RemoveFile.add_field(3,'FileName',8191) -RemoveFile.add_field(4,'DirProperty',3400) -RemoveFile.add_field(5,'InstallMode',1282) - -RemoveIniFile = Table('RemoveIniFile') -RemoveIniFile.add_field(1,'RemoveIniFile',11592) -RemoveIniFile.add_field(2,'FileName',4095) -RemoveIniFile.add_field(3,'DirProperty',7496) -RemoveIniFile.add_field(4,'Section',3936) -RemoveIniFile.add_field(5,'Key',3968) -RemoveIniFile.add_field(6,'Value',8191) -RemoveIniFile.add_field(7,'Action',1282) -RemoveIniFile.add_field(8,'Component_',3400) - -RemoveRegistry = Table('RemoveRegistry') -RemoveRegistry.add_field(1,'RemoveRegistry',11592) -RemoveRegistry.add_field(2,'Root',1282) -RemoveRegistry.add_field(3,'Key',4095) -RemoveRegistry.add_field(4,'Name',8191) -RemoveRegistry.add_field(5,'Component_',3400) - -ReserveCost = Table('ReserveCost') -ReserveCost.add_field(1,'ReserveKey',11592) -ReserveCost.add_field(2,'Component_',3400) -ReserveCost.add_field(3,'ReserveFolder',7496) -ReserveCost.add_field(4,'ReserveLocal',260) -ReserveCost.add_field(5,'ReserveSource',260) - -SelfReg = Table('SelfReg') -SelfReg.add_field(1,'File_',11592) -SelfReg.add_field(2,'Cost',5378) - -ServiceControl = Table('ServiceControl') -ServiceControl.add_field(1,'ServiceControl',11592) -ServiceControl.add_field(2,'Name',4095) -ServiceControl.add_field(3,'Event',1282) -ServiceControl.add_field(4,'Arguments',8191) -ServiceControl.add_field(5,'Wait',5378) -ServiceControl.add_field(6,'Component_',3400) - -ServiceInstall = Table('ServiceInstall') -ServiceInstall.add_field(1,'ServiceInstall',11592) -ServiceInstall.add_field(2,'Name',3583) -ServiceInstall.add_field(3,'DisplayName',8191) -ServiceInstall.add_field(4,'ServiceType',260) -ServiceInstall.add_field(5,'StartType',260) -ServiceInstall.add_field(6,'ErrorControl',260) -ServiceInstall.add_field(7,'LoadOrderGroup',7679) -ServiceInstall.add_field(8,'Dependencies',7679) -ServiceInstall.add_field(9,'StartName',7679) -ServiceInstall.add_field(10,'Password',7679) -ServiceInstall.add_field(11,'Arguments',7679) -ServiceInstall.add_field(12,'Component_',3400) -ServiceInstall.add_field(13,'Description',8191) - -Shortcut = Table('Shortcut') -Shortcut.add_field(1,'Shortcut',11592) -Shortcut.add_field(2,'Directory_',3400) -Shortcut.add_field(3,'Name',3968) -Shortcut.add_field(4,'Component_',3400) -Shortcut.add_field(5,'Target',3400) -Shortcut.add_field(6,'Arguments',7679) -Shortcut.add_field(7,'Description',8191) -Shortcut.add_field(8,'Hotkey',5378) -Shortcut.add_field(9,'Icon_',7496) -Shortcut.add_field(10,'IconIndex',5378) -Shortcut.add_field(11,'ShowCmd',5378) -Shortcut.add_field(12,'WkDir',7496) - -Signature = Table('Signature') -Signature.add_field(1,'Signature',11592) -Signature.add_field(2,'FileName',3583) -Signature.add_field(3,'MinVersion',7444) -Signature.add_field(4,'MaxVersion',7444) -Signature.add_field(5,'MinSize',4356) -Signature.add_field(6,'MaxSize',4356) -Signature.add_field(7,'MinDate',4356) -Signature.add_field(8,'MaxDate',4356) -Signature.add_field(9,'Languages',7679) - -TextStyle = Table('TextStyle') -TextStyle.add_field(1,'TextStyle',11592) -TextStyle.add_field(2,'FaceName',3360) -TextStyle.add_field(3,'Size',1282) -TextStyle.add_field(4,'Color',4356) -TextStyle.add_field(5,'StyleBits',5378) - -TypeLib = Table('TypeLib') -TypeLib.add_field(1,'LibID',11558) -TypeLib.add_field(2,'Language',9474) -TypeLib.add_field(3,'Component_',11592) -TypeLib.add_field(4,'Version',4356) -TypeLib.add_field(5,'Description',8064) -TypeLib.add_field(6,'Directory_',7496) -TypeLib.add_field(7,'Feature_',3366) -TypeLib.add_field(8,'Cost',4356) - -UIText = Table('UIText') -UIText.add_field(1,'Key',11592) -UIText.add_field(2,'Text',8191) - -Upgrade = Table('Upgrade') -Upgrade.add_field(1,'UpgradeCode',11558) -Upgrade.add_field(2,'VersionMin',15636) -Upgrade.add_field(3,'VersionMax',15636) -Upgrade.add_field(4,'Language',15871) -Upgrade.add_field(5,'Attributes',8452) -Upgrade.add_field(6,'Remove',7679) -Upgrade.add_field(7,'ActionProperty',3400) - -Verb = Table('Verb') -Verb.add_field(1,'Extension_',11775) -Verb.add_field(2,'Verb',11552) -Verb.add_field(3,'Sequence',5378) -Verb.add_field(4,'Command',8191) -Verb.add_field(5,'Argument',8191) - -tables=[_Validation, ActionText, AdminExecuteSequence, Condition, AdminUISequence, AdvtExecuteSequence, AdvtUISequence, AppId, AppSearch, Property, BBControl, Billboard, Feature, Binary, BindImage, File, CCPSearch, CheckBox, Class, Component, Icon, ProgId, ComboBox, CompLocator, Complus, Directory, Control, Dialog, ControlCondition, ControlEvent, CreateFolder, CustomAction, DrLocator, DuplicateFile, Environment, Error, EventMapping, Extension, MIME, FeatureComponents, FileSFPCatalog, SFPCatalog, Font, IniFile, IniLocator, InstallExecuteSequence, InstallUISequence, IsolatedComponent, LaunchCondition, ListBox, ListView, LockPermissions, Media, MoveFile, MsiAssembly, MsiAssemblyName, MsiDigitalCertificate, MsiDigitalSignature, MsiFileHash, MsiPatchHeaders, ODBCAttribute, ODBCDriver, ODBCDataSource, ODBCSourceAttribute, ODBCTranslator, Patch, PatchPackage, PublishComponent, RadioButton, Registry, RegLocator, RemoveFile, RemoveIniFile, RemoveRegistry, ReserveCost, SelfReg, ServiceControl, ServiceInstall, Shortcut, Signature, TextStyle, TypeLib, UIText, Upgrade, Verb] - -_Validation_records = [ -('_Validation','Table','N',None, None, None, None, 'Identifier',None, 'Name of table',), -('_Validation','Column','N',None, None, None, None, 'Identifier',None, 'Name of column',), -('_Validation','Description','Y',None, None, None, None, 'Text',None, 'Description of column',), -('_Validation','Set','Y',None, None, None, None, 'Text',None, 'Set of values that are permitted',), -('_Validation','Category','Y',None, None, None, None, None, 'Text;Formatted;Template;Condition;Guid;Path;Version;Language;Identifier;Binary;UpperCase;LowerCase;Filename;Paths;AnyPath;WildCardFilename;RegPath;KeyFormatted;CustomSource;Property;Cabinet;Shortcut;URL','String category',), -('_Validation','KeyColumn','Y',1,32,None, None, None, None, 'Column to which foreign key connects',), -('_Validation','KeyTable','Y',None, None, None, None, 'Identifier',None, 'For foreign key, Name of table to which data must link',), -('_Validation','MaxValue','Y',-2147483647,2147483647,None, None, None, None, 'Maximum value allowed',), -('_Validation','MinValue','Y',-2147483647,2147483647,None, None, None, None, 'Minimum value allowed',), -('_Validation','Nullable','N',None, None, None, None, None, 'Y;N;@','Whether the column is nullable',), -('ActionText','Description','Y',None, None, None, None, 'Text',None, 'Localized description displayed in progress dialog and log when action is executing.',), -('ActionText','Action','N',None, None, None, None, 'Identifier',None, 'Name of action to be described.',), -('ActionText','Template','Y',None, None, None, None, 'Template',None, 'Optional localized format template used to format action data records for display during action execution.',), -('AdminExecuteSequence','Action','N',None, None, None, None, 'Identifier',None, 'Name of action to invoke, either in the engine or the handler DLL.',), -('AdminExecuteSequence','Condition','Y',None, None, None, None, 'Condition',None, 'Optional expression which skips the action if evaluates to expFalse.If the expression syntax is invalid, the engine will terminate, returning iesBadActionData.',), -('AdminExecuteSequence','Sequence','Y',-4,32767,None, None, None, None, 'Number that determines the sort order in which the actions are to be executed. Leave blank to suppress action.',), -('Condition','Condition','Y',None, None, None, None, 'Condition',None, 'Expression evaluated to determine if Level in the Feature table is to change.',), -('Condition','Feature_','N',None, None, 'Feature',1,'Identifier',None, 'Reference to a Feature entry in Feature table.',), -('Condition','Level','N',0,32767,None, None, None, None, 'New selection Level to set in Feature table if Condition evaluates to TRUE.',), -('AdminUISequence','Action','N',None, None, None, None, 'Identifier',None, 'Name of action to invoke, either in the engine or the handler DLL.',), -('AdminUISequence','Condition','Y',None, None, None, None, 'Condition',None, 'Optional expression which skips the action if evaluates to expFalse.If the expression syntax is invalid, the engine will terminate, returning iesBadActionData.',), -('AdminUISequence','Sequence','Y',-4,32767,None, None, None, None, 'Number that determines the sort order in which the actions are to be executed. Leave blank to suppress action.',), -('AdvtExecuteSequence','Action','N',None, None, None, None, 'Identifier',None, 'Name of action to invoke, either in the engine or the handler DLL.',), -('AdvtExecuteSequence','Condition','Y',None, None, None, None, 'Condition',None, 'Optional expression which skips the action if evaluates to expFalse.If the expression syntax is invalid, the engine will terminate, returning iesBadActionData.',), -('AdvtExecuteSequence','Sequence','Y',-4,32767,None, None, None, None, 'Number that determines the sort order in which the actions are to be executed. Leave blank to suppress action.',), -('AdvtUISequence','Action','N',None, None, None, None, 'Identifier',None, 'Name of action to invoke, either in the engine or the handler DLL.',), -('AdvtUISequence','Condition','Y',None, None, None, None, 'Condition',None, 'Optional expression which skips the action if evaluates to expFalse.If the expression syntax is invalid, the engine will terminate, returning iesBadActionData.',), -('AdvtUISequence','Sequence','Y',-4,32767,None, None, None, None, 'Number that determines the sort order in which the actions are to be executed. Leave blank to suppress action.',), -('AppId','AppId','N',None, None, None, None, 'Guid',None, None, ), -('AppId','ActivateAtStorage','Y',0,1,None, None, None, None, None, ), -('AppId','DllSurrogate','Y',None, None, None, None, 'Text',None, None, ), -('AppId','LocalService','Y',None, None, None, None, 'Text',None, None, ), -('AppId','RemoteServerName','Y',None, None, None, None, 'Formatted',None, None, ), -('AppId','RunAsInteractiveUser','Y',0,1,None, None, None, None, None, ), -('AppId','ServiceParameters','Y',None, None, None, None, 'Text',None, None, ), -('AppSearch','Property','N',None, None, None, None, 'Identifier',None, 'The property associated with a Signature',), -('AppSearch','Signature_','N',None, None, 'Signature;RegLocator;IniLocator;DrLocator;CompLocator',1,'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature, RegLocator, IniLocator, CompLocator and the DrLocator tables.',), -('Property','Property','N',None, None, None, None, 'Identifier',None, 'Name of property, uppercase if settable by launcher or loader.',), -('Property','Value','N',None, None, None, None, 'Text',None, 'String value for property. Never null or empty.',), -('BBControl','Type','N',None, None, None, None, 'Identifier',None, 'The type of the control.',), -('BBControl','Y','N',0,32767,None, None, None, None, 'Vertical coordinate of the upper left corner of the bounding rectangle of the control.',), -('BBControl','Text','Y',None, None, None, None, 'Text',None, 'A string used to set the initial text contained within a control (if appropriate).',), -('BBControl','BBControl','N',None, None, None, None, 'Identifier',None, 'Name of the control. This name must be unique within a billboard, but can repeat on different billboard.',), -('BBControl','Attributes','Y',0,2147483647,None, None, None, None, 'A 32-bit word that specifies the attribute flags to be applied to this control.',), -('BBControl','Billboard_','N',None, None, 'Billboard',1,'Identifier',None, 'External key to the Billboard table, name of the billboard.',), -('BBControl','Height','N',0,32767,None, None, None, None, 'Height of the bounding rectangle of the control.',), -('BBControl','Width','N',0,32767,None, None, None, None, 'Width of the bounding rectangle of the control.',), -('BBControl','X','N',0,32767,None, None, None, None, 'Horizontal coordinate of the upper left corner of the bounding rectangle of the control.',), -('Billboard','Action','Y',None, None, None, None, 'Identifier',None, 'The name of an action. The billboard is displayed during the progress messages received from this action.',), -('Billboard','Billboard','N',None, None, None, None, 'Identifier',None, 'Name of the billboard.',), -('Billboard','Feature_','N',None, None, 'Feature',1,'Identifier',None, 'An external key to the Feature Table. The billboard is shown only if this feature is being installed.',), -('Billboard','Ordering','Y',0,32767,None, None, None, None, 'A positive integer. If there is more than one billboard corresponding to an action they will be shown in the order defined by this column.',), -('Feature','Description','Y',None, None, None, None, 'Text',None, 'Longer descriptive text describing a visible feature item.',), -('Feature','Attributes','N',None, None, None, None, None, '0;1;2;4;5;6;8;9;10;16;17;18;20;21;22;24;25;26;32;33;34;36;37;38;48;49;50;52;53;54','Feature attributes',), -('Feature','Feature','N',None, None, None, None, 'Identifier',None, 'Primary key used to identify a particular feature record.',), -('Feature','Directory_','Y',None, None, 'Directory',1,'UpperCase',None, 'The name of the Directory that can be configured by the UI. A non-null value will enable the browse button.',), -('Feature','Level','N',0,32767,None, None, None, None, 'The install level at which record will be initially selected. An install level of 0 will disable an item and prevent its display.',), -('Feature','Title','Y',None, None, None, None, 'Text',None, 'Short text identifying a visible feature item.',), -('Feature','Display','Y',0,32767,None, None, None, None, 'Numeric sort order, used to force a specific display ordering.',), -('Feature','Feature_Parent','Y',None, None, 'Feature',1,'Identifier',None, 'Optional key of a parent record in the same table. If the parent is not selected, then the record will not be installed. Null indicates a root item.',), -('Binary','Name','N',None, None, None, None, 'Identifier',None, 'Unique key identifying the binary data.',), -('Binary','Data','N',None, None, None, None, 'Binary',None, 'The unformatted binary data.',), -('BindImage','File_','N',None, None, 'File',1,'Identifier',None, 'The index into the File table. This must be an executable file.',), -('BindImage','Path','Y',None, None, None, None, 'Paths',None, 'A list of ; delimited paths that represent the paths to be searched for the import DLLS. The list is usually a list of properties each enclosed within square brackets [] .',), -('File','Sequence','N',1,32767,None, None, None, None, 'Sequence with respect to the media images; order must track cabinet order.',), -('File','Attributes','Y',0,32767,None, None, None, None, 'Integer containing bit flags representing file attributes (with the decimal value of each bit position in parentheses)',), -('File','File','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token, must match identifier in cabinet. For uncompressed files, this field is ignored.',), -('File','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key referencing Component that controls the file.',), -('File','FileName','N',None, None, None, None, 'Filename',None, 'File name used for installation, may be localized. This may contain a "short name|long name" pair.',), -('File','FileSize','N',0,2147483647,None, None, None, None, 'Size of file in bytes (integer).',), -('File','Language','Y',None, None, None, None, 'Language',None, 'List of decimal language Ids, comma-separated if more than one.',), -('File','Version','Y',None, None, 'File',1,'Version',None, 'Version string for versioned files; Blank for unversioned files.',), -('CCPSearch','Signature_','N',None, None, 'Signature;RegLocator;IniLocator;DrLocator;CompLocator',1,'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature, RegLocator, IniLocator, CompLocator and the DrLocator tables.',), -('CheckBox','Property','N',None, None, None, None, 'Identifier',None, 'A named property to be tied to the item.',), -('CheckBox','Value','Y',None, None, None, None, 'Formatted',None, 'The value string associated with the item.',), -('Class','Description','Y',None, None, None, None, 'Text',None, 'Localized description for the Class.',), -('Class','Attributes','Y',None, 32767,None, None, None, None, 'Class registration attributes.',), -('Class','Feature_','N',None, None, 'Feature',1,'Identifier',None, 'Required foreign key into the Feature Table, specifying the feature to validate or install in order for the CLSID factory to be operational.',), -('Class','AppId_','Y',None, None, 'AppId',1,'Guid',None, 'Optional AppID containing DCOM information for associated application (string GUID).',), -('Class','Argument','Y',None, None, None, None, 'Formatted',None, 'optional argument for LocalServers.',), -('Class','CLSID','N',None, None, None, None, 'Guid',None, 'The CLSID of an OLE factory.',), -('Class','Component_','N',None, None, 'Component',1,'Identifier',None, 'Required foreign key into the Component Table, specifying the component for which to return a path when called through LocateComponent.',), -('Class','Context','N',None, None, None, None, 'Identifier',None, 'The numeric server context for this server. CLSCTX_xxxx',), -('Class','DefInprocHandler','Y',None, None, None, None, 'Filename','1;2;3','Optional default inproc handler. Only optionally provided if Context=CLSCTX_LOCAL_SERVER. Typically "ole32.dll" or "mapi32.dll"',), -('Class','FileTypeMask','Y',None, None, None, None, 'Text',None, 'Optional string containing information for the HKCRthis CLSID key. If multiple patterns exist, they must be delimited by a semicolon, and numeric subkeys will be generated: 0,1,2...',), -('Class','Icon_','Y',None, None, 'Icon',1,'Identifier',None, 'Optional foreign key into the Icon Table, specifying the icon file associated with this CLSID. Will be written under the DefaultIcon key.',), -('Class','IconIndex','Y',-32767,32767,None, None, None, None, 'Optional icon index.',), -('Class','ProgId_Default','Y',None, None, 'ProgId',1,'Text',None, 'Optional ProgId associated with this CLSID.',), -('Component','Condition','Y',None, None, None, None, 'Condition',None, "A conditional statement that will disable this component if the specified condition evaluates to the 'True' state. If a component is disabled, it will not be installed, regardless of the 'Action' state associated with the component.",), -('Component','Attributes','N',None, None, None, None, None, None, 'Remote execution option, one of irsEnum',), -('Component','Component','N',None, None, None, None, 'Identifier',None, 'Primary key used to identify a particular component record.',), -('Component','ComponentId','Y',None, None, None, None, 'Guid',None, 'A string GUID unique to this component, version, and language.',), -('Component','Directory_','N',None, None, 'Directory',1,'Identifier',None, 'Required key of a Directory table record. This is actually a property name whose value contains the actual path, set either by the AppSearch action or with the default setting obtained from the Directory table.',), -('Component','KeyPath','Y',None, None, 'File;Registry;ODBCDataSource',1,'Identifier',None, 'Either the primary key into the File table, Registry table, or ODBCDataSource table. This extract path is stored when the component is installed, and is used to detect the presence of the component and to return the path to it.',), -('Icon','Name','N',None, None, None, None, 'Identifier',None, 'Primary key. Name of the icon file.',), -('Icon','Data','N',None, None, None, None, 'Binary',None, 'Binary stream. The binary icon data in PE (.DLL or .EXE) or icon (.ICO) format.',), -('ProgId','Description','Y',None, None, None, None, 'Text',None, 'Localized description for the Program identifier.',), -('ProgId','Icon_','Y',None, None, 'Icon',1,'Identifier',None, 'Optional foreign key into the Icon Table, specifying the icon file associated with this ProgId. Will be written under the DefaultIcon key.',), -('ProgId','IconIndex','Y',-32767,32767,None, None, None, None, 'Optional icon index.',), -('ProgId','ProgId','N',None, None, None, None, 'Text',None, 'The Program Identifier. Primary key.',), -('ProgId','Class_','Y',None, None, 'Class',1,'Guid',None, 'The CLSID of an OLE factory corresponding to the ProgId.',), -('ProgId','ProgId_Parent','Y',None, None, 'ProgId',1,'Text',None, 'The Parent Program Identifier. If specified, the ProgId column becomes a version independent prog id.',), -('ComboBox','Text','Y',None, None, None, None, 'Formatted',None, 'The visible text to be assigned to the item. Optional. If this entry or the entire column is missing, the text is the same as the value.',), -('ComboBox','Property','N',None, None, None, None, 'Identifier',None, 'A named property to be tied to this item. All the items tied to the same property become part of the same combobox.',), -('ComboBox','Value','N',None, None, None, None, 'Formatted',None, 'The value string associated with this item. Selecting the line will set the associated property to this value.',), -('ComboBox','Order','N',1,32767,None, None, None, None, 'A positive integer used to determine the ordering of the items within one list.\tThe integers do not have to be consecutive.',), -('CompLocator','Type','Y',0,1,None, None, None, None, 'A boolean value that determines if the registry value is a filename or a directory location.',), -('CompLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The table key. The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',), -('CompLocator','ComponentId','N',None, None, None, None, 'Guid',None, 'A string GUID unique to this component, version, and language.',), -('Complus','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key referencing Component that controls the ComPlus component.',), -('Complus','ExpType','Y',0,32767,None, None, None, None, 'ComPlus component attributes.',), -('Directory','Directory','N',None, None, None, None, 'Identifier',None, 'Unique identifier for directory entry, primary key. If a property by this name is defined, it contains the full path to the directory.',), -('Directory','DefaultDir','N',None, None, None, None, 'DefaultDir',None, "The default sub-path under parent's path.",), -('Directory','Directory_Parent','Y',None, None, 'Directory',1,'Identifier',None, 'Reference to the entry in this table specifying the default parent directory. A record parented to itself or with a Null parent represents a root of the install tree.',), -('Control','Type','N',None, None, None, None, 'Identifier',None, 'The type of the control.',), -('Control','Y','N',0,32767,None, None, None, None, 'Vertical coordinate of the upper left corner of the bounding rectangle of the control.',), -('Control','Text','Y',None, None, None, None, 'Formatted',None, 'A string used to set the initial text contained within a control (if appropriate).',), -('Control','Property','Y',None, None, None, None, 'Identifier',None, 'The name of a defined property to be linked to this control. ',), -('Control','Attributes','Y',0,2147483647,None, None, None, None, 'A 32-bit word that specifies the attribute flags to be applied to this control.',), -('Control','Height','N',0,32767,None, None, None, None, 'Height of the bounding rectangle of the control.',), -('Control','Width','N',0,32767,None, None, None, None, 'Width of the bounding rectangle of the control.',), -('Control','X','N',0,32767,None, None, None, None, 'Horizontal coordinate of the upper left corner of the bounding rectangle of the control.',), -('Control','Control','N',None, None, None, None, 'Identifier',None, 'Name of the control. This name must be unique within a dialog, but can repeat on different dialogs. ',), -('Control','Control_Next','Y',None, None, 'Control',2,'Identifier',None, 'The name of an other control on the same dialog. This link defines the tab order of the controls. The links have to form one or more cycles!',), -('Control','Dialog_','N',None, None, 'Dialog',1,'Identifier',None, 'External key to the Dialog table, name of the dialog.',), -('Control','Help','Y',None, None, None, None, 'Text',None, 'The help strings used with the button. The text is optional. ',), -('Dialog','Attributes','Y',0,2147483647,None, None, None, None, 'A 32-bit word that specifies the attribute flags to be applied to this dialog.',), -('Dialog','Height','N',0,32767,None, None, None, None, 'Height of the bounding rectangle of the dialog.',), -('Dialog','Width','N',0,32767,None, None, None, None, 'Width of the bounding rectangle of the dialog.',), -('Dialog','Dialog','N',None, None, None, None, 'Identifier',None, 'Name of the dialog.',), -('Dialog','Control_Cancel','Y',None, None, 'Control',2,'Identifier',None, 'Defines the cancel control. Hitting escape or clicking on the close icon on the dialog is equivalent to pushing this button.',), -('Dialog','Control_Default','Y',None, None, 'Control',2,'Identifier',None, 'Defines the default control. Hitting return is equivalent to pushing this button.',), -('Dialog','Control_First','N',None, None, 'Control',2,'Identifier',None, 'Defines the control that has the focus when the dialog is created.',), -('Dialog','HCentering','N',0,100,None, None, None, None, 'Horizontal position of the dialog on a 0-100 scale. 0 means left end, 100 means right end of the screen, 50 center.',), -('Dialog','Title','Y',None, None, None, None, 'Formatted',None, "A text string specifying the title to be displayed in the title bar of the dialog's window.",), -('Dialog','VCentering','N',0,100,None, None, None, None, 'Vertical position of the dialog on a 0-100 scale. 0 means top end, 100 means bottom end of the screen, 50 center.',), -('ControlCondition','Action','N',None, None, None, None, None, 'Default;Disable;Enable;Hide;Show','The desired action to be taken on the specified control.',), -('ControlCondition','Condition','N',None, None, None, None, 'Condition',None, 'A standard conditional statement that specifies under which conditions the action should be triggered.',), -('ControlCondition','Dialog_','N',None, None, 'Dialog',1,'Identifier',None, 'A foreign key to the Dialog table, name of the dialog.',), -('ControlCondition','Control_','N',None, None, 'Control',2,'Identifier',None, 'A foreign key to the Control table, name of the control.',), -('ControlEvent','Condition','Y',None, None, None, None, 'Condition',None, 'A standard conditional statement that specifies under which conditions an event should be triggered.',), -('ControlEvent','Ordering','Y',0,2147483647,None, None, None, None, 'An integer used to order several events tied to the same control. Can be left blank.',), -('ControlEvent','Argument','N',None, None, None, None, 'Formatted',None, 'A value to be used as a modifier when triggering a particular event.',), -('ControlEvent','Dialog_','N',None, None, 'Dialog',1,'Identifier',None, 'A foreign key to the Dialog table, name of the dialog.',), -('ControlEvent','Control_','N',None, None, 'Control',2,'Identifier',None, 'A foreign key to the Control table, name of the control',), -('ControlEvent','Event','N',None, None, None, None, 'Formatted',None, 'An identifier that specifies the type of the event that should take place when the user interacts with control specified by the first two entries.',), -('CreateFolder','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into the Component table.',), -('CreateFolder','Directory_','N',None, None, 'Directory',1,'Identifier',None, 'Primary key, could be foreign key into the Directory table.',), -('CustomAction','Type','N',1,16383,None, None, None, None, 'The numeric custom action type, consisting of source location, code type, entry, option flags.',), -('CustomAction','Action','N',None, None, None, None, 'Identifier',None, 'Primary key, name of action, normally appears in sequence table unless private use.',), -('CustomAction','Source','Y',None, None, None, None, 'CustomSource',None, 'The table reference of the source of the code.',), -('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Execution parameter, depends on the type of custom action',), -('DrLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',), -('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',), -('DrLocator','Depth','Y',0,32767,None, None, None, None, 'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',), -('DrLocator','Parent','Y',None, None, None, None, 'Identifier',None, 'The parent file signature. It is also a foreign key in the Signature table. If null and the Path column does not expand to a full path, then all the fixed drives of the user system are searched using the Path.',), -('DuplicateFile','File_','N',None, None, 'File',1,'Identifier',None, 'Foreign key referencing the source file to be duplicated.',), -('DuplicateFile','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key referencing Component that controls the duplicate file.',), -('DuplicateFile','DestFolder','Y',None, None, None, None, 'Identifier',None, 'Name of a property whose value is assumed to resolve to the full pathname to a destination folder.',), -('DuplicateFile','DestName','Y',None, None, None, None, 'Filename',None, 'Filename to be given to the duplicate file.',), -('DuplicateFile','FileKey','N',None, None, None, None, 'Identifier',None, 'Primary key used to identify a particular file entry',), -('Environment','Name','N',None, None, None, None, 'Text',None, 'The name of the environmental value.',), -('Environment','Value','Y',None, None, None, None, 'Formatted',None, 'The value to set in the environmental settings.',), -('Environment','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into the Component table referencing component that controls the installing of the environmental value.',), -('Environment','Environment','N',None, None, None, None, 'Identifier',None, 'Unique identifier for the environmental variable setting',), -('Error','Error','N',0,32767,None, None, None, None, 'Integer error number, obtained from header file IError(...) macros.',), -('Error','Message','Y',None, None, None, None, 'Template',None, 'Error formatting template, obtained from user ed. or localizers.',), -('EventMapping','Dialog_','N',None, None, 'Dialog',1,'Identifier',None, 'A foreign key to the Dialog table, name of the Dialog.',), -('EventMapping','Control_','N',None, None, 'Control',2,'Identifier',None, 'A foreign key to the Control table, name of the control.',), -('EventMapping','Event','N',None, None, None, None, 'Identifier',None, 'An identifier that specifies the type of the event that the control subscribes to.',), -('EventMapping','Attribute','N',None, None, None, None, 'Identifier',None, 'The name of the control attribute, that is set when this event is received.',), -('Extension','Feature_','N',None, None, 'Feature',1,'Identifier',None, 'Required foreign key into the Feature Table, specifying the feature to validate or install in order for the CLSID factory to be operational.',), -('Extension','Component_','N',None, None, 'Component',1,'Identifier',None, 'Required foreign key into the Component Table, specifying the component for which to return a path when called through LocateComponent.',), -('Extension','Extension','N',None, None, None, None, 'Text',None, 'The extension associated with the table row.',), -('Extension','MIME_','Y',None, None, 'MIME',1,'Text',None, 'Optional Context identifier, typically "type/format" associated with the extension',), -('Extension','ProgId_','Y',None, None, 'ProgId',1,'Text',None, 'Optional ProgId associated with this extension.',), -('MIME','CLSID','Y',None, None, None, None, 'Guid',None, 'Optional associated CLSID.',), -('MIME','ContentType','N',None, None, None, None, 'Text',None, 'Primary key. Context identifier, typically "type/format".',), -('MIME','Extension_','N',None, None, 'Extension',1,'Text',None, 'Optional associated extension (without dot)',), -('FeatureComponents','Feature_','N',None, None, 'Feature',1,'Identifier',None, 'Foreign key into Feature table.',), -('FeatureComponents','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into Component table.',), -('FileSFPCatalog','File_','N',None, None, 'File',1,'Identifier',None, 'File associated with the catalog',), -('FileSFPCatalog','SFPCatalog_','N',None, None, 'SFPCatalog',1,'Filename',None, 'Catalog associated with the file',), -('SFPCatalog','SFPCatalog','N',None, None, None, None, 'Filename',None, 'File name for the catalog.',), -('SFPCatalog','Catalog','N',None, None, None, None, 'Binary',None, 'SFP Catalog',), -('SFPCatalog','Dependency','Y',None, None, None, None, 'Formatted',None, 'Parent catalog - only used by SFP',), -('Font','File_','N',None, None, 'File',1,'Identifier',None, 'Primary key, foreign key into File table referencing font file.',), -('Font','FontTitle','Y',None, None, None, None, 'Text',None, 'Font name.',), -('IniFile','Action','N',None, None, None, None, None, '0;1;3','The type of modification to be made, one of iifEnum',), -('IniFile','Value','N',None, None, None, None, 'Formatted',None, 'The value to be written.',), -('IniFile','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into the Component table referencing component that controls the installing of the .INI value.',), -('IniFile','FileName','N',None, None, None, None, 'Filename',None, 'The .INI file name in which to write the information',), -('IniFile','IniFile','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token.',), -('IniFile','DirProperty','Y',None, None, None, None, 'Identifier',None, 'Foreign key into the Directory table denoting the directory where the .INI file is.',), -('IniFile','Key','N',None, None, None, None, 'Formatted',None, 'The .INI file key below Section.',), -('IniFile','Section','N',None, None, None, None, 'Formatted',None, 'The .INI file Section.',), -('IniLocator','Type','Y',0,2,None, None, None, None, 'An integer value that determines if the .INI value read is a filename or a directory location or to be used as is w/o interpretation.',), -('IniLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The table key. The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',), -('IniLocator','FileName','N',None, None, None, None, 'Filename',None, 'The .INI file name.',), -('IniLocator','Key','N',None, None, None, None, 'Text',None, 'Key value (followed by an equals sign in INI file).',), -('IniLocator','Section','N',None, None, None, None, 'Text',None, 'Section name within in file (within square brackets in INI file).',), -('IniLocator','Field','Y',0,32767,None, None, None, None, 'The field in the .INI line. If Field is null or 0 the entire line is read.',), -('InstallExecuteSequence','Action','N',None, None, None, None, 'Identifier',None, 'Name of action to invoke, either in the engine or the handler DLL.',), -('InstallExecuteSequence','Condition','Y',None, None, None, None, 'Condition',None, 'Optional expression which skips the action if evaluates to expFalse.If the expression syntax is invalid, the engine will terminate, returning iesBadActionData.',), -('InstallExecuteSequence','Sequence','Y',-4,32767,None, None, None, None, 'Number that determines the sort order in which the actions are to be executed. Leave blank to suppress action.',), -('InstallUISequence','Action','N',None, None, None, None, 'Identifier',None, 'Name of action to invoke, either in the engine or the handler DLL.',), -('InstallUISequence','Condition','Y',None, None, None, None, 'Condition',None, 'Optional expression which skips the action if evaluates to expFalse.If the expression syntax is invalid, the engine will terminate, returning iesBadActionData.',), -('InstallUISequence','Sequence','Y',-4,32767,None, None, None, None, 'Number that determines the sort order in which the actions are to be executed. Leave blank to suppress action.',), -('IsolatedComponent','Component_Application','N',None, None, 'Component',1,'Identifier',None, 'Key to Component table item for application',), -('IsolatedComponent','Component_Shared','N',None, None, 'Component',1,'Identifier',None, 'Key to Component table item to be isolated',), -('LaunchCondition','Description','N',None, None, None, None, 'Formatted',None, 'Localizable text to display when condition fails and install must abort.',), -('LaunchCondition','Condition','N',None, None, None, None, 'Condition',None, 'Expression which must evaluate to TRUE in order for install to commence.',), -('ListBox','Text','Y',None, None, None, None, 'Text',None, 'The visible text to be assigned to the item. Optional. If this entry or the entire column is missing, the text is the same as the value.',), -('ListBox','Property','N',None, None, None, None, 'Identifier',None, 'A named property to be tied to this item. All the items tied to the same property become part of the same listbox.',), -('ListBox','Value','N',None, None, None, None, 'Formatted',None, 'The value string associated with this item. Selecting the line will set the associated property to this value.',), -('ListBox','Order','N',1,32767,None, None, None, None, 'A positive integer used to determine the ordering of the items within one list..The integers do not have to be consecutive.',), -('ListView','Text','Y',None, None, None, None, 'Text',None, 'The visible text to be assigned to the item. Optional. If this entry or the entire column is missing, the text is the same as the value.',), -('ListView','Property','N',None, None, None, None, 'Identifier',None, 'A named property to be tied to this item. All the items tied to the same property become part of the same listview.',), -('ListView','Value','N',None, None, None, None, 'Identifier',None, 'The value string associated with this item. Selecting the line will set the associated property to this value.',), -('ListView','Order','N',1,32767,None, None, None, None, 'A positive integer used to determine the ordering of the items within one list..The integers do not have to be consecutive.',), -('ListView','Binary_','Y',None, None, 'Binary',1,'Identifier',None, 'The name of the icon to be displayed with the icon. The binary information is looked up from the Binary Table.',), -('LockPermissions','Table','N',None, None, None, None, 'Identifier','Directory;File;Registry','Reference to another table name',), -('LockPermissions','Domain','Y',None, None, None, None, 'Formatted',None, 'Domain name for user whose permissions are being set. (usually a property)',), -('LockPermissions','LockObject','N',None, None, None, None, 'Identifier',None, 'Foreign key into Registry or File table',), -('LockPermissions','Permission','Y',-2147483647,2147483647,None, None, None, None, 'Permission Access mask. Full Control = 268435456 (GENERIC_ALL = 0x10000000)',), -('LockPermissions','User','N',None, None, None, None, 'Formatted',None, 'User for permissions to be set. (usually a property)',), -('Media','Source','Y',None, None, None, None, 'Property',None, 'The property defining the location of the cabinet file.',), -('Media','Cabinet','Y',None, None, None, None, 'Cabinet',None, 'If some or all of the files stored on the media are compressed in a cabinet, the name of that cabinet.',), -('Media','DiskId','N',1,32767,None, None, None, None, 'Primary key, integer to determine sort order for table.',), -('Media','DiskPrompt','Y',None, None, None, None, 'Text',None, 'Disk name: the visible text actually printed on the disk. This will be used to prompt the user when this disk needs to be inserted.',), -('Media','LastSequence','N',0,32767,None, None, None, None, 'File sequence number for the last file for this media.',), -('Media','VolumeLabel','Y',None, None, None, None, 'Text',None, 'The label attributed to the volume.',), -('ModuleComponents','Component','N',None, None, 'Component',1,'Identifier',None, 'Component contained in the module.',), -('ModuleComponents','Language','N',None, None, 'ModuleSignature',2,None, None, 'Default language ID for module (may be changed by transform).',), -('ModuleComponents','ModuleID','N',None, None, 'ModuleSignature',1,'Identifier',None, 'Module containing the component.',), -('ModuleSignature','Language','N',None, None, None, None, None, None, 'Default decimal language of module.',), -('ModuleSignature','Version','N',None, None, None, None, 'Version',None, 'Version of the module.',), -('ModuleSignature','ModuleID','N',None, None, None, None, 'Identifier',None, 'Module identifier (String.GUID).',), -('ModuleDependency','ModuleID','N',None, None, 'ModuleSignature',1,'Identifier',None, 'Module requiring the dependency.',), -('ModuleDependency','ModuleLanguage','N',None, None, 'ModuleSignature',2,None, None, 'Language of module requiring the dependency.',), -('ModuleDependency','RequiredID','N',None, None, None, None, None, None, 'String.GUID of required module.',), -('ModuleDependency','RequiredLanguage','N',None, None, None, None, None, None, 'LanguageID of the required module.',), -('ModuleDependency','RequiredVersion','Y',None, None, None, None, 'Version',None, 'Version of the required version.',), -('ModuleExclusion','ModuleID','N',None, None, 'ModuleSignature',1,'Identifier',None, 'String.GUID of module with exclusion requirement.',), -('ModuleExclusion','ModuleLanguage','N',None, None, 'ModuleSignature',2,None, None, 'LanguageID of module with exclusion requirement.',), -('ModuleExclusion','ExcludedID','N',None, None, None, None, None, None, 'String.GUID of excluded module.',), -('ModuleExclusion','ExcludedLanguage','N',None, None, None, None, None, None, 'Language of excluded module.',), -('ModuleExclusion','ExcludedMaxVersion','Y',None, None, None, None, 'Version',None, 'Maximum version of excluded module.',), -('ModuleExclusion','ExcludedMinVersion','Y',None, None, None, None, 'Version',None, 'Minimum version of excluded module.',), -('MoveFile','Component_','N',None, None, 'Component',1,'Identifier',None, 'If this component is not "selected" for installation or removal, no action will be taken on the associated MoveFile entry',), -('MoveFile','DestFolder','N',None, None, None, None, 'Identifier',None, 'Name of a property whose value is assumed to resolve to the full path to the destination directory',), -('MoveFile','DestName','Y',None, None, None, None, 'Filename',None, 'Name to be given to the original file after it is moved or copied. If blank, the destination file will be given the same name as the source file',), -('MoveFile','FileKey','N',None, None, None, None, 'Identifier',None, 'Primary key that uniquely identifies a particular MoveFile record',), -('MoveFile','Options','N',0,1,None, None, None, None, 'Integer value specifying the MoveFile operating mode, one of imfoEnum',), -('MoveFile','SourceFolder','Y',None, None, None, None, 'Identifier',None, 'Name of a property whose value is assumed to resolve to the full path to the source directory',), -('MoveFile','SourceName','Y',None, None, None, None, 'Text',None, "Name of the source file(s) to be moved or copied. Can contain the '*' or '?' wildcards.",), -('MsiAssembly','Attributes','Y',None, None, None, None, None, None, 'Assembly attributes',), -('MsiAssembly','Feature_','N',None, None, 'Feature',1,'Identifier',None, 'Foreign key into Feature table.',), -('MsiAssembly','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into Component table.',), -('MsiAssembly','File_Application','Y',None, None, 'File',1,'Identifier',None, 'Foreign key into File table, denoting the application context for private assemblies. Null for global assemblies.',), -('MsiAssembly','File_Manifest','Y',None, None, 'File',1,'Identifier',None, 'Foreign key into the File table denoting the manifest file for the assembly.',), -('MsiAssemblyName','Name','N',None, None, None, None, 'Text',None, 'The name part of the name-value pairs for the assembly name.',), -('MsiAssemblyName','Value','N',None, None, None, None, 'Text',None, 'The value part of the name-value pairs for the assembly name.',), -('MsiAssemblyName','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into Component table.',), -('MsiDigitalCertificate','CertData','N',None, None, None, None, 'Binary',None, 'A certificate context blob for a signer certificate',), -('MsiDigitalCertificate','DigitalCertificate','N',None, None, None, None, 'Identifier',None, 'A unique identifier for the row',), -('MsiDigitalSignature','Table','N',None, None, None, None, None, 'Media','Reference to another table name (only Media table is supported)',), -('MsiDigitalSignature','DigitalCertificate_','N',None, None, 'MsiDigitalCertificate',1,'Identifier',None, 'Foreign key to MsiDigitalCertificate table identifying the signer certificate',), -('MsiDigitalSignature','Hash','Y',None, None, None, None, 'Binary',None, 'The encoded hash blob from the digital signature',), -('MsiDigitalSignature','SignObject','N',None, None, None, None, 'Text',None, 'Foreign key to Media table',), -('MsiFileHash','File_','N',None, None, 'File',1,'Identifier',None, 'Primary key, foreign key into File table referencing file with this hash',), -('MsiFileHash','Options','N',0,32767,None, None, None, None, 'Various options and attributes for this hash.',), -('MsiFileHash','HashPart1','N',None, None, None, None, None, None, 'Size of file in bytes (integer).',), -('MsiFileHash','HashPart2','N',None, None, None, None, None, None, 'Size of file in bytes (integer).',), -('MsiFileHash','HashPart3','N',None, None, None, None, None, None, 'Size of file in bytes (integer).',), -('MsiFileHash','HashPart4','N',None, None, None, None, None, None, 'Size of file in bytes (integer).',), -('MsiPatchHeaders','StreamRef','N',None, None, None, None, 'Identifier',None, 'Primary key. A unique identifier for the row.',), -('MsiPatchHeaders','Header','N',None, None, None, None, 'Binary',None, 'Binary stream. The patch header, used for patch validation.',), -('ODBCAttribute','Value','Y',None, None, None, None, 'Text',None, 'Value for ODBC driver attribute',), -('ODBCAttribute','Attribute','N',None, None, None, None, 'Text',None, 'Name of ODBC driver attribute',), -('ODBCAttribute','Driver_','N',None, None, 'ODBCDriver',1,'Identifier',None, 'Reference to ODBC driver in ODBCDriver table',), -('ODBCDriver','Description','N',None, None, None, None, 'Text',None, 'Text used as registered name for driver, non-localized',), -('ODBCDriver','File_','N',None, None, 'File',1,'Identifier',None, 'Reference to key driver file',), -('ODBCDriver','Component_','N',None, None, 'Component',1,'Identifier',None, 'Reference to associated component',), -('ODBCDriver','Driver','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized.internal token for driver',), -('ODBCDriver','File_Setup','Y',None, None, 'File',1,'Identifier',None, 'Optional reference to key driver setup DLL',), -('ODBCDataSource','Description','N',None, None, None, None, 'Text',None, 'Text used as registered name for data source',), -('ODBCDataSource','Component_','N',None, None, 'Component',1,'Identifier',None, 'Reference to associated component',), -('ODBCDataSource','DataSource','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized.internal token for data source',), -('ODBCDataSource','DriverDescription','N',None, None, None, None, 'Text',None, 'Reference to driver description, may be existing driver',), -('ODBCDataSource','Registration','N',0,1,None, None, None, None, 'Registration option: 0=machine, 1=user, others t.b.d.',), -('ODBCSourceAttribute','Value','Y',None, None, None, None, 'Text',None, 'Value for ODBC data source attribute',), -('ODBCSourceAttribute','Attribute','N',None, None, None, None, 'Text',None, 'Name of ODBC data source attribute',), -('ODBCSourceAttribute','DataSource_','N',None, None, 'ODBCDataSource',1,'Identifier',None, 'Reference to ODBC data source in ODBCDataSource table',), -('ODBCTranslator','Description','N',None, None, None, None, 'Text',None, 'Text used as registered name for translator',), -('ODBCTranslator','File_','N',None, None, 'File',1,'Identifier',None, 'Reference to key translator file',), -('ODBCTranslator','Component_','N',None, None, 'Component',1,'Identifier',None, 'Reference to associated component',), -('ODBCTranslator','File_Setup','Y',None, None, 'File',1,'Identifier',None, 'Optional reference to key translator setup DLL',), -('ODBCTranslator','Translator','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized.internal token for translator',), -('Patch','Sequence','N',0,32767,None, None, None, None, 'Primary key, sequence with respect to the media images; order must track cabinet order.',), -('Patch','Attributes','N',0,32767,None, None, None, None, 'Integer containing bit flags representing patch attributes',), -('Patch','File_','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token, foreign key to File table, must match identifier in cabinet.',), -('Patch','Header','Y',None, None, None, None, 'Binary',None, 'Binary stream. The patch header, used for patch validation.',), -('Patch','PatchSize','N',0,2147483647,None, None, None, None, 'Size of patch in bytes (integer).',), -('Patch','StreamRef_','Y',None, None, None, None, 'Identifier',None, 'Identifier. Foreign key to the StreamRef column of the MsiPatchHeaders table.',), -('PatchPackage','Media_','N',0,32767,None, None, None, None, 'Foreign key to DiskId column of Media table. Indicates the disk containing the patch package.',), -('PatchPackage','PatchId','N',None, None, None, None, 'Guid',None, 'A unique string GUID representing this patch.',), -('PublishComponent','Feature_','N',None, None, 'Feature',1,'Identifier',None, 'Foreign key into the Feature table.',), -('PublishComponent','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into the Component table.',), -('PublishComponent','ComponentId','N',None, None, None, None, 'Guid',None, 'A string GUID that represents the component id that will be requested by the alien product.',), -('PublishComponent','AppData','Y',None, None, None, None, 'Text',None, 'This is localisable Application specific data that can be associated with a Qualified Component.',), -('PublishComponent','Qualifier','N',None, None, None, None, 'Text',None, 'This is defined only when the ComponentId column is an Qualified Component Id. This is the Qualifier for ProvideComponentIndirect.',), -('RadioButton','Y','N',0,32767,None, None, None, None, 'The vertical coordinate of the upper left corner of the bounding rectangle of the radio button.',), -('RadioButton','Text','Y',None, None, None, None, 'Text',None, 'The visible title to be assigned to the radio button.',), -('RadioButton','Property','N',None, None, None, None, 'Identifier',None, 'A named property to be tied to this radio button. All the buttons tied to the same property become part of the same group.',), -('RadioButton','Height','N',0,32767,None, None, None, None, 'The height of the button.',), -('RadioButton','Width','N',0,32767,None, None, None, None, 'The width of the button.',), -('RadioButton','X','N',0,32767,None, None, None, None, 'The horizontal coordinate of the upper left corner of the bounding rectangle of the radio button.',), -('RadioButton','Value','N',None, None, None, None, 'Formatted',None, 'The value string associated with this button. Selecting the button will set the associated property to this value.',), -('RadioButton','Order','N',1,32767,None, None, None, None, 'A positive integer used to determine the ordering of the items within one list..The integers do not have to be consecutive.',), -('RadioButton','Help','Y',None, None, None, None, 'Text',None, 'The help strings used with the button. The text is optional.',), -('Registry','Name','Y',None, None, None, None, 'Formatted',None, 'The registry value name.',), -('Registry','Value','Y',None, None, None, None, 'Formatted',None, 'The registry value.',), -('Registry','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into the Component table referencing component that controls the installing of the registry value.',), -('Registry','Key','N',None, None, None, None, 'RegPath',None, 'The key for the registry value.',), -('Registry','Registry','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token.',), -('Registry','Root','N',-1,3,None, None, None, None, 'The predefined root key for the registry value, one of rrkEnum.',), -('RegLocator','Name','Y',None, None, None, None, 'Formatted',None, 'The registry value name.',), -('RegLocator','Type','Y',0,18,None, None, None, None, 'An integer value that determines if the registry value is a filename or a directory location or to be used as is w/o interpretation.',), -('RegLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The table key. The Signature_ represents a unique file signature and is also the foreign key in the Signature table. If the type is 0, the registry values refers a directory, and _Signature is not a foreign key.',), -('RegLocator','Key','N',None, None, None, None, 'RegPath',None, 'The key for the registry value.',), -('RegLocator','Root','N',0,3,None, None, None, None, 'The predefined root key for the registry value, one of rrkEnum.',), -('RemoveFile','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key referencing Component that controls the file to be removed.',), -('RemoveFile','FileKey','N',None, None, None, None, 'Identifier',None, 'Primary key used to identify a particular file entry',), -('RemoveFile','FileName','Y',None, None, None, None, 'WildCardFilename',None, 'Name of the file to be removed.',), -('RemoveFile','DirProperty','N',None, None, None, None, 'Identifier',None, 'Name of a property whose value is assumed to resolve to the full pathname to the folder of the file to be removed.',), -('RemoveFile','InstallMode','N',None, None, None, None, None, '1;2;3','Installation option, one of iimEnum.',), -('RemoveIniFile','Action','N',None, None, None, None, None, '2;4','The type of modification to be made, one of iifEnum.',), -('RemoveIniFile','Value','Y',None, None, None, None, 'Formatted',None, 'The value to be deleted. The value is required when Action is iifIniRemoveTag',), -('RemoveIniFile','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into the Component table referencing component that controls the deletion of the .INI value.',), -('RemoveIniFile','FileName','N',None, None, None, None, 'Filename',None, 'The .INI file name in which to delete the information',), -('RemoveIniFile','DirProperty','Y',None, None, None, None, 'Identifier',None, 'Foreign key into the Directory table denoting the directory where the .INI file is.',), -('RemoveIniFile','Key','N',None, None, None, None, 'Formatted',None, 'The .INI file key below Section.',), -('RemoveIniFile','Section','N',None, None, None, None, 'Formatted',None, 'The .INI file Section.',), -('RemoveIniFile','RemoveIniFile','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token.',), -('RemoveRegistry','Name','Y',None, None, None, None, 'Formatted',None, 'The registry value name.',), -('RemoveRegistry','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into the Component table referencing component that controls the deletion of the registry value.',), -('RemoveRegistry','Key','N',None, None, None, None, 'RegPath',None, 'The key for the registry value.',), -('RemoveRegistry','Root','N',-1,3,None, None, None, None, 'The predefined root key for the registry value, one of rrkEnum',), -('RemoveRegistry','RemoveRegistry','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token.',), -('ReserveCost','Component_','N',None, None, 'Component',1,'Identifier',None, 'Reserve a specified amount of space if this component is to be installed.',), -('ReserveCost','ReserveFolder','Y',None, None, None, None, 'Identifier',None, 'Name of a property whose value is assumed to resolve to the full path to the destination directory',), -('ReserveCost','ReserveKey','N',None, None, None, None, 'Identifier',None, 'Primary key that uniquely identifies a particular ReserveCost record',), -('ReserveCost','ReserveLocal','N',0,2147483647,None, None, None, None, 'Disk space to reserve if linked component is installed locally.',), -('ReserveCost','ReserveSource','N',0,2147483647,None, None, None, None, 'Disk space to reserve if linked component is installed to run from the source location.',), -('SelfReg','File_','N',None, None, 'File',1,'Identifier',None, 'Foreign key into the File table denoting the module that needs to be registered.',), -('SelfReg','Cost','Y',0,32767,None, None, None, None, 'The cost of registering the module.',), -('ServiceControl','Name','N',None, None, None, None, 'Formatted',None, 'Name of a service. /, \\, comma and space are invalid',), -('ServiceControl','Component_','N',None, None, 'Component',1,'Identifier',None, 'Required foreign key into the Component Table that controls the startup of the service',), -('ServiceControl','Event','N',0,187,None, None, None, None, 'Bit field: Install: 0x1 = Start, 0x2 = Stop, 0x8 = Delete, Uninstall: 0x10 = Start, 0x20 = Stop, 0x80 = Delete',), -('ServiceControl','ServiceControl','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token.',), -('ServiceControl','Arguments','Y',None, None, None, None, 'Formatted',None, 'Arguments for the service. Separate by [~].',), -('ServiceControl','Wait','Y',0,1,None, None, None, None, 'Boolean for whether to wait for the service to fully start',), -('ServiceInstall','Name','N',None, None, None, None, 'Formatted',None, 'Internal Name of the Service',), -('ServiceInstall','Description','Y',None, None, None, None, 'Text',None, 'Description of service.',), -('ServiceInstall','Component_','N',None, None, 'Component',1,'Identifier',None, 'Required foreign key into the Component Table that controls the startup of the service',), -('ServiceInstall','Arguments','Y',None, None, None, None, 'Formatted',None, 'Arguments to include in every start of the service, passed to WinMain',), -('ServiceInstall','ServiceInstall','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token.',), -('ServiceInstall','Dependencies','Y',None, None, None, None, 'Formatted',None, 'Other services this depends on to start. Separate by [~], and end with [~][~]',), -('ServiceInstall','DisplayName','Y',None, None, None, None, 'Formatted',None, 'External Name of the Service',), -('ServiceInstall','ErrorControl','N',-2147483647,2147483647,None, None, None, None, 'Severity of error if service fails to start',), -('ServiceInstall','LoadOrderGroup','Y',None, None, None, None, 'Formatted',None, 'LoadOrderGroup',), -('ServiceInstall','Password','Y',None, None, None, None, 'Formatted',None, 'password to run service with. (with StartName)',), -('ServiceInstall','ServiceType','N',-2147483647,2147483647,None, None, None, None, 'Type of the service',), -('ServiceInstall','StartName','Y',None, None, None, None, 'Formatted',None, 'User or object name to run service as',), -('ServiceInstall','StartType','N',0,4,None, None, None, None, 'Type of the service',), -('Shortcut','Name','N',None, None, None, None, 'Filename',None, 'The name of the shortcut to be created.',), -('Shortcut','Description','Y',None, None, None, None, 'Text',None, 'The description for the shortcut.',), -('Shortcut','Component_','N',None, None, 'Component',1,'Identifier',None, 'Foreign key into the Component table denoting the component whose selection gates the shortcut creation/deletion.',), -('Shortcut','Icon_','Y',None, None, 'Icon',1,'Identifier',None, 'Foreign key into the File table denoting the external icon file for the shortcut.',), -('Shortcut','IconIndex','Y',-32767,32767,None, None, None, None, 'The icon index for the shortcut.',), -('Shortcut','Directory_','N',None, None, 'Directory',1,'Identifier',None, 'Foreign key into the Directory table denoting the directory where the shortcut file is created.',), -('Shortcut','Target','N',None, None, None, None, 'Shortcut',None, 'The shortcut target. This is usually a property that is expanded to a file or a folder that the shortcut points to.',), -('Shortcut','Arguments','Y',None, None, None, None, 'Formatted',None, 'The command-line arguments for the shortcut.',), -('Shortcut','Shortcut','N',None, None, None, None, 'Identifier',None, 'Primary key, non-localized token.',), -('Shortcut','Hotkey','Y',0,32767,None, None, None, None, 'The hotkey for the shortcut. It has the virtual-key code for the key in the low-order byte, and the modifier flags in the high-order byte. ',), -('Shortcut','ShowCmd','Y',None, None, None, None, None, '1;3;7','The show command for the application window.The following values may be used.',), -('Shortcut','WkDir','Y',None, None, None, None, 'Identifier',None, 'Name of property defining location of working directory.',), -('Signature','FileName','N',None, None, None, None, 'Filename',None, 'The name of the file. This may contain a "short name|long name" pair.',), -('Signature','Signature','N',None, None, None, None, 'Identifier',None, 'The table key. The Signature represents a unique file signature.',), -('Signature','Languages','Y',None, None, None, None, 'Language',None, 'The languages supported by the file.',), -('Signature','MaxDate','Y',0,2147483647,None, None, None, None, 'The maximum creation date of the file.',), -('Signature','MaxSize','Y',0,2147483647,None, None, None, None, 'The maximum size of the file. ',), -('Signature','MaxVersion','Y',None, None, None, None, 'Text',None, 'The maximum version of the file.',), -('Signature','MinDate','Y',0,2147483647,None, None, None, None, 'The minimum creation date of the file.',), -('Signature','MinSize','Y',0,2147483647,None, None, None, None, 'The minimum size of the file.',), -('Signature','MinVersion','Y',None, None, None, None, 'Text',None, 'The minimum version of the file.',), -('TextStyle','TextStyle','N',None, None, None, None, 'Identifier',None, 'Name of the style. The primary key of this table. This name is embedded in the texts to indicate a style change.',), -('TextStyle','Color','Y',0,16777215,None, None, None, None, 'An integer indicating the color of the string in the RGB format (Red, Green, Blue each 0-255, RGB = R + 256*G + 256^2*B).',), -('TextStyle','FaceName','N',None, None, None, None, 'Text',None, 'A string indicating the name of the font used. Required. The string must be at most 31 characters long.',), -('TextStyle','Size','N',0,32767,None, None, None, None, 'The size of the font used. This size is given in our units (1/12 of the system font height). Assuming that the system font is set to 12 point size, this is equivalent to the point size.',), -('TextStyle','StyleBits','Y',0,15,None, None, None, None, 'A combination of style bits.',), -('TypeLib','Description','Y',None, None, None, None, 'Text',None, None, ), -('TypeLib','Feature_','N',None, None, 'Feature',1,'Identifier',None, 'Required foreign key into the Feature Table, specifying the feature to validate or install in order for the type library to be operational.',), -('TypeLib','Component_','N',None, None, 'Component',1,'Identifier',None, 'Required foreign key into the Component Table, specifying the component for which to return a path when called through LocateComponent.',), -('TypeLib','Directory_','Y',None, None, 'Directory',1,'Identifier',None, 'Optional. The foreign key into the Directory table denoting the path to the help file for the type library.',), -('TypeLib','Language','N',0,32767,None, None, None, None, 'The language of the library.',), -('TypeLib','Version','Y',0,16777215,None, None, None, None, 'The version of the library. The minor version is in the lower 8 bits of the integer. The major version is in the next 16 bits. ',), -('TypeLib','Cost','Y',0,2147483647,None, None, None, None, 'The cost associated with the registration of the typelib. This column is currently optional.',), -('TypeLib','LibID','N',None, None, None, None, 'Guid',None, 'The GUID that represents the library.',), -('UIText','Text','Y',None, None, None, None, 'Text',None, 'The localized version of the string.',), -('UIText','Key','N',None, None, None, None, 'Identifier',None, 'A unique key that identifies the particular string.',), -('Upgrade','Attributes','N',0,2147483647,None, None, None, None, 'The attributes of this product set.',), -('Upgrade','Language','Y',None, None, None, None, 'Language',None, 'A comma-separated list of languages for either products in this set or products not in this set.',), -('Upgrade','ActionProperty','N',None, None, None, None, 'UpperCase',None, 'The property to set when a product in this set is found.',), -('Upgrade','Remove','Y',None, None, None, None, 'Formatted',None, 'The list of features to remove when uninstalling a product from this set. The default is "ALL".',), -('Upgrade','UpgradeCode','N',None, None, None, None, 'Guid',None, 'The UpgradeCode GUID belonging to the products in this set.',), -('Upgrade','VersionMax','Y',None, None, None, None, 'Text',None, 'The maximum ProductVersion of the products in this set. The set may or may not include products with this particular version.',), -('Upgrade','VersionMin','Y',None, None, None, None, 'Text',None, 'The minimum ProductVersion of the products in this set. The set may or may not include products with this particular version.',), -('Verb','Sequence','Y',0,32767,None, None, None, None, 'Order within the verbs for a particular extension. Also used simply to specify the default verb.',), -('Verb','Argument','Y',None, None, None, None, 'Formatted',None, 'Optional value for the command arguments.',), -('Verb','Extension_','N',None, None, 'Extension',1,'Text',None, 'The extension associated with the table row.',), -('Verb','Verb','N',None, None, None, None, 'Text',None, 'The verb for the command.',), -('Verb','Command','Y',None, None, None, None, 'Formatted',None, 'The command text.',), -] diff --git a/Lib/msilib/sequence.py b/Lib/msilib/sequence.py deleted file mode 100644 index 7012a21f857..00000000000 --- a/Lib/msilib/sequence.py +++ /dev/null @@ -1,126 +0,0 @@ -AdminExecuteSequence = [ -('InstallInitialize', None, 1500), -('InstallFinalize', None, 6600), -('InstallFiles', None, 4000), -('InstallAdminPackage', None, 3900), -('FileCost', None, 900), -('CostInitialize', None, 800), -('CostFinalize', None, 1000), -('InstallValidate', None, 1400), -] - -AdminUISequence = [ -('FileCost', None, 900), -('CostInitialize', None, 800), -('CostFinalize', None, 1000), -('ExecuteAction', None, 1300), -('ExitDialog', None, -1), -('FatalError', None, -3), -('UserExit', None, -2), -] - -AdvtExecuteSequence = [ -('InstallInitialize', None, 1500), -('InstallFinalize', None, 6600), -('CostInitialize', None, 800), -('CostFinalize', None, 1000), -('InstallValidate', None, 1400), -('CreateShortcuts', None, 4500), -('MsiPublishAssemblies', None, 6250), -('PublishComponents', None, 6200), -('PublishFeatures', None, 6300), -('PublishProduct', None, 6400), -('RegisterClassInfo', None, 4600), -('RegisterExtensionInfo', None, 4700), -('RegisterMIMEInfo', None, 4900), -('RegisterProgIdInfo', None, 4800), -] - -InstallExecuteSequence = [ -('InstallInitialize', None, 1500), -('InstallFinalize', None, 6600), -('InstallFiles', None, 4000), -('FileCost', None, 900), -('CostInitialize', None, 800), -('CostFinalize', None, 1000), -('InstallValidate', None, 1400), -('CreateShortcuts', None, 4500), -('MsiPublishAssemblies', None, 6250), -('PublishComponents', None, 6200), -('PublishFeatures', None, 6300), -('PublishProduct', None, 6400), -('RegisterClassInfo', None, 4600), -('RegisterExtensionInfo', None, 4700), -('RegisterMIMEInfo', None, 4900), -('RegisterProgIdInfo', None, 4800), -('AllocateRegistrySpace', 'NOT Installed', 1550), -('AppSearch', None, 400), -('BindImage', None, 4300), -('CCPSearch', 'NOT Installed', 500), -('CreateFolders', None, 3700), -('DeleteServices', 'VersionNT', 2000), -('DuplicateFiles', None, 4210), -('FindRelatedProducts', None, 200), -('InstallODBC', None, 5400), -('InstallServices', 'VersionNT', 5800), -('IsolateComponents', None, 950), -('LaunchConditions', None, 100), -('MigrateFeatureStates', None, 1200), -('MoveFiles', None, 3800), -('PatchFiles', None, 4090), -('ProcessComponents', None, 1600), -('RegisterComPlus', None, 5700), -('RegisterFonts', None, 5300), -('RegisterProduct', None, 6100), -('RegisterTypeLibraries', None, 5500), -('RegisterUser', None, 6000), -('RemoveDuplicateFiles', None, 3400), -('RemoveEnvironmentStrings', None, 3300), -('RemoveExistingProducts', None, 6700), -('RemoveFiles', None, 3500), -('RemoveFolders', None, 3600), -('RemoveIniValues', None, 3100), -('RemoveODBC', None, 2400), -('RemoveRegistryValues', None, 2600), -('RemoveShortcuts', None, 3200), -('RMCCPSearch', 'NOT Installed', 600), -('SelfRegModules', None, 5600), -('SelfUnregModules', None, 2200), -('SetODBCFolders', None, 1100), -('StartServices', 'VersionNT', 5900), -('StopServices', 'VersionNT', 1900), -('MsiUnpublishAssemblies', None, 1750), -('UnpublishComponents', None, 1700), -('UnpublishFeatures', None, 1800), -('UnregisterClassInfo', None, 2700), -('UnregisterComPlus', None, 2100), -('UnregisterExtensionInfo', None, 2800), -('UnregisterFonts', None, 2500), -('UnregisterMIMEInfo', None, 3000), -('UnregisterProgIdInfo', None, 2900), -('UnregisterTypeLibraries', None, 2300), -('ValidateProductID', None, 700), -('WriteEnvironmentStrings', None, 5200), -('WriteIniValues', None, 5100), -('WriteRegistryValues', None, 5000), -] - -InstallUISequence = [ -('FileCost', None, 900), -('CostInitialize', None, 800), -('CostFinalize', None, 1000), -('ExecuteAction', None, 1300), -('ExitDialog', None, -1), -('FatalError', None, -3), -('UserExit', None, -2), -('AppSearch', None, 400), -('CCPSearch', 'NOT Installed', 500), -('FindRelatedProducts', None, 200), -('IsolateComponents', None, 950), -('LaunchConditions', None, 100), -('MigrateFeatureStates', None, 1200), -('RMCCPSearch', 'NOT Installed', 600), -('ValidateProductID', None, 700), -] - -tables=['AdminExecuteSequence', 'AdminUISequence', 'AdvtExecuteSequence', 'InstallExecuteSequence', 'InstallUISequence'] diff --git a/Lib/msilib/text.py b/Lib/msilib/text.py deleted file mode 100644 index c4b9e8697d7..00000000000 --- a/Lib/msilib/text.py +++ /dev/null @@ -1,129 +0,0 @@ -import msilib,os;dirname=os.path.dirname(__file__) - -ActionText = [ -('InstallValidate', 'Validating install', None), -('InstallFiles', 'Copying new files', 'File: [1], Directory: [9], Size: [6]'), -('InstallAdminPackage', 'Copying network install files', 'File: [1], Directory: [9], Size: [6]'), -('FileCost', 'Computing space requirements', None), -('CostInitialize', 'Computing space requirements', None), -('CostFinalize', 'Computing space requirements', None), -('CreateShortcuts', 'Creating shortcuts', 'Shortcut: [1]'), -('PublishComponents', 'Publishing Qualified Components', 'Component ID: [1], Qualifier: [2]'), -('PublishFeatures', 'Publishing Product Features', 'Feature: [1]'), -('PublishProduct', 'Publishing product information', None), -('RegisterClassInfo', 'Registering Class servers', 'Class Id: [1]'), -('RegisterExtensionInfo', 'Registering extension servers', 'Extension: [1]'), -('RegisterMIMEInfo', 'Registering MIME info', 'MIME Content Type: [1], Extension: [2]'), -('RegisterProgIdInfo', 'Registering program identifiers', 'ProgId: [1]'), -('AllocateRegistrySpace', 'Allocating registry space', 'Free space: [1]'), -('AppSearch', 'Searching for installed applications', 'Property: [1], Signature: [2]'), -('BindImage', 'Binding executables', 'File: [1]'), -('CCPSearch', 'Searching for qualifying products', None), -('CreateFolders', 'Creating folders', 'Folder: [1]'), -('DeleteServices', 'Deleting services', 'Service: [1]'), -('DuplicateFiles', 'Creating duplicate files', 'File: [1], Directory: [9], Size: [6]'), -('FindRelatedProducts', 'Searching for related applications', 'Found application: [1]'), -('InstallODBC', 'Installing ODBC components', None), -('InstallServices', 'Installing new services', 'Service: [2]'), -('LaunchConditions', 'Evaluating launch conditions', None), -('MigrateFeatureStates', 'Migrating feature states from related applications', 'Application: [1]'), -('MoveFiles', 'Moving files', 'File: [1], Directory: [9], Size: [6]'), -('PatchFiles', 'Patching files', 'File: [1], Directory: [2], Size: [3]'), -('ProcessComponents', 'Updating component registration', None), -('RegisterComPlus', 'Registering COM+ Applications and Components', 'AppId: [1]{{, AppType: [2], Users: [3], RSN: [4]}}'), -('RegisterFonts', 'Registering fonts', 'Font: [1]'), -('RegisterProduct', 'Registering product', '[1]'), -('RegisterTypeLibraries', 'Registering type libraries', 'LibID: [1]'), -('RegisterUser', 'Registering user', '[1]'), -('RemoveDuplicateFiles', 'Removing duplicated files', 'File: [1], Directory: [9]'), -('RemoveEnvironmentStrings', 'Updating environment strings', 'Name: [1], Value: [2], Action [3]'), -('RemoveExistingProducts', 'Removing applications', 'Application: [1], Command line: [2]'), -('RemoveFiles', 'Removing files', 'File: [1], Directory: [9]'), -('RemoveFolders', 'Removing folders', 'Folder: [1]'), -('RemoveIniValues', 'Removing INI files entries', 'File: [1], Section: [2], Key: [3], Value: [4]'), -('RemoveODBC', 'Removing ODBC components', None), -('RemoveRegistryValues', 'Removing system registry values', 'Key: [1], Name: [2]'), -('RemoveShortcuts', 'Removing shortcuts', 'Shortcut: [1]'), -('RMCCPSearch', 'Searching for qualifying products', None), -('SelfRegModules', 'Registering modules', 'File: [1], Folder: [2]'), -('SelfUnregModules', 'Unregistering modules', 'File: [1], Folder: [2]'), -('SetODBCFolders', 'Initializing ODBC directories', None), -('StartServices', 'Starting services', 'Service: [1]'), -('StopServices', 'Stopping services', 'Service: [1]'), -('UnpublishComponents', 'Unpublishing Qualified Components', 'Component ID: [1], Qualifier: [2]'), -('UnpublishFeatures', 'Unpublishing Product Features', 'Feature: [1]'), -('UnregisterClassInfo', 'Unregister Class servers', 'Class Id: [1]'), -('UnregisterComPlus', 'Unregistering COM+ Applications and Components', 'AppId: [1]{{, AppType: [2]}}'), -('UnregisterExtensionInfo', 'Unregistering extension servers', 'Extension: [1]'), -('UnregisterFonts', 'Unregistering fonts', 'Font: [1]'), -('UnregisterMIMEInfo', 'Unregistering MIME info', 'MIME Content Type: [1], Extension: [2]'), -('UnregisterProgIdInfo', 'Unregistering program identifiers', 'ProgId: [1]'), -('UnregisterTypeLibraries', 'Unregistering type libraries', 'LibID: [1]'), -('WriteEnvironmentStrings', 'Updating environment strings', 'Name: [1], Value: [2], Action [3]'), -('WriteIniValues', 'Writing INI files values', 'File: [1], Section: [2], Key: [3], Value: [4]'), -('WriteRegistryValues', 'Writing system registry values', 'Key: [1], Name: [2], Value: [3]'), -('Advertise', 'Advertising application', None), -('GenerateScript', 'Generating script operations for action:', '[1]'), -('InstallSFPCatalogFile', 'Installing system catalog', 'File: [1], Dependencies: [2]'), -('MsiPublishAssemblies', 'Publishing assembly information', 'Application Context:[1], Assembly Name:[2]'), -('MsiUnpublishAssemblies', 'Unpublishing assembly information', 'Application Context:[1], Assembly Name:[2]'), -('Rollback', 'Rolling back action:', '[1]'), -('RollbackCleanup', 'Removing backup files', 'File: [1]'), -('UnmoveFiles', 'Removing moved files', 'File: [1], Directory: [9]'), -('UnpublishProduct', 'Unpublishing product information', None), -] - -UIText = [ -('AbsentPath', None), -('bytes', 'bytes'), -('GB', 'GB'), -('KB', 'KB'), -('MB', 'MB'), -('MenuAbsent', 'Entire feature will be unavailable'), -('MenuAdvertise', 'Feature will be installed when required'), -('MenuAllCD', 'Entire feature will be installed to run from CD'), -('MenuAllLocal', 'Entire feature will be installed on local hard drive'), -('MenuAllNetwork', 'Entire feature will be installed to run from network'), -('MenuCD', 'Will be installed to run from CD'), -('MenuLocal', 'Will be installed on local hard drive'), -('MenuNetwork', 'Will be installed to run from network'), -('ScriptInProgress', 'Gathering required information...'), -('SelAbsentAbsent', 'This feature will remain uninstalled'), -('SelAbsentAdvertise', 'This feature will be set to be installed when required'), -('SelAbsentCD', 'This feature will be installed to run from CD'), -('SelAbsentLocal', 'This feature will be installed on the local hard drive'), -('SelAbsentNetwork', 'This feature will be installed to run from the network'), -('SelAdvertiseAbsent', 'This feature will become unavailable'), -('SelAdvertiseAdvertise', 'Will be installed when required'), -('SelAdvertiseCD', 'This feature will be available to run from CD'), -('SelAdvertiseLocal', 'This feature will be installed on your local hard drive'), -('SelAdvertiseNetwork', 'This feature will be available to run from the network'), -('SelCDAbsent', "This feature will be uninstalled completely, you won't be able to run it from CD"), -('SelCDAdvertise', 'This feature will change from run from CD state to set to be installed when required'), -('SelCDCD', 'This feature will remain to be run from CD'), -('SelCDLocal', 'This feature will change from run from CD state to be installed on the local hard drive'), -('SelChildCostNeg', 'This feature frees up [1] on your hard drive.'), -('SelChildCostPos', 'This feature requires [1] on your hard drive.'), -('SelCostPending', 'Compiling cost for this feature...'), -('SelLocalAbsent', 'This feature will be completely removed'), -('SelLocalAdvertise', 'This feature will be removed from your local hard drive, but will be set to be installed when required'), -('SelLocalCD', 'This feature will be removed from your local hard drive, but will be still available to run from CD'), -('SelLocalLocal', 'This feature will remain on you local hard drive'), -('SelLocalNetwork', 'This feature will be removed from your local hard drive, but will be still available to run from the network'), -('SelNetworkAbsent', "This feature will be uninstalled completely, you won't be able to run it from the network"), -('SelNetworkAdvertise', 'This feature will change from run from network state to set to be installed when required'), -('SelNetworkLocal', 'This feature will change from run from network state to be installed on the local hard drive'), -('SelNetworkNetwork', 'This feature will remain to be run from the network'), -('SelParentCostNegNeg', 'This feature frees up [1] on your hard drive. It has [2] of [3] subfeatures selected. The subfeatures free up [4] on your hard drive.'), -('SelParentCostNegPos', 'This feature frees up [1] on your hard drive. It has [2] of [3] subfeatures selected. The subfeatures require [4] on your hard drive.'), -('SelParentCostPosNeg', 'This feature requires [1] on your hard drive. It has [2] of [3] subfeatures selected. The subfeatures free up [4] on your hard drive.'), -('SelParentCostPosPos', 'This feature requires [1] on your hard drive. It has [2] of [3] subfeatures selected. The subfeatures require [4] on your hard drive.'), -('TimeRemaining', 'Time remaining: {[1] minutes }{[2] seconds}'), -('VolumeCostAvailable', 'Available'), -('VolumeCostDifference', 'Difference'), -('VolumeCostRequired', 'Required'), -('VolumeCostSize', 'Disk Size'), -('VolumeCostVolume', 'Volume'), -] - -tables=['ActionText', 'UIText'] diff --git a/Lib/test/test_msilib.py b/Lib/test/test_msilib.py deleted file mode 100644 index db16f62a4c1..00000000000 --- a/Lib/test/test_msilib.py +++ /dev/null @@ -1,166 +0,0 @@ -""" Test suite for the code in msilib """ -import os -import unittest -from test.support.import_helper import import_module -from test.support.os_helper import TESTFN, unlink -import warnings -with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - msilib = import_module('msilib') -import msilib.schema - - -def init_database(): - path = TESTFN + '.msi' - db = msilib.init_database( - path, - msilib.schema, - 'Python Tests', - 'product_code', - '1.0', - 'PSF', - ) - return db, path - - -class MsiDatabaseTestCase(unittest.TestCase): - - def test_view_fetch_returns_none(self): - db, db_path = init_database() - properties = [] - view = db.OpenView('SELECT Property, Value FROM Property') - view.Execute(None) - while True: - record = view.Fetch() - if record is None: - break - properties.append(record.GetString(1)) - view.Close() - db.Close() - self.assertEqual( - properties, - [ - 'ProductName', 'ProductCode', 'ProductVersion', - 'Manufacturer', 'ProductLanguage', - ] - ) - self.addCleanup(unlink, db_path) - - def test_view_non_ascii(self): - db, db_path = init_database() - view = db.OpenView("SELECT 'ß-розпад' FROM Property") - view.Execute(None) - record = view.Fetch() - self.assertEqual(record.GetString(1), 'ß-розпад') - view.Close() - db.Close() - self.addCleanup(unlink, db_path) - - def test_summaryinfo_getproperty_issue1104(self): - db, db_path = init_database() - try: - sum_info = db.GetSummaryInformation(99) - title = sum_info.GetProperty(msilib.PID_TITLE) - self.assertEqual(title, b"Installation Database") - - sum_info.SetProperty(msilib.PID_TITLE, "a" * 999) - title = sum_info.GetProperty(msilib.PID_TITLE) - self.assertEqual(title, b"a" * 999) - - sum_info.SetProperty(msilib.PID_TITLE, "a" * 1000) - title = sum_info.GetProperty(msilib.PID_TITLE) - self.assertEqual(title, b"a" * 1000) - - sum_info.SetProperty(msilib.PID_TITLE, "a" * 1001) - title = sum_info.GetProperty(msilib.PID_TITLE) - self.assertEqual(title, b"a" * 1001) - finally: - db = None - sum_info = None - os.unlink(db_path) - - def test_database_open_failed(self): - with self.assertRaises(msilib.MSIError) as cm: - msilib.OpenDatabase('non-existent.msi', msilib.MSIDBOPEN_READONLY) - self.assertEqual(str(cm.exception), 'open failed') - - def test_database_create_failed(self): - db_path = os.path.join(TESTFN, 'test.msi') - with self.assertRaises(msilib.MSIError) as cm: - msilib.OpenDatabase(db_path, msilib.MSIDBOPEN_CREATE) - self.assertEqual(str(cm.exception), 'create failed') - - def test_get_property_vt_empty(self): - db, db_path = init_database() - summary = db.GetSummaryInformation(0) - self.assertIsNone(summary.GetProperty(msilib.PID_SECURITY)) - db.Close() - self.addCleanup(unlink, db_path) - - def test_directory_start_component_keyfile(self): - db, db_path = init_database() - self.addCleanup(unlink, db_path) - self.addCleanup(db.Close) - self.addCleanup(msilib._directories.clear) - feature = msilib.Feature(db, 0, 'Feature', 'A feature', 'Python') - cab = msilib.CAB('CAB') - dir = msilib.Directory(db, cab, None, TESTFN, 'TARGETDIR', - 'SourceDir', 0) - dir.start_component(None, feature, None, 'keyfile') - - def test_getproperty_uninitialized_var(self): - db, db_path = init_database() - self.addCleanup(unlink, db_path) - self.addCleanup(db.Close) - si = db.GetSummaryInformation(0) - with self.assertRaises(msilib.MSIError): - si.GetProperty(-1) - - def test_FCICreate(self): - filepath = TESTFN + '.txt' - cabpath = TESTFN + '.cab' - self.addCleanup(unlink, filepath) - with open(filepath, 'wb'): - pass - self.addCleanup(unlink, cabpath) - msilib.FCICreate(cabpath, [(filepath, 'test.txt')]) - self.assertTrue(os.path.isfile(cabpath)) - - -class Test_make_id(unittest.TestCase): - #http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx - """The Identifier data type is a text string. Identifiers may contain the - ASCII characters A-Z (a-z), digits, underscores (_), or periods (.). - However, every identifier must begin with either a letter or an - underscore. - """ - - def test_is_no_change_required(self): - self.assertEqual( - msilib.make_id("short"), "short") - self.assertEqual( - msilib.make_id("nochangerequired"), "nochangerequired") - self.assertEqual( - msilib.make_id("one.dot"), "one.dot") - self.assertEqual( - msilib.make_id("_"), "_") - self.assertEqual( - msilib.make_id("a"), "a") - #self.assertEqual( - # msilib.make_id(""), "") - - def test_invalid_first_char(self): - self.assertEqual( - msilib.make_id("9.short"), "_9.short") - self.assertEqual( - msilib.make_id(".short"), "_.short") - - def test_invalid_any_char(self): - self.assertEqual( - msilib.make_id(".s\x82ort"), "_.s_ort") - self.assertEqual( - msilib.make_id(".s\x82o?*+rt"), "_.s_o___rt") - - -if __name__ == '__main__': - unittest.main() diff --git a/Misc/NEWS.d/3.10.0a1.rst b/Misc/NEWS.d/3.10.0a1.rst index c7cd6507043..301612c4307 100644 --- a/Misc/NEWS.d/3.10.0a1.rst +++ b/Misc/NEWS.d/3.10.0a1.rst @@ -2986,7 +2986,7 @@ Update Windows release to include SQLite 3.32.3. .. nonce: jpZzzh .. section: Windows -:mod:`msilib` now supports creating CAB files with non-ASCII file path and +:mod:`!msilib` now supports creating CAB files with non-ASCII file path and adding files with non-ASCII file path to them. .. @@ -2996,9 +2996,9 @@ adding files with non-ASCII file path to them. .. nonce: gaQc3C .. section: Windows -Fixed support of non-ASCII names in functions :func:`msilib.OpenDatabase` -and :func:`msilib.init_database` and non-ASCII SQL in method -:meth:`msilib.Database.OpenView`. +Fixed support of non-ASCII names in functions :func:`!msilib.OpenDatabase` +and :func:`!msilib.init_database` and non-ASCII SQL in method +:meth:`!msilib.Database.OpenView`. .. diff --git a/Misc/NEWS.d/3.12.0a1.rst b/Misc/NEWS.d/3.12.0a1.rst index ff5064f89d8..2e1d39b0c79 100644 --- a/Misc/NEWS.d/3.12.0a1.rst +++ b/Misc/NEWS.d/3.12.0a1.rst @@ -5400,7 +5400,7 @@ Update libffi to 3.4.3 .. nonce: kV4K_1 .. section: Windows -Fixes a potential buffer overrun in :mod:`msilib`. +Fixes a potential buffer overrun in :mod:`!msilib`. .. diff --git a/Misc/NEWS.d/3.6.4rc1.rst b/Misc/NEWS.d/3.6.4rc1.rst index dc9ab7ad56d..ae4534be62c 100644 --- a/Misc/NEWS.d/3.6.4rc1.rst +++ b/Misc/NEWS.d/3.6.4rc1.rst @@ -294,7 +294,7 @@ by Nir Soffer. .. nonce: Nj3A0x .. section: Library -Make :meth:`msilib.SummaryInformation.GetProperty` return ``None`` when the +Make :meth:`!msilib.SummaryInformation.GetProperty` return ``None`` when the value of property is ``VT_EMPTY``. Initial patch by Mark Mc Mahon. .. @@ -316,7 +316,7 @@ Initial patch by Robin Wellner. .. nonce: xWT9k0 .. section: Library -:func:`msilib.OpenDatabase` now raises a better exception message when it +:func:`!msilib.OpenDatabase` now raises a better exception message when it couldn't open or create an MSI file. Initial patch by William Tisäter. .. diff --git a/Misc/NEWS.d/3.7.0a3.rst b/Misc/NEWS.d/3.7.0a3.rst index 6576c1fadbf..368efb73567 100644 --- a/Misc/NEWS.d/3.7.0a3.rst +++ b/Misc/NEWS.d/3.7.0a3.rst @@ -350,7 +350,7 @@ the left most segment of hostname in second argument of .. nonce: Nj3A0x .. section: Library -Make :meth:`msilib.SummaryInformation.GetProperty` return ``None`` when the +Make :meth:`!msilib.SummaryInformation.GetProperty` return ``None`` when the value of property is ``VT_EMPTY``. Initial patch by Mark Mc Mahon. .. @@ -396,7 +396,7 @@ Initial patch by Robin Wellner. .. nonce: xWT9k0 .. section: Library -:func:`msilib.OpenDatabase` now raises a better exception message when it +:func:`!msilib.OpenDatabase` now raises a better exception message when it couldn't open or create an MSI file. Initial patch by William Tisäter. .. diff --git a/Misc/NEWS.d/3.8.0b1.rst b/Misc/NEWS.d/3.8.0b1.rst index 5285770de13..72e6b31874e 100644 --- a/Misc/NEWS.d/3.8.0b1.rst +++ b/Misc/NEWS.d/3.8.0b1.rst @@ -509,7 +509,7 @@ Add SSLContext.num_tickets to control the number of TLSv1.3 session tickets. .. nonce: nobzc9 .. section: Library -Fix the error handling in :meth:`msilib.SummaryInformation.GetProperty`. +Fix the error handling in :meth:`!msilib.SummaryInformation.GetProperty`. Patch by Zackery Spytz. .. @@ -538,7 +538,7 @@ module. .. nonce: TQFOR4 .. section: Library -:meth:`msilib.Directory.start_component()` no longer fails if *keyfile* is +:meth:`!msilib.Directory.start_component()` no longer fails if *keyfile* is not ``None``. .. diff --git a/Misc/NEWS.d/next/Library/2023-05-24-18-48-10.gh-issue-104773.TrgUeO.rst b/Misc/NEWS.d/next/Library/2023-05-24-18-48-10.gh-issue-104773.TrgUeO.rst new file mode 100644 index 00000000000..34f46d951ab --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-05-24-18-48-10.gh-issue-104773.TrgUeO.rst @@ -0,0 +1 @@ +:pep:`594`: Removed the :mod:`!msilib` package, deprecated in Python 3.11. diff --git a/PC/_msi.c b/PC/_msi.c deleted file mode 100644 index b104e3c6ef5..00000000000 --- a/PC/_msi.c +++ /dev/null @@ -1,1312 +0,0 @@ -/* Helper library for MSI creation with Python. - * Copyright (C) 2005 Martin v. Löwis - * Licensed to PSF under a contributor agreement. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/*[clinic input] -module _msi -class _msi.Record "msiobj *" "&record_Type" -class _msi.SummaryInformation "msiobj *" "&summary_Type" -class _msi.View "msiobj *" "&msiview_Type" -class _msi.Database "msiobj *" "&msidb_Type" -[clinic start generated code]*/ -/*[clinic end generated code: output=da39a3ee5e6b4b0d input=89a3605762cf4bdc]*/ - -static PyObject *MSIError; - -/*[clinic input] -_msi.UuidCreate - -Return the string representation of a new unique identifier. -[clinic start generated code]*/ - -static PyObject * -_msi_UuidCreate_impl(PyObject *module) -/*[clinic end generated code: output=534ecf36f10af98e input=168024ab4b3e832b]*/ -{ - UUID result; - wchar_t *cresult; - PyObject *oresult; - - /* May return ok, local only, and no address. - For local only, the documentation says we still get a uuid. - For RPC_S_UUID_NO_ADDRESS, it's not clear whether we can - use the result. */ - if (UuidCreate(&result) == RPC_S_UUID_NO_ADDRESS) { - PyErr_SetString(PyExc_NotImplementedError, "processing 'no address' result"); - return NULL; - } - - if (UuidToStringW(&result, &cresult) == RPC_S_OUT_OF_MEMORY) { - PyErr_SetString(PyExc_MemoryError, "out of memory in uuidgen"); - return NULL; - } - - oresult = PyUnicode_FromWideChar(cresult, wcslen(cresult)); - RpcStringFreeW(&cresult); - return oresult; - -} - -/* Helper for converting file names from UTF-8 to wchat_t*. */ -static wchar_t * -utf8_to_wchar(const char *s, int *err) -{ - PyObject *obj = PyUnicode_FromString(s); - if (obj == NULL) { - if (PyErr_ExceptionMatches(PyExc_MemoryError)) { - *err = ENOMEM; - } - else { - *err = EINVAL; - } - PyErr_Clear(); - return NULL; - } - wchar_t *ws = PyUnicode_AsWideCharString(obj, NULL); - if (ws == NULL) { - *err = ENOMEM; - PyErr_Clear(); - } - Py_DECREF(obj); - return ws; -} - -/* FCI callback functions */ - -static FNFCIALLOC(cb_alloc) -{ - return PyMem_RawMalloc(cb); -} - -static FNFCIFREE(cb_free) -{ - PyMem_RawFree(memory); -} - -static FNFCIOPEN(cb_open) -{ - wchar_t *ws = utf8_to_wchar(pszFile, err); - if (ws == NULL) { - return -1; - } - int result = _wopen(ws, oflag | O_NOINHERIT, pmode); - PyMem_Free(ws); - if (result == -1) - *err = errno; - return result; -} - -static FNFCIREAD(cb_read) -{ - UINT result = (UINT)_read((int)hf, memory, cb); - if (result != cb) - *err = errno; - return result; -} - -static FNFCIWRITE(cb_write) -{ - UINT result = (UINT)_write((int)hf, memory, cb); - if (result != cb) - *err = errno; - return result; -} - -static FNFCICLOSE(cb_close) -{ - int result = _close((int)hf); - if (result != 0) - *err = errno; - return result; -} - -static FNFCISEEK(cb_seek) -{ - long result = (long)_lseek((int)hf, dist, seektype); - if (result == -1) - *err = errno; - return result; -} - -static FNFCIDELETE(cb_delete) -{ - wchar_t *ws = utf8_to_wchar(pszFile, err); - if (ws == NULL) { - return -1; - } - int result = _wremove(ws); - PyMem_Free(ws); - if (result != 0) - *err = errno; - return result; -} - -static FNFCIFILEPLACED(cb_fileplaced) -{ - return 0; -} - -static FNFCIGETTEMPFILE(cb_gettempfile) -{ - char *name = _tempnam("", "tmp"); - if ((name != NULL) && ((int)strlen(name) < cbTempName)) { - strcpy(pszTempName, name); - free(name); - return TRUE; - } - - if (name) free(name); - return FALSE; -} - -static FNFCISTATUS(cb_status) -{ - if (pv) { - PyObject *result = PyObject_CallMethod(pv, "status", "iii", typeStatus, cb1, cb2); - if (result == NULL) - return -1; - Py_DECREF(result); - } - return 0; -} - -static FNFCIGETNEXTCABINET(cb_getnextcabinet) -{ - if (pv) { - PyObject *result = PyObject_CallMethod(pv, "getnextcabinet", "i", pccab->iCab); - if (result == NULL) - return -1; - if (!PyBytes_Check(result)) { - PyErr_Format(PyExc_TypeError, - "Incorrect return type %s from getnextcabinet", - Py_TYPE(result)->tp_name); - Py_DECREF(result); - return FALSE; - } - strncpy(pccab->szCab, PyBytes_AsString(result), sizeof(pccab->szCab)); - return TRUE; - } - return FALSE; -} - -static FNFCIGETOPENINFO(cb_getopeninfo) -{ - BY_HANDLE_FILE_INFORMATION bhfi; - FILETIME filetime; - HANDLE handle; - - wchar_t *ws = utf8_to_wchar(pszName, err); - if (ws == NULL) { - return -1; - } - - /* Need Win32 handle to get time stamps */ - handle = CreateFileW(ws, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (handle == INVALID_HANDLE_VALUE) { - PyMem_Free(ws); - return -1; - } - - if (GetFileInformationByHandle(handle, &bhfi) == FALSE) { - CloseHandle(handle); - PyMem_Free(ws); - return -1; - } - - FileTimeToLocalFileTime(&bhfi.ftLastWriteTime, &filetime); - FileTimeToDosDateTime(&filetime, pdate, ptime); - - *pattribs = (int)(bhfi.dwFileAttributes & - (_A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH)); - - CloseHandle(handle); - - int result = _wopen(ws, _O_RDONLY | _O_BINARY | O_NOINHERIT); - PyMem_Free(ws); - return result; -} - -/*[clinic input] -_msi.FCICreate - cabname: str - the name of the CAB file - files: object - a list of tuples, each containing the name of the file on disk, - and the name of the file inside the CAB file - / - -Create a new CAB file. -[clinic start generated code]*/ - -static PyObject * -_msi_FCICreate_impl(PyObject *module, const char *cabname, PyObject *files) -/*[clinic end generated code: output=55dc05728361b799 input=1d2d75fdc8b44b71]*/ -{ - const char *p; - CCAB ccab; - HFCI hfci; - ERF erf; - Py_ssize_t i; - - if (!PyList_Check(files)) { - PyErr_SetString(PyExc_TypeError, "FCICreate expects a list"); - return NULL; - } - - ccab.cb = INT_MAX; /* no need to split CAB into multiple media */ - ccab.cbFolderThresh = 1000000; /* flush directory after this many bytes */ - ccab.cbReserveCFData = 0; - ccab.cbReserveCFFolder = 0; - ccab.cbReserveCFHeader = 0; - - ccab.iCab = 1; - ccab.iDisk = 1; - - ccab.setID = 0; - ccab.szDisk[0] = '\0'; - - for (i = 0, p = cabname; *p; p++) - if (*p == '\\' || *p == '/') - i = p - cabname + 1; - - if (i >= sizeof(ccab.szCabPath) || - strlen(cabname+i) >= sizeof(ccab.szCab)) { - PyErr_SetString(PyExc_ValueError, "path name too long"); - return 0; - } - - if (i > 0) { - memcpy(ccab.szCabPath, cabname, i); - ccab.szCabPath[i] = '\0'; - strcpy(ccab.szCab, cabname+i); - } else { - strcpy(ccab.szCabPath, ".\\"); - strcpy(ccab.szCab, cabname); - } - - hfci = FCICreate(&erf, cb_fileplaced, cb_alloc, cb_free, - cb_open, cb_read, cb_write, cb_close, cb_seek, cb_delete, - cb_gettempfile, &ccab, NULL); - - if (hfci == NULL) { - PyErr_Format(PyExc_ValueError, "FCI error %d", erf.erfOper); - return NULL; - } - - for (i=0; i < PyList_GET_SIZE(files); i++) { - PyObject *item = PyList_GET_ITEM(files, i); - char *filename, *cabname; - - if (!PyArg_ParseTuple(item, "ss", &filename, &cabname)) { - PyErr_SetString(PyExc_TypeError, "FCICreate expects a list of tuples containing two strings"); - FCIDestroy(hfci); - return NULL; - } - - if (!FCIAddFile(hfci, filename, cabname, FALSE, - cb_getnextcabinet, cb_status, cb_getopeninfo, - tcompTYPE_MSZIP)) - goto err; - } - - if (!FCIFlushCabinet(hfci, FALSE, cb_getnextcabinet, cb_status)) - goto err; - - if (!FCIDestroy(hfci)) - goto err; - - Py_RETURN_NONE; -err: - if(erf.fError) - PyErr_Format(PyExc_ValueError, "FCI error %d", erf.erfOper); /* XXX better error type */ - else - PyErr_SetString(PyExc_ValueError, "FCI general error"); - - FCIDestroy(hfci); - return NULL; -} - -typedef struct msiobj{ - PyObject_HEAD - MSIHANDLE h; -}msiobj; - -static void -msiobj_dealloc(msiobj* msidb) -{ - MsiCloseHandle(msidb->h); - msidb->h = 0; - PyObject_Free(msidb); -} - -static PyObject* -msierror(int status) -{ - int code; - char buf[2000]; - char *res = buf; - DWORD size = Py_ARRAY_LENGTH(buf); - MSIHANDLE err = MsiGetLastErrorRecord(); - - if (err == 0) { - switch(status) { - case ERROR_ACCESS_DENIED: - PyErr_SetString(MSIError, "access denied"); - return NULL; - case ERROR_FUNCTION_FAILED: - PyErr_SetString(MSIError, "function failed"); - return NULL; - case ERROR_INVALID_DATA: - PyErr_SetString(MSIError, "invalid data"); - return NULL; - case ERROR_INVALID_HANDLE: - PyErr_SetString(MSIError, "invalid handle"); - return NULL; - case ERROR_INVALID_STATE: - PyErr_SetString(MSIError, "invalid state"); - return NULL; - case ERROR_INVALID_PARAMETER: - PyErr_SetString(MSIError, "invalid parameter"); - return NULL; - case ERROR_OPEN_FAILED: - PyErr_SetString(MSIError, "open failed"); - return NULL; - case ERROR_CREATE_FAILED: - PyErr_SetString(MSIError, "create failed"); - return NULL; - default: - PyErr_Format(MSIError, "unknown error %x", status); - return NULL; - } - } - - code = MsiRecordGetInteger(err, 1); /* XXX code */ - if (MsiFormatRecord(0, err, res, &size) == ERROR_MORE_DATA) { - res = malloc(size+1); - if (res == NULL) { - MsiCloseHandle(err); - return PyErr_NoMemory(); - } - MsiFormatRecord(0, err, res, &size); - res[size]='\0'; - } - MsiCloseHandle(err); - PyErr_SetString(MSIError, res); - if (res != buf) - free(res); - return NULL; -} - -#include "clinic/_msi.c.h" - -/*[clinic input] -_msi.Database.Close - -Close the database object. -[clinic start generated code]*/ - -static PyObject * -_msi_Database_Close_impl(msiobj *self) -/*[clinic end generated code: output=ddf2d7712ea804f1 input=104330ce4a486187]*/ -{ - int status; - if ((status = MsiCloseHandle(self->h)) != ERROR_SUCCESS) { - return msierror(status); - } - self->h = 0; - Py_RETURN_NONE; -} - -/*************************** Record objects **********************/ - -/*[clinic input] -_msi.Record.GetFieldCount - -Return the number of fields of the record. -[clinic start generated code]*/ - -static PyObject * -_msi_Record_GetFieldCount_impl(msiobj *self) -/*[clinic end generated code: output=112795079c904398 input=5fb9d4071b28897b]*/ -{ - return PyLong_FromLong(MsiRecordGetFieldCount(self->h)); -} - -/*[clinic input] -_msi.Record.GetInteger - field: unsigned_int(bitwise=True) - / - -Return the value of field as an integer where possible. -[clinic start generated code]*/ - -static PyObject * -_msi_Record_GetInteger_impl(msiobj *self, unsigned int field) -/*[clinic end generated code: output=7174ebb6e8ed1c79 input=d19209947e2bfe61]*/ -{ - int status; - - status = MsiRecordGetInteger(self->h, field); - if (status == MSI_NULL_INTEGER){ - PyErr_SetString(MSIError, "could not convert record field to integer"); - return NULL; - } - return PyLong_FromLong((long) status); -} - -/*[clinic input] -_msi.Record.GetString - field: unsigned_int(bitwise=True) - / - -Return the value of field as a string where possible. -[clinic start generated code]*/ - -static PyObject * -_msi_Record_GetString_impl(msiobj *self, unsigned int field) -/*[clinic end generated code: output=f670d1b484cfa47c input=ffa11f21450b77d8]*/ -{ - unsigned int status; - WCHAR buf[2000]; - WCHAR *res = buf; - DWORD size = Py_ARRAY_LENGTH(buf); - PyObject* string; - - status = MsiRecordGetStringW(self->h, field, res, &size); - if (status == ERROR_MORE_DATA) { - res = (WCHAR*) malloc((size + 1)*sizeof(WCHAR)); - if (res == NULL) - return PyErr_NoMemory(); - status = MsiRecordGetStringW(self->h, field, res, &size); - } - if (status != ERROR_SUCCESS) - return msierror((int) status); - string = PyUnicode_FromWideChar(res, size); - if (buf != res) - free(res); - return string; -} - -/*[clinic input] -_msi.Record.ClearData - -Set all fields of the record to 0. -[clinic start generated code]*/ - -static PyObject * -_msi_Record_ClearData_impl(msiobj *self) -/*[clinic end generated code: output=1891467214b977f4 input=2a911c95aaded102]*/ -{ - int status = MsiRecordClearData(self->h); - if (status != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - -/*[clinic input] -_msi.Record.SetString - field: int - value: Py_UNICODE - / - -Set field to a string value. -[clinic start generated code]*/ - -static PyObject * -_msi_Record_SetString_impl(msiobj *self, int field, const Py_UNICODE *value) -/*[clinic end generated code: output=2e37505b0f11f985 input=fb8ec70a2a6148e0]*/ -{ - int status; - - if ((status = MsiRecordSetStringW(self->h, field, value)) != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - -/*[clinic input] -_msi.Record.SetStream - field: int - value: Py_UNICODE - / - -Set field to the contents of the file named value. -[clinic start generated code]*/ - -static PyObject * -_msi_Record_SetStream_impl(msiobj *self, int field, const Py_UNICODE *value) -/*[clinic end generated code: output=442facac16913b48 input=a07aa19b865e8292]*/ -{ - int status; - - if ((status = MsiRecordSetStreamW(self->h, field, value)) != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - -/*[clinic input] -_msi.Record.SetInteger - field: int - value: int - / - -Set field to an integer value. -[clinic start generated code]*/ - -static PyObject * -_msi_Record_SetInteger_impl(msiobj *self, int field, int value) -/*[clinic end generated code: output=669e8647775d0ce7 input=c571aa775e7e451b]*/ -{ - int status; - - if ((status = MsiRecordSetInteger(self->h, field, value)) != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - - - -static PyMethodDef record_methods[] = { - _MSI_RECORD_GETFIELDCOUNT_METHODDEF - _MSI_RECORD_GETINTEGER_METHODDEF - _MSI_RECORD_GETSTRING_METHODDEF - _MSI_RECORD_SETSTRING_METHODDEF - _MSI_RECORD_SETSTREAM_METHODDEF - _MSI_RECORD_SETINTEGER_METHODDEF - _MSI_RECORD_CLEARDATA_METHODDEF - { NULL, NULL } -}; - -static PyTypeObject record_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "_msi.Record", /*tp_name*/ - sizeof(msiobj), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - /* methods */ - (destructor)msiobj_dealloc, /*tp_dealloc*/ - 0, /*tp_vectorcall_offset*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_as_async*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - PyObject_GenericGetAttr,/*tp_getattro*/ - PyObject_GenericSetAttr,/*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - record_methods, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ -}; - -static PyObject* -record_new(MSIHANDLE h) -{ - msiobj *result = PyObject_New(struct msiobj, &record_Type); - - if (!result) { - MsiCloseHandle(h); - return NULL; - } - - result->h = h; - return (PyObject*)result; -} - -/*************************** SummaryInformation objects **************/ - -/*[clinic input] -_msi.SummaryInformation.GetProperty - field: int - the name of the property, one of the PID_* constants - / - -Return a property of the summary. -[clinic start generated code]*/ - -static PyObject * -_msi_SummaryInformation_GetProperty_impl(msiobj *self, int field) -/*[clinic end generated code: output=f8946a33ee14f6ef input=f8dfe2c890d6cb8b]*/ -{ - int status; - PyObject *result; - UINT type; - INT ival; - FILETIME fval; - char sbuf[1000]; - char *sval = sbuf; - DWORD ssize = sizeof(sbuf); - - status = MsiSummaryInfoGetProperty(self->h, field, &type, &ival, - &fval, sval, &ssize); - if (status == ERROR_MORE_DATA) { - ssize++; - sval = malloc(ssize); - if (sval == NULL) { - return PyErr_NoMemory(); - } - status = MsiSummaryInfoGetProperty(self->h, field, &type, &ival, - &fval, sval, &ssize); - } - if (status != ERROR_SUCCESS) { - return msierror(status); - } - - switch(type) { - case VT_I2: - case VT_I4: - result = PyLong_FromLong(ival); - break; - case VT_FILETIME: - PyErr_SetString(PyExc_NotImplementedError, "FILETIME result"); - result = NULL; - break; - case VT_LPSTR: - result = PyBytes_FromStringAndSize(sval, ssize); - break; - case VT_EMPTY: - result = Py_NewRef(Py_None); - break; - default: - PyErr_Format(PyExc_NotImplementedError, "result of type %d", type); - result = NULL; - break; - } - if (sval != sbuf) - free(sval); - return result; -} - -/*[clinic input] -_msi.SummaryInformation.GetPropertyCount - -Return the number of summary properties. -[clinic start generated code]*/ - -static PyObject * -_msi_SummaryInformation_GetPropertyCount_impl(msiobj *self) -/*[clinic end generated code: output=68e94b2aeee92b3d input=2e71e985586d82dc]*/ -{ - int status; - UINT result; - - status = MsiSummaryInfoGetPropertyCount(self->h, &result); - if (status != ERROR_SUCCESS) - return msierror(status); - - return PyLong_FromLong(result); -} - -/*[clinic input] -_msi.SummaryInformation.SetProperty - field: int - the name of the property, one of the PID_* constants - value as data: object - the new value of the property (integer or string) - / - -Set a property. -[clinic start generated code]*/ - -static PyObject * -_msi_SummaryInformation_SetProperty_impl(msiobj *self, int field, - PyObject *data) -/*[clinic end generated code: output=3d4692c8984bb675 input=f2a7811b905abbed]*/ -{ - int status; - - if (PyUnicode_Check(data)) { - WCHAR *value = PyUnicode_AsWideCharString(data, NULL); - if (value == NULL) { - return NULL; - } - status = MsiSummaryInfoSetPropertyW(self->h, field, VT_LPSTR, - 0, NULL, value); - PyMem_Free(value); - } else if (PyLong_CheckExact(data)) { - long value = PyLong_AsLong(data); - if (value == -1 && PyErr_Occurred()) { - return NULL; - } - status = MsiSummaryInfoSetProperty(self->h, field, VT_I4, - value, NULL, NULL); - } else { - PyErr_SetString(PyExc_TypeError, "unsupported type"); - return NULL; - } - - if (status != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - - -/*[clinic input] -_msi.SummaryInformation.Persist - -Write the modified properties to the summary information stream. -[clinic start generated code]*/ - -static PyObject * -_msi_SummaryInformation_Persist_impl(msiobj *self) -/*[clinic end generated code: output=c564bd17f5e122c9 input=e3dda9d530095ef7]*/ -{ - int status; - - status = MsiSummaryInfoPersist(self->h); - if (status != ERROR_SUCCESS) - return msierror(status); - Py_RETURN_NONE; -} - -static PyMethodDef summary_methods[] = { - _MSI_SUMMARYINFORMATION_GETPROPERTY_METHODDEF - _MSI_SUMMARYINFORMATION_GETPROPERTYCOUNT_METHODDEF - _MSI_SUMMARYINFORMATION_SETPROPERTY_METHODDEF - _MSI_SUMMARYINFORMATION_PERSIST_METHODDEF - { NULL, NULL } -}; - -static PyTypeObject summary_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "_msi.SummaryInformation", /*tp_name*/ - sizeof(msiobj), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - /* methods */ - (destructor)msiobj_dealloc, /*tp_dealloc*/ - 0, /*tp_vectorcall_offset*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_as_async*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - PyObject_GenericGetAttr,/*tp_getattro*/ - PyObject_GenericSetAttr,/*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - summary_methods, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ -}; - -/*************************** View objects **************/ - -/*[clinic input] -_msi.View.Execute - params as oparams: object - a record describing actual values of the parameter tokens - in the query or None - / - -Execute the SQL query of the view. -[clinic start generated code]*/ - -static PyObject * -_msi_View_Execute(msiobj *self, PyObject *oparams) -/*[clinic end generated code: output=f0f65fd2900bcb4e input=cb163a15d453348e]*/ -{ - int status; - MSIHANDLE params = 0; - - if (oparams != Py_None) { - if (!Py_IS_TYPE(oparams, &record_Type)) { - PyErr_SetString(PyExc_TypeError, "Execute argument must be a record"); - return NULL; - } - params = ((msiobj*)oparams)->h; - } - - status = MsiViewExecute(self->h, params); - if (status != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - -/*[clinic input] -_msi.View.Fetch - -Return a result record of the query. -[clinic start generated code]*/ - -static PyObject * -_msi_View_Fetch_impl(msiobj *self) -/*[clinic end generated code: output=ba154a3794537d4e input=7f3e3d06c449001c]*/ -{ - int status; - MSIHANDLE result; - - status = MsiViewFetch(self->h, &result); - if (status == ERROR_NO_MORE_ITEMS) { - Py_RETURN_NONE; - } else if (status != ERROR_SUCCESS) { - return msierror(status); - } - - return record_new(result); -} - -/*[clinic input] -_msi.View.GetColumnInfo - kind: int - MSICOLINFO_NAMES or MSICOLINFO_TYPES - / - -Return a record describing the columns of the view. -[clinic start generated code]*/ - -static PyObject * -_msi_View_GetColumnInfo_impl(msiobj *self, int kind) -/*[clinic end generated code: output=e7c1697db9403660 input=afedb892bf564a3b]*/ -{ - int status; - MSIHANDLE result; - - if ((status = MsiViewGetColumnInfo(self->h, kind, &result)) != ERROR_SUCCESS) - return msierror(status); - - return record_new(result); -} - -/*[clinic input] -_msi.View.Modify - kind: int - one of the MSIMODIFY_* constants - data: object - a record describing the new data - / - -Modify the view. -[clinic start generated code]*/ - -static PyObject * -_msi_View_Modify_impl(msiobj *self, int kind, PyObject *data) -/*[clinic end generated code: output=69aaf3ce8ddac0ba input=2828de22de0d47b4]*/ -{ - int status; - - if (!Py_IS_TYPE(data, &record_Type)) { - PyErr_SetString(PyExc_TypeError, "Modify expects a record object"); - return NULL; - } - - if ((status = MsiViewModify(self->h, kind, ((msiobj*)data)->h)) != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - -/*[clinic input] -_msi.View.Close - -Close the view. -[clinic start generated code]*/ - -static PyObject * -_msi_View_Close_impl(msiobj *self) -/*[clinic end generated code: output=488f7b8645ca104a input=de6927d1308c401c]*/ -{ - int status; - - if ((status = MsiViewClose(self->h)) != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - -static PyMethodDef view_methods[] = { - _MSI_VIEW_EXECUTE_METHODDEF - _MSI_VIEW_GETCOLUMNINFO_METHODDEF - _MSI_VIEW_FETCH_METHODDEF - _MSI_VIEW_MODIFY_METHODDEF - _MSI_VIEW_CLOSE_METHODDEF - { NULL, NULL } -}; - -static PyTypeObject msiview_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "_msi.View", /*tp_name*/ - sizeof(msiobj), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - /* methods */ - (destructor)msiobj_dealloc, /*tp_dealloc*/ - 0, /*tp_vectorcall_offset*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_as_async*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - PyObject_GenericGetAttr,/*tp_getattro*/ - PyObject_GenericSetAttr,/*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - view_methods, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ -}; - -/*************************** Database objects **************/ - -/*[clinic input] -_msi.Database.OpenView - sql: Py_UNICODE - the SQL statement to execute - / - -Return a view object. -[clinic start generated code]*/ - -static PyObject * -_msi_Database_OpenView_impl(msiobj *self, const Py_UNICODE *sql) -/*[clinic end generated code: output=e712e6a11229abfd input=50f1771f37e500df]*/ -{ - int status; - MSIHANDLE hView; - msiobj *result; - - if ((status = MsiDatabaseOpenViewW(self->h, sql, &hView)) != ERROR_SUCCESS) - return msierror(status); - - result = PyObject_New(struct msiobj, &msiview_Type); - if (!result) { - MsiCloseHandle(hView); - return NULL; - } - - result->h = hView; - return (PyObject*)result; -} - -/*[clinic input] -_msi.Database.Commit - -Commit the changes pending in the current transaction. -[clinic start generated code]*/ - -static PyObject * -_msi_Database_Commit_impl(msiobj *self) -/*[clinic end generated code: output=f33021feb8b0cdd8 input=375bb120d402266d]*/ -{ - int status; - - if ((status = MsiDatabaseCommit(self->h)) != ERROR_SUCCESS) - return msierror(status); - - Py_RETURN_NONE; -} - -/*[clinic input] -_msi.Database.GetSummaryInformation - count: int - the maximum number of updated values - / - -Return a new summary information object. -[clinic start generated code]*/ - -static PyObject * -_msi_Database_GetSummaryInformation_impl(msiobj *self, int count) -/*[clinic end generated code: output=781e51a4ea4da847 input=18a899ead6521735]*/ -{ - int status; - MSIHANDLE result; - msiobj *oresult; - - status = MsiGetSummaryInformation(self->h, NULL, count, &result); - if (status != ERROR_SUCCESS) - return msierror(status); - - oresult = PyObject_New(struct msiobj, &summary_Type); - if (!oresult) { - MsiCloseHandle(result); - return NULL; - } - - oresult->h = result; - return (PyObject*)oresult; -} - -static PyMethodDef db_methods[] = { - _MSI_DATABASE_OPENVIEW_METHODDEF - _MSI_DATABASE_COMMIT_METHODDEF - _MSI_DATABASE_GETSUMMARYINFORMATION_METHODDEF - _MSI_DATABASE_CLOSE_METHODDEF - { NULL, NULL } -}; - -static PyTypeObject msidb_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "_msi.Database", /*tp_name*/ - sizeof(msiobj), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - /* methods */ - (destructor)msiobj_dealloc, /*tp_dealloc*/ - 0, /*tp_vectorcall_offset*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_as_async*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - PyObject_GenericGetAttr,/*tp_getattro*/ - PyObject_GenericSetAttr,/*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - db_methods, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ -}; - -#define Py_NOT_PERSIST(x, flag) \ - (x != (SIZE_T)(flag) && \ - x != ((SIZE_T)(flag) | MSIDBOPEN_PATCHFILE)) - -#define Py_INVALID_PERSIST(x) \ - (Py_NOT_PERSIST(x, MSIDBOPEN_READONLY) && \ - Py_NOT_PERSIST(x, MSIDBOPEN_TRANSACT) && \ - Py_NOT_PERSIST(x, MSIDBOPEN_DIRECT) && \ - Py_NOT_PERSIST(x, MSIDBOPEN_CREATE) && \ - Py_NOT_PERSIST(x, MSIDBOPEN_CREATEDIRECT)) - -/*[clinic input] -_msi.OpenDatabase - path: Py_UNICODE - the file name of the MSI file - persist: int - the persistence mode - / - -Return a new database object. -[clinic start generated code]*/ - -static PyObject * -_msi_OpenDatabase_impl(PyObject *module, const Py_UNICODE *path, int persist) -/*[clinic end generated code: output=d34b7202b745de05 input=1300f3b97659559b]*/ -{ - int status; - MSIHANDLE h; - msiobj *result; - - /* We need to validate that persist is a valid MSIDBOPEN_* value. Otherwise, - MsiOpenDatabase may treat the value as a pointer, leading to unexpected - behavior. */ - if (Py_INVALID_PERSIST(persist)) - return msierror(ERROR_INVALID_PARAMETER); - status = MsiOpenDatabaseW(path, (LPCWSTR)(SIZE_T)persist, &h); - if (status != ERROR_SUCCESS) - return msierror(status); - - result = PyObject_New(struct msiobj, &msidb_Type); - if (!result) { - MsiCloseHandle(h); - return NULL; - } - result->h = h; - return (PyObject*)result; -} - -/*[clinic input] -_msi.CreateRecord - count: int - the number of fields of the record - / - -Return a new record object. -[clinic start generated code]*/ - -static PyObject * -_msi_CreateRecord_impl(PyObject *module, int count) -/*[clinic end generated code: output=0ba0a00beea3e99e input=53f17d5b5d9b077d]*/ -{ - MSIHANDLE h; - - h = MsiCreateRecord(count); - if (h == 0) - return msierror(0); - - return record_new(h); -} - - -static PyMethodDef msi_methods[] = { - _MSI_UUIDCREATE_METHODDEF - _MSI_FCICREATE_METHODDEF - _MSI_OPENDATABASE_METHODDEF - _MSI_CREATERECORD_METHODDEF - {NULL, NULL} /* sentinel */ -}; - -static char msi_doc[] = "Documentation"; - - -static struct PyModuleDef _msimodule = { - PyModuleDef_HEAD_INIT, - "_msi", - msi_doc, - -1, - msi_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC -PyInit__msi(void) -{ - PyObject *m; - - m = PyModule_Create(&_msimodule); - if (m == NULL) - return NULL; - - PyModule_AddIntConstant(m, "MSIDBOPEN_CREATEDIRECT", (long)(SIZE_T)MSIDBOPEN_CREATEDIRECT); - PyModule_AddIntConstant(m, "MSIDBOPEN_CREATE", (long)(SIZE_T)MSIDBOPEN_CREATE); - PyModule_AddIntConstant(m, "MSIDBOPEN_DIRECT", (long)(SIZE_T)MSIDBOPEN_DIRECT); - PyModule_AddIntConstant(m, "MSIDBOPEN_READONLY", (long)(SIZE_T)MSIDBOPEN_READONLY); - PyModule_AddIntConstant(m, "MSIDBOPEN_TRANSACT", (long)(SIZE_T)MSIDBOPEN_TRANSACT); - PyModule_AddIntConstant(m, "MSIDBOPEN_PATCHFILE", (long)(SIZE_T)MSIDBOPEN_PATCHFILE); - - PyModule_AddIntMacro(m, MSICOLINFO_NAMES); - PyModule_AddIntMacro(m, MSICOLINFO_TYPES); - - PyModule_AddIntMacro(m, MSIMODIFY_SEEK); - PyModule_AddIntMacro(m, MSIMODIFY_REFRESH); - PyModule_AddIntMacro(m, MSIMODIFY_INSERT); - PyModule_AddIntMacro(m, MSIMODIFY_UPDATE); - PyModule_AddIntMacro(m, MSIMODIFY_ASSIGN); - PyModule_AddIntMacro(m, MSIMODIFY_REPLACE); - PyModule_AddIntMacro(m, MSIMODIFY_MERGE); - PyModule_AddIntMacro(m, MSIMODIFY_DELETE); - PyModule_AddIntMacro(m, MSIMODIFY_INSERT_TEMPORARY); - PyModule_AddIntMacro(m, MSIMODIFY_VALIDATE); - PyModule_AddIntMacro(m, MSIMODIFY_VALIDATE_NEW); - PyModule_AddIntMacro(m, MSIMODIFY_VALIDATE_FIELD); - PyModule_AddIntMacro(m, MSIMODIFY_VALIDATE_DELETE); - - PyModule_AddIntMacro(m, PID_CODEPAGE); - PyModule_AddIntMacro(m, PID_TITLE); - PyModule_AddIntMacro(m, PID_SUBJECT); - PyModule_AddIntMacro(m, PID_AUTHOR); - PyModule_AddIntMacro(m, PID_KEYWORDS); - PyModule_AddIntMacro(m, PID_COMMENTS); - PyModule_AddIntMacro(m, PID_TEMPLATE); - PyModule_AddIntMacro(m, PID_LASTAUTHOR); - PyModule_AddIntMacro(m, PID_REVNUMBER); - PyModule_AddIntMacro(m, PID_LASTPRINTED); - PyModule_AddIntMacro(m, PID_CREATE_DTM); - PyModule_AddIntMacro(m, PID_LASTSAVE_DTM); - PyModule_AddIntMacro(m, PID_PAGECOUNT); - PyModule_AddIntMacro(m, PID_WORDCOUNT); - PyModule_AddIntMacro(m, PID_CHARCOUNT); - PyModule_AddIntMacro(m, PID_APPNAME); - PyModule_AddIntMacro(m, PID_SECURITY); - - MSIError = PyErr_NewException ("_msi.MSIError", NULL, NULL); - if (!MSIError) - return NULL; - PyModule_AddObject(m, "MSIError", MSIError); - return m; -} diff --git a/PC/clinic/_msi.c.h b/PC/clinic/_msi.c.h deleted file mode 100644 index c77f0703927..00000000000 --- a/PC/clinic/_msi.c.h +++ /dev/null @@ -1,698 +0,0 @@ -/*[clinic input] -preserve -[clinic start generated code]*/ - -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - -PyDoc_STRVAR(_msi_UuidCreate__doc__, -"UuidCreate($module, /)\n" -"--\n" -"\n" -"Return the string representation of a new unique identifier."); - -#define _MSI_UUIDCREATE_METHODDEF \ - {"UuidCreate", (PyCFunction)_msi_UuidCreate, METH_NOARGS, _msi_UuidCreate__doc__}, - -static PyObject * -_msi_UuidCreate_impl(PyObject *module); - -static PyObject * -_msi_UuidCreate(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return _msi_UuidCreate_impl(module); -} - -PyDoc_STRVAR(_msi_FCICreate__doc__, -"FCICreate($module, cabname, files, /)\n" -"--\n" -"\n" -"Create a new CAB file.\n" -"\n" -" cabname\n" -" the name of the CAB file\n" -" files\n" -" a list of tuples, each containing the name of the file on disk,\n" -" and the name of the file inside the CAB file"); - -#define _MSI_FCICREATE_METHODDEF \ - {"FCICreate", _PyCFunction_CAST(_msi_FCICreate), METH_FASTCALL, _msi_FCICreate__doc__}, - -static PyObject * -_msi_FCICreate_impl(PyObject *module, const char *cabname, PyObject *files); - -static PyObject * -_msi_FCICreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - const char *cabname; - PyObject *files; - - if (!_PyArg_CheckPositional("FCICreate", nargs, 2, 2)) { - goto exit; - } - if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("FCICreate", "argument 1", "str", args[0]); - goto exit; - } - Py_ssize_t cabname_length; - cabname = PyUnicode_AsUTF8AndSize(args[0], &cabname_length); - if (cabname == NULL) { - goto exit; - } - if (strlen(cabname) != (size_t)cabname_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - files = args[1]; - return_value = _msi_FCICreate_impl(module, cabname, files); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_Database_Close__doc__, -"Close($self, /)\n" -"--\n" -"\n" -"Close the database object."); - -#define _MSI_DATABASE_CLOSE_METHODDEF \ - {"Close", (PyCFunction)_msi_Database_Close, METH_NOARGS, _msi_Database_Close__doc__}, - -static PyObject * -_msi_Database_Close_impl(msiobj *self); - -static PyObject * -_msi_Database_Close(msiobj *self, PyObject *Py_UNUSED(ignored)) -{ - return _msi_Database_Close_impl(self); -} - -PyDoc_STRVAR(_msi_Record_GetFieldCount__doc__, -"GetFieldCount($self, /)\n" -"--\n" -"\n" -"Return the number of fields of the record."); - -#define _MSI_RECORD_GETFIELDCOUNT_METHODDEF \ - {"GetFieldCount", (PyCFunction)_msi_Record_GetFieldCount, METH_NOARGS, _msi_Record_GetFieldCount__doc__}, - -static PyObject * -_msi_Record_GetFieldCount_impl(msiobj *self); - -static PyObject * -_msi_Record_GetFieldCount(msiobj *self, PyObject *Py_UNUSED(ignored)) -{ - return _msi_Record_GetFieldCount_impl(self); -} - -PyDoc_STRVAR(_msi_Record_GetInteger__doc__, -"GetInteger($self, field, /)\n" -"--\n" -"\n" -"Return the value of field as an integer where possible."); - -#define _MSI_RECORD_GETINTEGER_METHODDEF \ - {"GetInteger", (PyCFunction)_msi_Record_GetInteger, METH_O, _msi_Record_GetInteger__doc__}, - -static PyObject * -_msi_Record_GetInteger_impl(msiobj *self, unsigned int field); - -static PyObject * -_msi_Record_GetInteger(msiobj *self, PyObject *arg) -{ - PyObject *return_value = NULL; - unsigned int field; - - field = (unsigned int)PyLong_AsUnsignedLongMask(arg); - if (field == (unsigned int)-1 && PyErr_Occurred()) { - goto exit; - } - return_value = _msi_Record_GetInteger_impl(self, field); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_Record_GetString__doc__, -"GetString($self, field, /)\n" -"--\n" -"\n" -"Return the value of field as a string where possible."); - -#define _MSI_RECORD_GETSTRING_METHODDEF \ - {"GetString", (PyCFunction)_msi_Record_GetString, METH_O, _msi_Record_GetString__doc__}, - -static PyObject * -_msi_Record_GetString_impl(msiobj *self, unsigned int field); - -static PyObject * -_msi_Record_GetString(msiobj *self, PyObject *arg) -{ - PyObject *return_value = NULL; - unsigned int field; - - field = (unsigned int)PyLong_AsUnsignedLongMask(arg); - if (field == (unsigned int)-1 && PyErr_Occurred()) { - goto exit; - } - return_value = _msi_Record_GetString_impl(self, field); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_Record_ClearData__doc__, -"ClearData($self, /)\n" -"--\n" -"\n" -"Set all fields of the record to 0."); - -#define _MSI_RECORD_CLEARDATA_METHODDEF \ - {"ClearData", (PyCFunction)_msi_Record_ClearData, METH_NOARGS, _msi_Record_ClearData__doc__}, - -static PyObject * -_msi_Record_ClearData_impl(msiobj *self); - -static PyObject * -_msi_Record_ClearData(msiobj *self, PyObject *Py_UNUSED(ignored)) -{ - return _msi_Record_ClearData_impl(self); -} - -PyDoc_STRVAR(_msi_Record_SetString__doc__, -"SetString($self, field, value, /)\n" -"--\n" -"\n" -"Set field to a string value."); - -#define _MSI_RECORD_SETSTRING_METHODDEF \ - {"SetString", _PyCFunction_CAST(_msi_Record_SetString), METH_FASTCALL, _msi_Record_SetString__doc__}, - -static PyObject * -_msi_Record_SetString_impl(msiobj *self, int field, const Py_UNICODE *value); - -static PyObject * -_msi_Record_SetString(msiobj *self, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - int field; - const Py_UNICODE *value = NULL; - - if (!_PyArg_CheckPositional("SetString", nargs, 2, 2)) { - goto exit; - } - field = _PyLong_AsInt(args[0]); - if (field == -1 && PyErr_Occurred()) { - goto exit; - } - if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("SetString", "argument 2", "str", args[1]); - goto exit; - } - value = PyUnicode_AsWideCharString(args[1], NULL); - if (value == NULL) { - goto exit; - } - return_value = _msi_Record_SetString_impl(self, field, value); - -exit: - /* Cleanup for value */ - PyMem_Free((void *)value); - - return return_value; -} - -PyDoc_STRVAR(_msi_Record_SetStream__doc__, -"SetStream($self, field, value, /)\n" -"--\n" -"\n" -"Set field to the contents of the file named value."); - -#define _MSI_RECORD_SETSTREAM_METHODDEF \ - {"SetStream", _PyCFunction_CAST(_msi_Record_SetStream), METH_FASTCALL, _msi_Record_SetStream__doc__}, - -static PyObject * -_msi_Record_SetStream_impl(msiobj *self, int field, const Py_UNICODE *value); - -static PyObject * -_msi_Record_SetStream(msiobj *self, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - int field; - const Py_UNICODE *value = NULL; - - if (!_PyArg_CheckPositional("SetStream", nargs, 2, 2)) { - goto exit; - } - field = _PyLong_AsInt(args[0]); - if (field == -1 && PyErr_Occurred()) { - goto exit; - } - if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("SetStream", "argument 2", "str", args[1]); - goto exit; - } - value = PyUnicode_AsWideCharString(args[1], NULL); - if (value == NULL) { - goto exit; - } - return_value = _msi_Record_SetStream_impl(self, field, value); - -exit: - /* Cleanup for value */ - PyMem_Free((void *)value); - - return return_value; -} - -PyDoc_STRVAR(_msi_Record_SetInteger__doc__, -"SetInteger($self, field, value, /)\n" -"--\n" -"\n" -"Set field to an integer value."); - -#define _MSI_RECORD_SETINTEGER_METHODDEF \ - {"SetInteger", _PyCFunction_CAST(_msi_Record_SetInteger), METH_FASTCALL, _msi_Record_SetInteger__doc__}, - -static PyObject * -_msi_Record_SetInteger_impl(msiobj *self, int field, int value); - -static PyObject * -_msi_Record_SetInteger(msiobj *self, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - int field; - int value; - - if (!_PyArg_CheckPositional("SetInteger", nargs, 2, 2)) { - goto exit; - } - field = _PyLong_AsInt(args[0]); - if (field == -1 && PyErr_Occurred()) { - goto exit; - } - value = _PyLong_AsInt(args[1]); - if (value == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = _msi_Record_SetInteger_impl(self, field, value); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_SummaryInformation_GetProperty__doc__, -"GetProperty($self, field, /)\n" -"--\n" -"\n" -"Return a property of the summary.\n" -"\n" -" field\n" -" the name of the property, one of the PID_* constants"); - -#define _MSI_SUMMARYINFORMATION_GETPROPERTY_METHODDEF \ - {"GetProperty", (PyCFunction)_msi_SummaryInformation_GetProperty, METH_O, _msi_SummaryInformation_GetProperty__doc__}, - -static PyObject * -_msi_SummaryInformation_GetProperty_impl(msiobj *self, int field); - -static PyObject * -_msi_SummaryInformation_GetProperty(msiobj *self, PyObject *arg) -{ - PyObject *return_value = NULL; - int field; - - field = _PyLong_AsInt(arg); - if (field == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = _msi_SummaryInformation_GetProperty_impl(self, field); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_SummaryInformation_GetPropertyCount__doc__, -"GetPropertyCount($self, /)\n" -"--\n" -"\n" -"Return the number of summary properties."); - -#define _MSI_SUMMARYINFORMATION_GETPROPERTYCOUNT_METHODDEF \ - {"GetPropertyCount", (PyCFunction)_msi_SummaryInformation_GetPropertyCount, METH_NOARGS, _msi_SummaryInformation_GetPropertyCount__doc__}, - -static PyObject * -_msi_SummaryInformation_GetPropertyCount_impl(msiobj *self); - -static PyObject * -_msi_SummaryInformation_GetPropertyCount(msiobj *self, PyObject *Py_UNUSED(ignored)) -{ - return _msi_SummaryInformation_GetPropertyCount_impl(self); -} - -PyDoc_STRVAR(_msi_SummaryInformation_SetProperty__doc__, -"SetProperty($self, field, value, /)\n" -"--\n" -"\n" -"Set a property.\n" -"\n" -" field\n" -" the name of the property, one of the PID_* constants\n" -" value\n" -" the new value of the property (integer or string)"); - -#define _MSI_SUMMARYINFORMATION_SETPROPERTY_METHODDEF \ - {"SetProperty", _PyCFunction_CAST(_msi_SummaryInformation_SetProperty), METH_FASTCALL, _msi_SummaryInformation_SetProperty__doc__}, - -static PyObject * -_msi_SummaryInformation_SetProperty_impl(msiobj *self, int field, - PyObject *data); - -static PyObject * -_msi_SummaryInformation_SetProperty(msiobj *self, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - int field; - PyObject *data; - - if (!_PyArg_CheckPositional("SetProperty", nargs, 2, 2)) { - goto exit; - } - field = _PyLong_AsInt(args[0]); - if (field == -1 && PyErr_Occurred()) { - goto exit; - } - data = args[1]; - return_value = _msi_SummaryInformation_SetProperty_impl(self, field, data); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_SummaryInformation_Persist__doc__, -"Persist($self, /)\n" -"--\n" -"\n" -"Write the modified properties to the summary information stream."); - -#define _MSI_SUMMARYINFORMATION_PERSIST_METHODDEF \ - {"Persist", (PyCFunction)_msi_SummaryInformation_Persist, METH_NOARGS, _msi_SummaryInformation_Persist__doc__}, - -static PyObject * -_msi_SummaryInformation_Persist_impl(msiobj *self); - -static PyObject * -_msi_SummaryInformation_Persist(msiobj *self, PyObject *Py_UNUSED(ignored)) -{ - return _msi_SummaryInformation_Persist_impl(self); -} - -PyDoc_STRVAR(_msi_View_Execute__doc__, -"Execute($self, params, /)\n" -"--\n" -"\n" -"Execute the SQL query of the view.\n" -"\n" -" params\n" -" a record describing actual values of the parameter tokens\n" -" in the query or None"); - -#define _MSI_VIEW_EXECUTE_METHODDEF \ - {"Execute", (PyCFunction)_msi_View_Execute, METH_O, _msi_View_Execute__doc__}, - -PyDoc_STRVAR(_msi_View_Fetch__doc__, -"Fetch($self, /)\n" -"--\n" -"\n" -"Return a result record of the query."); - -#define _MSI_VIEW_FETCH_METHODDEF \ - {"Fetch", (PyCFunction)_msi_View_Fetch, METH_NOARGS, _msi_View_Fetch__doc__}, - -static PyObject * -_msi_View_Fetch_impl(msiobj *self); - -static PyObject * -_msi_View_Fetch(msiobj *self, PyObject *Py_UNUSED(ignored)) -{ - return _msi_View_Fetch_impl(self); -} - -PyDoc_STRVAR(_msi_View_GetColumnInfo__doc__, -"GetColumnInfo($self, kind, /)\n" -"--\n" -"\n" -"Return a record describing the columns of the view.\n" -"\n" -" kind\n" -" MSICOLINFO_NAMES or MSICOLINFO_TYPES"); - -#define _MSI_VIEW_GETCOLUMNINFO_METHODDEF \ - {"GetColumnInfo", (PyCFunction)_msi_View_GetColumnInfo, METH_O, _msi_View_GetColumnInfo__doc__}, - -static PyObject * -_msi_View_GetColumnInfo_impl(msiobj *self, int kind); - -static PyObject * -_msi_View_GetColumnInfo(msiobj *self, PyObject *arg) -{ - PyObject *return_value = NULL; - int kind; - - kind = _PyLong_AsInt(arg); - if (kind == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = _msi_View_GetColumnInfo_impl(self, kind); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_View_Modify__doc__, -"Modify($self, kind, data, /)\n" -"--\n" -"\n" -"Modify the view.\n" -"\n" -" kind\n" -" one of the MSIMODIFY_* constants\n" -" data\n" -" a record describing the new data"); - -#define _MSI_VIEW_MODIFY_METHODDEF \ - {"Modify", _PyCFunction_CAST(_msi_View_Modify), METH_FASTCALL, _msi_View_Modify__doc__}, - -static PyObject * -_msi_View_Modify_impl(msiobj *self, int kind, PyObject *data); - -static PyObject * -_msi_View_Modify(msiobj *self, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - int kind; - PyObject *data; - - if (!_PyArg_CheckPositional("Modify", nargs, 2, 2)) { - goto exit; - } - kind = _PyLong_AsInt(args[0]); - if (kind == -1 && PyErr_Occurred()) { - goto exit; - } - data = args[1]; - return_value = _msi_View_Modify_impl(self, kind, data); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_View_Close__doc__, -"Close($self, /)\n" -"--\n" -"\n" -"Close the view."); - -#define _MSI_VIEW_CLOSE_METHODDEF \ - {"Close", (PyCFunction)_msi_View_Close, METH_NOARGS, _msi_View_Close__doc__}, - -static PyObject * -_msi_View_Close_impl(msiobj *self); - -static PyObject * -_msi_View_Close(msiobj *self, PyObject *Py_UNUSED(ignored)) -{ - return _msi_View_Close_impl(self); -} - -PyDoc_STRVAR(_msi_Database_OpenView__doc__, -"OpenView($self, sql, /)\n" -"--\n" -"\n" -"Return a view object.\n" -"\n" -" sql\n" -" the SQL statement to execute"); - -#define _MSI_DATABASE_OPENVIEW_METHODDEF \ - {"OpenView", (PyCFunction)_msi_Database_OpenView, METH_O, _msi_Database_OpenView__doc__}, - -static PyObject * -_msi_Database_OpenView_impl(msiobj *self, const Py_UNICODE *sql); - -static PyObject * -_msi_Database_OpenView(msiobj *self, PyObject *arg) -{ - PyObject *return_value = NULL; - const Py_UNICODE *sql = NULL; - - if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("OpenView", "argument", "str", arg); - goto exit; - } - sql = PyUnicode_AsWideCharString(arg, NULL); - if (sql == NULL) { - goto exit; - } - return_value = _msi_Database_OpenView_impl(self, sql); - -exit: - /* Cleanup for sql */ - PyMem_Free((void *)sql); - - return return_value; -} - -PyDoc_STRVAR(_msi_Database_Commit__doc__, -"Commit($self, /)\n" -"--\n" -"\n" -"Commit the changes pending in the current transaction."); - -#define _MSI_DATABASE_COMMIT_METHODDEF \ - {"Commit", (PyCFunction)_msi_Database_Commit, METH_NOARGS, _msi_Database_Commit__doc__}, - -static PyObject * -_msi_Database_Commit_impl(msiobj *self); - -static PyObject * -_msi_Database_Commit(msiobj *self, PyObject *Py_UNUSED(ignored)) -{ - return _msi_Database_Commit_impl(self); -} - -PyDoc_STRVAR(_msi_Database_GetSummaryInformation__doc__, -"GetSummaryInformation($self, count, /)\n" -"--\n" -"\n" -"Return a new summary information object.\n" -"\n" -" count\n" -" the maximum number of updated values"); - -#define _MSI_DATABASE_GETSUMMARYINFORMATION_METHODDEF \ - {"GetSummaryInformation", (PyCFunction)_msi_Database_GetSummaryInformation, METH_O, _msi_Database_GetSummaryInformation__doc__}, - -static PyObject * -_msi_Database_GetSummaryInformation_impl(msiobj *self, int count); - -static PyObject * -_msi_Database_GetSummaryInformation(msiobj *self, PyObject *arg) -{ - PyObject *return_value = NULL; - int count; - - count = _PyLong_AsInt(arg); - if (count == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = _msi_Database_GetSummaryInformation_impl(self, count); - -exit: - return return_value; -} - -PyDoc_STRVAR(_msi_OpenDatabase__doc__, -"OpenDatabase($module, path, persist, /)\n" -"--\n" -"\n" -"Return a new database object.\n" -"\n" -" path\n" -" the file name of the MSI file\n" -" persist\n" -" the persistence mode"); - -#define _MSI_OPENDATABASE_METHODDEF \ - {"OpenDatabase", _PyCFunction_CAST(_msi_OpenDatabase), METH_FASTCALL, _msi_OpenDatabase__doc__}, - -static PyObject * -_msi_OpenDatabase_impl(PyObject *module, const Py_UNICODE *path, int persist); - -static PyObject * -_msi_OpenDatabase(PyObject *module, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - const Py_UNICODE *path = NULL; - int persist; - - if (!_PyArg_CheckPositional("OpenDatabase", nargs, 2, 2)) { - goto exit; - } - if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("OpenDatabase", "argument 1", "str", args[0]); - goto exit; - } - path = PyUnicode_AsWideCharString(args[0], NULL); - if (path == NULL) { - goto exit; - } - persist = _PyLong_AsInt(args[1]); - if (persist == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = _msi_OpenDatabase_impl(module, path, persist); - -exit: - /* Cleanup for path */ - PyMem_Free((void *)path); - - return return_value; -} - -PyDoc_STRVAR(_msi_CreateRecord__doc__, -"CreateRecord($module, count, /)\n" -"--\n" -"\n" -"Return a new record object.\n" -"\n" -" count\n" -" the number of fields of the record"); - -#define _MSI_CREATERECORD_METHODDEF \ - {"CreateRecord", (PyCFunction)_msi_CreateRecord, METH_O, _msi_CreateRecord__doc__}, - -static PyObject * -_msi_CreateRecord_impl(PyObject *module, int count); - -static PyObject * -_msi_CreateRecord(PyObject *module, PyObject *arg) -{ - PyObject *return_value = NULL; - int count; - - count = _PyLong_AsInt(arg); - if (count == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = _msi_CreateRecord_impl(module, count); - -exit: - return return_value; -} -/*[clinic end generated code: output=7d083c61679eed83 input=a9049054013a1b77]*/ diff --git a/PCbuild/_msi.vcxproj b/PCbuild/_msi.vcxproj deleted file mode 100644 index 720eb2931be..00000000000 --- a/PCbuild/_msi.vcxproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Debug - x64 - - - PGInstrument - ARM - - - PGInstrument - ARM4 - - - PGInstrument - Win32 - - - PGInstrument - x64 - - - PGUpdate - ARM - - - PGUpdate - ARM64 - - - PGUpdate - Win32 - - - PGUpdate - x64 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Release - x64 - - - - {31FFC478-7B4A-43E8-9954-8D03E2187E9C} - _msi - Win32Proj - false - - - - - DynamicLibrary - NotSet - - - - .pyd - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - - - - cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies) - - - - - - - - - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - - - - - - \ No newline at end of file diff --git a/PCbuild/_msi.vcxproj.filters b/PCbuild/_msi.vcxproj.filters deleted file mode 100644 index a94fb18e61e..00000000000 --- a/PCbuild/_msi.vcxproj.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - {bdef7710-e433-4ac0-84e0-14f34454bd3e} - - - {8513f324-7c13-4657-b463-5d686a8a5371} - - - - - Source Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index e13a0d40929..46d6961eea0 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -64,7 +64,7 @@ - + diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln index 848d5950438..f8f1b83db97 100644 --- a/PCbuild/pcbuild.sln +++ b/PCbuild/pcbuild.sln @@ -68,8 +68,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ctypes_test", "_ctypes_tes EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_elementtree", "_elementtree.vcxproj", "{17E1E049-C309-4D79-843F-AE483C264AEA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_msi", "_msi.vcxproj", "{31FFC478-7B4A-43E8-9954-8D03E2187E9C}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sqlite3", "_sqlite3.vcxproj", "{13CECB97-4119-4316-9D42-8534019A5A44}" diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 3629525e33d..90342498274 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -138,7 +138,6 @@ _zoneinfo _decimal _elementtree _hashlib -_msi _multiprocessing _overlapped _socket diff --git a/Python/stdlib_module_names.h b/Python/stdlib_module_names.h index 6454db64035..f2d3ecb9753 100644 --- a/Python/stdlib_module_names.h +++ b/Python/stdlib_module_names.h @@ -45,7 +45,6 @@ static const char* _Py_stdlib_module_names[] = { "_lzma", "_markupbase", "_md5", -"_msi", "_multibytecodec", "_multiprocessing", "_opcode", @@ -180,7 +179,6 @@ static const char* _Py_stdlib_module_names[] = { "mimetypes", "mmap", "modulefinder", -"msilib", "msvcrt", "multiprocessing", "netrc", diff --git a/Tools/build/check_extension_modules.py b/Tools/build/check_extension_modules.py index 59239c62e2e..a9fee4981ea 100644 --- a/Tools/build/check_extension_modules.py +++ b/Tools/build/check_extension_modules.py @@ -50,7 +50,6 @@ # Windows-only modules WINDOWS_MODULES = { - "_msi", "_overlapped", "_testconsole", "_winapi", diff --git a/Tools/msi/lib/lib_files.wxs b/Tools/msi/lib/lib_files.wxs index 3e6761b6bd5..a82cad596d4 100644 --- a/Tools/msi/lib/lib_files.wxs +++ b/Tools/msi/lib/lib_files.wxs @@ -1,6 +1,6 @@  - + diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py index 3e9a14b1a25..c3db5d20349 100755 --- a/Tools/wasm/wasm_assets.py +++ b/Tools/wasm/wasm_assets.py @@ -56,7 +56,6 @@ "concurrent/futures/thread.py", # Misc unused or large files "pydoc_data/", - "msilib/", ) # Synchronous network I/O and protocols are not supported; for example,