Files
hustoj/web/python-docs/library/msilib.html
2025-03-09 17:10:56 +08:00

813 lines
64 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh_CN">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>msilib --- 读写 Microsoft Installer 文件 &#8212; Python 3.8.20 文档</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script src="../_static/translations.js"></script>
<script src="../_static/sidebar.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="在 Python 3.8.20 文档 中搜索"
href="../_static/opensearch.xml"/>
<link rel="author" title="关于这些文档" href="../about.html" />
<link rel="index" title="索引" href="../genindex.html" />
<link rel="search" title="搜索" href="../search.html" />
<link rel="copyright" title="版权所有" href="../copyright.html" />
<link rel="next" title="msvcrt --- 来自 MS VC++ 运行时的有用例程" href="msvcrt.html" />
<link rel="prev" title="Windows系统相关模块" href="windows.html" />
<link rel="canonical" href="https://docs.python.org/3/library/msilib.html" />
<style>
@media only screen {
table.full-width-table {
width: 100%;
}
}
</style>
<link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
<script type="text/javascript" src="../_static/copybutton.js"></script>
<script type="text/javascript" src="../_static/menu.js"></script>
</head>
<body>
<div class="mobile-nav">
<input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
<label for="menuToggler" class="toggler__label">
<span></span>
</label>
<nav class="nav-content" role="navigation">
<a href="https://www.python.org/" class="nav-logo">
<img src="../_static/py.svg" alt="Logo"/>
</a>
<div class="version_switcher_placeholder"></div>
<form role="search" class="search" action="../search.html" method="get">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
<path fill-rule="nonzero"
d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" fill="#444"></path>
</svg>
<input type="text" name="q" aria-label="快速搜索"/>
<input type="submit" value="转向"/>
</form>
</nav>
<div class="menu-wrapper">
<nav class="menu" role="navigation" aria-label="main navigation">
<div class="language_switcher_placeholder"></div>
<h3><a href="../contents.html">目录</a></h3>
<ul>
<li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib</span></code> --- 读写 Microsoft Installer 文件</a><ul>
<li><a class="reference internal" href="#database-objects">Database Objects</a></li>
<li><a class="reference internal" href="#view-objects">View Objects</a></li>
<li><a class="reference internal" href="#summary-information-objects">Summary Information Objects</a></li>
<li><a class="reference internal" href="#record-objects">Record Objects</a></li>
<li><a class="reference internal" href="#errors">Errors</a></li>
<li><a class="reference internal" href="#cab-objects">CAB Objects</a></li>
<li><a class="reference internal" href="#directory-objects">Directory Objects</a></li>
<li><a class="reference internal" href="#features">相关特性</a></li>
<li><a class="reference internal" href="#gui-classes">GUI classes</a></li>
<li><a class="reference internal" href="#precomputed-tables">Precomputed tables</a></li>
</ul>
</li>
</ul>
<h4>上一个主题</h4>
<p class="topless"><a href="windows.html"
title="上一章">Windows系统相关模块</a></p>
<h4>下一个主题</h4>
<p class="topless"><a href="msvcrt.html"
title="下一章"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msvcrt</span></code> --- 来自 MS VC++ 运行时的有用例程</a></p>
<div role="note" aria-label="source link">
<h3>本页</h3>
<ul class="this-page-menu">
<li><a href="../bugs.html">报告 Bug</a></li>
<li>
<a href="https://github.com/python/cpython/blob/3.8/Doc/library/msilib.rst"
rel="nofollow">显示源代码
</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<div id="outdated-warning" style="padding: .5em; text-align: center; background-color: #FFBABA; color: #6A0E0E;">
这个文档所针对的是一个已不再受支持的 Python 旧版本。
你应当升级版本,并阅读
<a href="/3/library/msilib.html"> Python 当前稳定版本的文档</a>.
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>导航</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="总目录"
accesskey="I">索引</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python 模块索引"
>模块</a> |</li>
<li class="right" >
<a href="msvcrt.html" title="msvcrt --- 来自 MS VC++ 运行时的有用例程"
accesskey="N">下一页</a> |</li>
<li class="right" >
<a href="windows.html" title="Windows系统相关模块"
accesskey="P">上一页</a> |</li>
<li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://www.python.org/">Python</a> &#187;</li>
<li class="switchers">
<div class="language_switcher_placeholder"></div>
<div class="version_switcher_placeholder"></div>
</li>
<li>
</li>
<li id="cpython-language-and-version">
<a href="../index.html">3.8.20 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="index.html" >Python 标准库</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="windows.html" accesskey="U">Windows系统相关模块</a> &#187;</li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="../search.html" method="get">
<input placeholder="快速搜索" aria-label="快速搜索" type="text" name="q" />
<input type="submit" value="转向" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
|
</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-msilib">
<span id="msilib-read-and-write-microsoft-installer-files"></span><h1><a class="reference internal" href="#module-msilib" title="msilib: Creation of Microsoft Installer files, and CAB files. (Windows)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib</span></code></a> --- 读写 Microsoft Installer 文件<a class="headerlink" href="#module-msilib" title="永久链接至标题"></a></h1>
<p><strong>源代码:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.8/Lib/msilib/__init__.py">Lib/msilib/__init__.py</a></p>
<hr class="docutils" id="index-0" />
<p><a class="reference internal" href="#module-msilib" title="msilib: Creation of Microsoft Installer files, and CAB files. (Windows)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib</span></code></a> 支持创建 Microsoft 安装器 (<code class="docutils literal notranslate"><span class="pre">.msi</span></code>) 文件。 由于这种文件往往包含一个嵌入的 &quot;cabinet&quot; 文件 (<code class="docutils literal notranslate"><span class="pre">.cab</span></code>),它也暴露了一个用于创建 CAB 文件的 API。 目前没有实现对读取 <code class="docutils literal notranslate"><span class="pre">.cab</span></code> 文件的支持;对于读取 <code class="docutils literal notranslate"><span class="pre">.msi</span></code> 数据库的支持则是可能的。</p>
<p>这个包的目标是提供对 <code class="docutils literal notranslate"><span class="pre">.msi</span></code> 文件中的全部表的完整访问,因此,它是一个相当低层级的 API。 这个包的两个主要应用是 <a class="reference internal" href="distutils.html#module-distutils" title="distutils: Support for building and installing Python modules into an existing Python installation."><code class="xref py py-mod docutils literal notranslate"><span class="pre">distutils</span></code></a> 命令 <code class="docutils literal notranslate"><span class="pre">bdist_msi</span></code>,以及创建 Python 安装程序包本身 (尽管它目前是使用不同版本的 <code class="docutils literal notranslate"><span class="pre">msilib</span></code>)。</p>
<p>这个包的内容可以大致分为四个部分:低层级 CAB 例程、低层级 MSI 例程、高层级 MSI 例程以及标准表结构。</p>
<dl class="function">
<dt id="msilib.FCICreate">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">FCICreate</code><span class="sig-paren">(</span><em class="sig-param">cabname</em>, <em class="sig-param">files</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.FCICreate" title="永久链接至目标"></a></dt>
<dd><p>新建一个名为 <em>cabname</em> 的 CAB 文件。 <em>files</em> 必须是一个元组的列表,其中每个元组包含磁盘文件的名称,以及 CAB 文件内文件的名称。</p>
<p>这些文件将按照它们在列表中出现的顺序被添加到 CAB 文件中。 所有文件都会被添加到单个 CAB 文件,使用 MSZIP 压缩算法。</p>
<p>目前没有暴露 MSI 创建的各个步骤对 Python 的回调。</p>
</dd></dl>
<dl class="function">
<dt id="msilib.UuidCreate">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">UuidCreate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.UuidCreate" title="永久链接至目标"></a></dt>
<dd><p>返回一个新的唯一标识符的字符串表示形式。 这封装了 Windows API 函数 <code class="xref c c-func docutils literal notranslate"><span class="pre">UuidCreate()</span></code><code class="xref c c-func docutils literal notranslate"><span class="pre">UuidToString()</span></code></p>
</dd></dl>
<dl class="function">
<dt id="msilib.OpenDatabase">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">OpenDatabase</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">persist</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.OpenDatabase" title="永久链接至目标"></a></dt>
<dd><p>通过调用 MsiOpenDatabase 来返回一个新的数据库对象。 <em>path</em> 为 MSI 文件的名称;<em>persist</em> 可以是常量 <code class="docutils literal notranslate"><span class="pre">MSIDBOPEN_CREATEDIRECT</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIDBOPEN_CREATE</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIDBOPEN_DIRECT</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIDBOPEN_READONLY</span></code><code class="docutils literal notranslate"><span class="pre">MSIDBOPEN_TRANSACT</span></code> 中的一个,并可能包括旗标 <code class="docutils literal notranslate"><span class="pre">MSIDBOPEN_PATCHFILE</span></code>。 请参阅 Microsoft 文档了解这些旗标的含义;根据这些旗标,将打开一个现有数据库,或者创建一个新数据库。</p>
</dd></dl>
<dl class="function">
<dt id="msilib.CreateRecord">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">CreateRecord</code><span class="sig-paren">(</span><em class="sig-param">count</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.CreateRecord" title="永久链接至目标"></a></dt>
<dd><p>通过调用 <code class="xref c c-func docutils literal notranslate"><span class="pre">MSICreateRecord()</span></code> 来返回一个新的记录对象。 <em>count</em> 为记录的字段数量。</p>
</dd></dl>
<dl class="function">
<dt id="msilib.init_database">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">init_database</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">schema</em>, <em class="sig-param">ProductName</em>, <em class="sig-param">ProductCode</em>, <em class="sig-param">ProductVersion</em>, <em class="sig-param">Manufacturer</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.init_database" title="永久链接至目标"></a></dt>
<dd><p>创建并返回一个新的数据库 <em>name</em>,使用 <em>schema</em> 来初始化它,并设置属性 <em>ProductName</em>, <em>ProductCode</em>, <em>ProductVersion</em><em>Manufacturer</em></p>
<p><em>schema</em> 必须是一个包含 <code class="docutils literal notranslate"><span class="pre">tables</span></code><code class="docutils literal notranslate"><span class="pre">_Validation_records</span></code> 属性的模块对象;在通常情况下,<a class="reference internal" href="#msilib.schema" title="msilib.schema"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib.schema</span></code></a> 应当被使用。</p>
<p>此此函数返回时该数据库将只包含方案和验证记录。</p>
</dd></dl>
<dl class="function">
<dt id="msilib.add_data">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">add_data</code><span class="sig-paren">(</span><em class="sig-param">database</em>, <em class="sig-param">table</em>, <em class="sig-param">records</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.add_data" title="永久链接至目标"></a></dt>
<dd><p>将所有 <em>records</em> 添加到 <em>database</em> 中名为 <em>table</em> 的表。</p>
<p><em>table</em> 参数必须为 MSI 方案中预定义的表之一,即 <code class="docutils literal notranslate"><span class="pre">'Feature'</span></code>, <code class="docutils literal notranslate"><span class="pre">'File'</span></code>, <code class="docutils literal notranslate"><span class="pre">'Component'</span></code>, <code class="docutils literal notranslate"><span class="pre">'Dialog'</span></code>, <code class="docutils literal notranslate"><span class="pre">'Control'</span></code> 等等。</p>
<p><em>records</em> 应当为一个元组的列表,其中的每个元组都包含与表结构对应的记录的所有字段。 对于可选字段,可以传入 <code class="docutils literal notranslate"><span class="pre">None</span></code></p>
<p>字段值可以为整数、字符串或 Binary 类的实例。</p>
</dd></dl>
<dl class="class">
<dt id="msilib.Binary">
<em class="property">class </em><code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">Binary</code><span class="sig-paren">(</span><em class="sig-param">filename</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Binary" title="永久链接至目标"></a></dt>
<dd><p>代表 Binary 表中的条目;使用 <a class="reference internal" href="#msilib.add_data" title="msilib.add_data"><code class="xref py py-func docutils literal notranslate"><span class="pre">add_data()</span></code></a> 插入这样的对象会将名为 <em>filename</em> 文件读入表中。</p>
</dd></dl>
<dl class="function">
<dt id="msilib.add_tables">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">add_tables</code><span class="sig-paren">(</span><em class="sig-param">database</em>, <em class="sig-param">module</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.add_tables" title="永久链接至目标"></a></dt>
<dd><p>将来自 <em>module</em> 的所有表内容添加到 <em>database</em><em>module</em> 必须包括一个列出其内容需要被添加的所有表的属性 <em>tables</em>,并且每个具有实际内容的表对应一个属性。</p>
<p>这通常被用来安装序列表。</p>
</dd></dl>
<dl class="function">
<dt id="msilib.add_stream">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">add_stream</code><span class="sig-paren">(</span><em class="sig-param">database</em>, <em class="sig-param">name</em>, <em class="sig-param">path</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.add_stream" title="永久链接至目标"></a></dt>
<dd><p>将文件 <em>path</em> 添加到 <em>database</em><code class="docutils literal notranslate"><span class="pre">_Stream</span></code> 表,使用流名称 <em>name</em></p>
</dd></dl>
<dl class="function">
<dt id="msilib.gen_uuid">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">gen_uuid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.gen_uuid" title="永久链接至目标"></a></dt>
<dd><p>Return a new UUID, in the format that MSI typically requires (i.e. in curly
braces, and with all hexdigits in upper-case).</p>
</dd></dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference external" href="https://msdn.microsoft.com/en-us/library/bb432265.aspx">FCICreate</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa379205.aspx">UuidCreate</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa379352.aspx">UuidToString</a></p>
</div>
<section id="database-objects">
<span id="id1"></span><h2>Database Objects<a class="headerlink" href="#database-objects" title="永久链接至标题"></a></h2>
<dl class="method">
<dt id="msilib.Database.OpenView">
<code class="sig-prename descclassname">Database.</code><code class="sig-name descname">OpenView</code><span class="sig-paren">(</span><em class="sig-param">sql</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Database.OpenView" title="永久链接至目标"></a></dt>
<dd><p>Return a view object, by calling <code class="xref c c-func docutils literal notranslate"><span class="pre">MSIDatabaseOpenView()</span></code>. <em>sql</em> is the SQL
statement to execute.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Database.Commit">
<code class="sig-prename descclassname">Database.</code><code class="sig-name descname">Commit</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Database.Commit" title="永久链接至目标"></a></dt>
<dd><p>Commit the changes pending in the current transaction, by calling
<code class="xref c c-func docutils literal notranslate"><span class="pre">MSIDatabaseCommit()</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Database.GetSummaryInformation">
<code class="sig-prename descclassname">Database.</code><code class="sig-name descname">GetSummaryInformation</code><span class="sig-paren">(</span><em class="sig-param">count</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Database.GetSummaryInformation" title="永久链接至目标"></a></dt>
<dd><p>Return a new summary information object, by calling
<code class="xref c c-func docutils literal notranslate"><span class="pre">MsiGetSummaryInformation()</span></code>. <em>count</em> is the maximum number of updated
values.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Database.Close">
<code class="sig-prename descclassname">Database.</code><code class="sig-name descname">Close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Database.Close" title="永久链接至目标"></a></dt>
<dd><p>Close the database object, through <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiCloseHandle()</span></code>.</p>
<div class="versionadded">
<p><span class="versionmodified added">3.7 新版功能.</span></p>
</div>
</dd></dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370082.aspx">MSIDatabaseOpenView</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370075.aspx">MSIDatabaseCommit</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370301.aspx">MSIGetSummaryInformation</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370067.aspx">MsiCloseHandle</a></p>
</div>
</section>
<section id="view-objects">
<span id="id2"></span><h2>View Objects<a class="headerlink" href="#view-objects" title="永久链接至标题"></a></h2>
<dl class="method">
<dt id="msilib.View.Execute">
<code class="sig-prename descclassname">View.</code><code class="sig-name descname">Execute</code><span class="sig-paren">(</span><em class="sig-param">params</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.View.Execute" title="永久链接至目标"></a></dt>
<dd><p>Execute the SQL query of the view, through <code class="xref c c-func docutils literal notranslate"><span class="pre">MSIViewExecute()</span></code>. If
<em>params</em> is not <code class="docutils literal notranslate"><span class="pre">None</span></code>, it is a record describing actual values of the
parameter tokens in the query.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.View.GetColumnInfo">
<code class="sig-prename descclassname">View.</code><code class="sig-name descname">GetColumnInfo</code><span class="sig-paren">(</span><em class="sig-param">kind</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.View.GetColumnInfo" title="永久链接至目标"></a></dt>
<dd><p>Return a record describing the columns of the view, through calling
<code class="xref c c-func docutils literal notranslate"><span class="pre">MsiViewGetColumnInfo()</span></code>. <em>kind</em> can be either <code class="docutils literal notranslate"><span class="pre">MSICOLINFO_NAMES</span></code> or
<code class="docutils literal notranslate"><span class="pre">MSICOLINFO_TYPES</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.View.Fetch">
<code class="sig-prename descclassname">View.</code><code class="sig-name descname">Fetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.View.Fetch" title="永久链接至目标"></a></dt>
<dd><p>Return a result record of the query, through calling <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiViewFetch()</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.View.Modify">
<code class="sig-prename descclassname">View.</code><code class="sig-name descname">Modify</code><span class="sig-paren">(</span><em class="sig-param">kind</em>, <em class="sig-param">data</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.View.Modify" title="永久链接至目标"></a></dt>
<dd><p>Modify the view, by calling <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiViewModify()</span></code>. <em>kind</em> can be one of
<code class="docutils literal notranslate"><span class="pre">MSIMODIFY_SEEK</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIMODIFY_REFRESH</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIMODIFY_INSERT</span></code>,
<code class="docutils literal notranslate"><span class="pre">MSIMODIFY_UPDATE</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIMODIFY_ASSIGN</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIMODIFY_REPLACE</span></code>,
<code class="docutils literal notranslate"><span class="pre">MSIMODIFY_MERGE</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIMODIFY_DELETE</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIMODIFY_INSERT_TEMPORARY</span></code>,
<code class="docutils literal notranslate"><span class="pre">MSIMODIFY_VALIDATE</span></code>, <code class="docutils literal notranslate"><span class="pre">MSIMODIFY_VALIDATE_NEW</span></code>,
<code class="docutils literal notranslate"><span class="pre">MSIMODIFY_VALIDATE_FIELD</span></code>, or <code class="docutils literal notranslate"><span class="pre">MSIMODIFY_VALIDATE_DELETE</span></code>.</p>
<p><em>data</em> must be a record describing the new data.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.View.Close">
<code class="sig-prename descclassname">View.</code><code class="sig-name descname">Close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.View.Close" title="永久链接至目标"></a></dt>
<dd><p>Close the view, through <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiViewClose()</span></code>.</p>
</dd></dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370513.aspx">MsiViewExecute</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370516.aspx">MSIViewGetColumnInfo</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370514.aspx">MsiViewFetch</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370519.aspx">MsiViewModify</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370510.aspx">MsiViewClose</a></p>
</div>
</section>
<section id="summary-information-objects">
<span id="summary-objects"></span><h2>Summary Information Objects<a class="headerlink" href="#summary-information-objects" title="永久链接至标题"></a></h2>
<dl class="method">
<dt id="msilib.SummaryInformation.GetProperty">
<code class="sig-prename descclassname">SummaryInformation.</code><code class="sig-name descname">GetProperty</code><span class="sig-paren">(</span><em class="sig-param">field</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.SummaryInformation.GetProperty" title="永久链接至目标"></a></dt>
<dd><p>Return a property of the summary, through <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiSummaryInfoGetProperty()</span></code>.
<em>field</em> is the name of the property, and can be one of the constants
<code class="docutils literal notranslate"><span class="pre">PID_CODEPAGE</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_TITLE</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_SUBJECT</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_AUTHOR</span></code>,
<code class="docutils literal notranslate"><span class="pre">PID_KEYWORDS</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_COMMENTS</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_TEMPLATE</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_LASTAUTHOR</span></code>,
<code class="docutils literal notranslate"><span class="pre">PID_REVNUMBER</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_LASTPRINTED</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_CREATE_DTM</span></code>,
<code class="docutils literal notranslate"><span class="pre">PID_LASTSAVE_DTM</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_PAGECOUNT</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_WORDCOUNT</span></code>, <code class="docutils literal notranslate"><span class="pre">PID_CHARCOUNT</span></code>,
<code class="docutils literal notranslate"><span class="pre">PID_APPNAME</span></code>, or <code class="docutils literal notranslate"><span class="pre">PID_SECURITY</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.SummaryInformation.GetPropertyCount">
<code class="sig-prename descclassname">SummaryInformation.</code><code class="sig-name descname">GetPropertyCount</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.SummaryInformation.GetPropertyCount" title="永久链接至目标"></a></dt>
<dd><p>Return the number of summary properties, through
<code class="xref c c-func docutils literal notranslate"><span class="pre">MsiSummaryInfoGetPropertyCount()</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.SummaryInformation.SetProperty">
<code class="sig-prename descclassname">SummaryInformation.</code><code class="sig-name descname">SetProperty</code><span class="sig-paren">(</span><em class="sig-param">field</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.SummaryInformation.SetProperty" title="永久链接至目标"></a></dt>
<dd><p>Set a property through <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiSummaryInfoSetProperty()</span></code>. <em>field</em> can have the
same values as in <a class="reference internal" href="#msilib.SummaryInformation.GetProperty" title="msilib.SummaryInformation.GetProperty"><code class="xref py py-meth docutils literal notranslate"><span class="pre">GetProperty()</span></code></a>, <em>value</em> is the new value of the property.
Possible value types are integer and string.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.SummaryInformation.Persist">
<code class="sig-prename descclassname">SummaryInformation.</code><code class="sig-name descname">Persist</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.SummaryInformation.Persist" title="永久链接至目标"></a></dt>
<dd><p>Write the modified properties to the summary information stream, using
<code class="xref c c-func docutils literal notranslate"><span class="pre">MsiSummaryInfoPersist()</span></code>.</p>
</dd></dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370409.aspx">MsiSummaryInfoGetProperty</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370488.aspx">MsiSummaryInfoGetPropertyCount</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370491.aspx">MsiSummaryInfoSetProperty</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370490.aspx">MsiSummaryInfoPersist</a></p>
</div>
</section>
<section id="record-objects">
<span id="id3"></span><h2>Record Objects<a class="headerlink" href="#record-objects" title="永久链接至标题"></a></h2>
<dl class="method">
<dt id="msilib.Record.GetFieldCount">
<code class="sig-prename descclassname">Record.</code><code class="sig-name descname">GetFieldCount</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Record.GetFieldCount" title="永久链接至目标"></a></dt>
<dd><p>Return the number of fields of the record, through
<code class="xref c c-func docutils literal notranslate"><span class="pre">MsiRecordGetFieldCount()</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Record.GetInteger">
<code class="sig-prename descclassname">Record.</code><code class="sig-name descname">GetInteger</code><span class="sig-paren">(</span><em class="sig-param">field</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Record.GetInteger" title="永久链接至目标"></a></dt>
<dd><p>Return the value of <em>field</em> as an integer where possible. <em>field</em> must
be an integer.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Record.GetString">
<code class="sig-prename descclassname">Record.</code><code class="sig-name descname">GetString</code><span class="sig-paren">(</span><em class="sig-param">field</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Record.GetString" title="永久链接至目标"></a></dt>
<dd><p>Return the value of <em>field</em> as a string where possible. <em>field</em> must
be an integer.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Record.SetString">
<code class="sig-prename descclassname">Record.</code><code class="sig-name descname">SetString</code><span class="sig-paren">(</span><em class="sig-param">field</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Record.SetString" title="永久链接至目标"></a></dt>
<dd><p>Set <em>field</em> to <em>value</em> through <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiRecordSetString()</span></code>. <em>field</em> must be an
integer; <em>value</em> a string.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Record.SetStream">
<code class="sig-prename descclassname">Record.</code><code class="sig-name descname">SetStream</code><span class="sig-paren">(</span><em class="sig-param">field</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Record.SetStream" title="永久链接至目标"></a></dt>
<dd><p>Set <em>field</em> to the contents of the file named <em>value</em>, through
<code class="xref c c-func docutils literal notranslate"><span class="pre">MsiRecordSetStream()</span></code>. <em>field</em> must be an integer; <em>value</em> a string.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Record.SetInteger">
<code class="sig-prename descclassname">Record.</code><code class="sig-name descname">SetInteger</code><span class="sig-paren">(</span><em class="sig-param">field</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Record.SetInteger" title="永久链接至目标"></a></dt>
<dd><p>Set <em>field</em> to <em>value</em> through <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiRecordSetInteger()</span></code>. Both <em>field</em> and
<em>value</em> must be an integer.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Record.ClearData">
<code class="sig-prename descclassname">Record.</code><code class="sig-name descname">ClearData</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Record.ClearData" title="永久链接至目标"></a></dt>
<dd><p>Set all fields of the record to 0, through <code class="xref c c-func docutils literal notranslate"><span class="pre">MsiRecordClearData()</span></code>.</p>
</dd></dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370366.aspx">MsiRecordGetFieldCount</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370373.aspx">MsiRecordSetString</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370372.aspx">MsiRecordSetStream</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370371.aspx">MsiRecordSetInteger</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370364.aspx">MsiRecordClearData</a></p>
</div>
</section>
<section id="errors">
<span id="msi-errors"></span><h2>Errors<a class="headerlink" href="#errors" title="永久链接至标题"></a></h2>
<p>All wrappers around MSI functions raise <code class="xref py py-exc docutils literal notranslate"><span class="pre">MSIError</span></code>; the string inside the
exception will contain more detail.</p>
</section>
<section id="cab-objects">
<span id="cab"></span><h2>CAB Objects<a class="headerlink" href="#cab-objects" title="永久链接至标题"></a></h2>
<dl class="class">
<dt id="msilib.CAB">
<em class="property">class </em><code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">CAB</code><span class="sig-paren">(</span><em class="sig-param">name</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.CAB" title="永久链接至目标"></a></dt>
<dd><p>The class <a class="reference internal" href="#msilib.CAB" title="msilib.CAB"><code class="xref py py-class docutils literal notranslate"><span class="pre">CAB</span></code></a> represents a CAB file. During MSI construction, files
will be added simultaneously to the <code class="docutils literal notranslate"><span class="pre">Files</span></code> 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.</p>
<p><em>name</em> is the name of the CAB file in the MSI file.</p>
<dl class="method">
<dt id="msilib.CAB.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">full</em>, <em class="sig-param">file</em>, <em class="sig-param">logical</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.CAB.append" title="永久链接至目标"></a></dt>
<dd><p>Add the file with the pathname <em>full</em> to the CAB file, under the name
<em>logical</em>. If there is already a file named <em>logical</em>, a new file name is
created.</p>
<p>Return the index of the file in the CAB file, and the new name of the file
inside the CAB file.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.CAB.commit">
<code class="sig-name descname">commit</code><span class="sig-paren">(</span><em class="sig-param">database</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.CAB.commit" title="永久链接至目标"></a></dt>
<dd><p>Generate a CAB file, add it as a stream to the MSI file, put it into the
<code class="docutils literal notranslate"><span class="pre">Media</span></code> table, and remove the generated file from the disk.</p>
</dd></dl>
</dd></dl>
</section>
<section id="directory-objects">
<span id="msi-directory"></span><h2>Directory Objects<a class="headerlink" href="#directory-objects" title="永久链接至标题"></a></h2>
<dl class="class">
<dt id="msilib.Directory">
<em class="property">class </em><code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">Directory</code><span class="sig-paren">(</span><em class="sig-param">database</em>, <em class="sig-param">cab</em>, <em class="sig-param">basedir</em>, <em class="sig-param">physical</em>, <em class="sig-param">logical</em>, <em class="sig-param">default</em><span class="optional">[</span>, <em class="sig-param">componentflags</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Directory" title="永久链接至目标"></a></dt>
<dd><p>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
<a class="reference internal" href="#msilib.Directory.start_component" title="msilib.Directory.start_component"><code class="xref py py-meth docutils literal notranslate"><span class="pre">start_component()</span></code></a>, 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 <code class="docutils literal notranslate"><span class="pre">None</span></code>), the
path to the physical directory, and a logical directory name. <em>default</em>
specifies the DefaultDir slot in the directory table. <em>componentflags</em> specifies
the default flags that new components get.</p>
<dl class="method">
<dt id="msilib.Directory.start_component">
<code class="sig-name descname">start_component</code><span class="sig-paren">(</span><em class="sig-param">component=None</em>, <em class="sig-param">feature=None</em>, <em class="sig-param">flags=None</em>, <em class="sig-param">keyfile=None</em>, <em class="sig-param">uuid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Directory.start_component" title="永久链接至目标"></a></dt>
<dd><p>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 <em>feature</em> is given, the current feature is used. If no
<em>flags</em> are given, the directory's default flags are used. If no <em>keyfile</em>
is given, the KeyPath is left null in the Component table.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Directory.add_file">
<code class="sig-name descname">add_file</code><span class="sig-paren">(</span><em class="sig-param">file</em>, <em class="sig-param">src=None</em>, <em class="sig-param">version=None</em>, <em class="sig-param">language=None</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Directory.add_file" title="永久链接至目标"></a></dt>
<dd><p>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 <em>src</em> file is specified, it
is interpreted relative to the current directory. Optionally, a <em>version</em>
and a <em>language</em> can be specified for the entry in the File table.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Directory.glob">
<code class="sig-name descname">glob</code><span class="sig-paren">(</span><em class="sig-param">pattern</em>, <em class="sig-param">exclude=None</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Directory.glob" title="永久链接至目标"></a></dt>
<dd><p>Add a list of files to the current component as specified in the glob
pattern. Individual files can be excluded in the <em>exclude</em> list.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Directory.remove_pyc">
<code class="sig-name descname">remove_pyc</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Directory.remove_pyc" title="永久链接至目标"></a></dt>
<dd><p>Remove <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files on uninstall.</p>
</dd></dl>
</dd></dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368295.aspx">Directory Table</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368596.aspx">File Table</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368007.aspx">Component Table</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368579.aspx">FeatureComponents Table</a></p>
</div>
</section>
<section id="features">
<span id="id4"></span><h2>相关特性<a class="headerlink" href="#features" title="永久链接至标题"></a></h2>
<dl class="class">
<dt id="msilib.Feature">
<em class="property">class </em><code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">Feature</code><span class="sig-paren">(</span><em class="sig-param">db</em>, <em class="sig-param">id</em>, <em class="sig-param">title</em>, <em class="sig-param">desc</em>, <em class="sig-param">display</em>, <em class="sig-param">level=1</em>, <em class="sig-param">parent=None</em>, <em class="sig-param">directory=None</em>, <em class="sig-param">attributes=0</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Feature" title="永久链接至目标"></a></dt>
<dd><p>Add a new record to the <code class="docutils literal notranslate"><span class="pre">Feature</span></code> table, using the values <em>id</em>, <em>parent.id</em>,
<em>title</em>, <em>desc</em>, <em>display</em>, <em>level</em>, <em>directory</em>, and <em>attributes</em>. The
resulting feature object can be passed to the <code class="xref py py-meth docutils literal notranslate"><span class="pre">start_component()</span></code> method of
<a class="reference internal" href="#msilib.Directory" title="msilib.Directory"><code class="xref py py-class docutils literal notranslate"><span class="pre">Directory</span></code></a>.</p>
<dl class="method">
<dt id="msilib.Feature.set_current">
<code class="sig-name descname">set_current</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Feature.set_current" title="永久链接至目标"></a></dt>
<dd><p>Make this feature the current feature of <a class="reference internal" href="#module-msilib" title="msilib: Creation of Microsoft Installer files, and CAB files. (Windows)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib</span></code></a>. New components are
automatically added to the default feature, unless a feature is explicitly
specified.</p>
</dd></dl>
</dd></dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368585.aspx">Feature Table</a></p>
</div>
</section>
<section id="gui-classes">
<span id="msi-gui"></span><h2>GUI classes<a class="headerlink" href="#gui-classes" title="永久链接至标题"></a></h2>
<p><a class="reference internal" href="#module-msilib" title="msilib: Creation of Microsoft Installer files, and CAB files. (Windows)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib</span></code></a> provides several classes that wrap the GUI tables in an MSI
database. However, no standard user interface is provided; use
<a class="reference internal" href="../distutils/apiref.html#module-distutils.command.bdist_msi" title="distutils.command.bdist_msi: Build a binary distribution as a Windows MSI file"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bdist_msi</span></code></a> to create MSI files with a user-interface
for installing Python packages.</p>
<dl class="class">
<dt id="msilib.Control">
<em class="property">class </em><code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">Control</code><span class="sig-paren">(</span><em class="sig-param">dlg</em>, <em class="sig-param">name</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Control" title="永久链接至目标"></a></dt>
<dd><p>Base class of the dialog controls. <em>dlg</em> is the dialog object the control
belongs to, and <em>name</em> is the control's name.</p>
<dl class="method">
<dt id="msilib.Control.event">
<code class="sig-name descname">event</code><span class="sig-paren">(</span><em class="sig-param">event</em>, <em class="sig-param">argument</em>, <em class="sig-param">condition=1</em>, <em class="sig-param">ordering=None</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Control.event" title="永久链接至目标"></a></dt>
<dd><p>Make an entry into the <code class="docutils literal notranslate"><span class="pre">ControlEvent</span></code> table for this control.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Control.mapping">
<code class="sig-name descname">mapping</code><span class="sig-paren">(</span><em class="sig-param">event</em>, <em class="sig-param">attribute</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Control.mapping" title="永久链接至目标"></a></dt>
<dd><p>Make an entry into the <code class="docutils literal notranslate"><span class="pre">EventMapping</span></code> table for this control.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Control.condition">
<code class="sig-name descname">condition</code><span class="sig-paren">(</span><em class="sig-param">action</em>, <em class="sig-param">condition</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Control.condition" title="永久链接至目标"></a></dt>
<dd><p>Make an entry into the <code class="docutils literal notranslate"><span class="pre">ControlCondition</span></code> table for this control.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="msilib.RadioButtonGroup">
<em class="property">class </em><code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">RadioButtonGroup</code><span class="sig-paren">(</span><em class="sig-param">dlg</em>, <em class="sig-param">name</em>, <em class="sig-param">property</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.RadioButtonGroup" title="永久链接至目标"></a></dt>
<dd><p>Create a radio button control named <em>name</em>. <em>property</em> is the installer property
that gets set when a radio button is selected.</p>
<dl class="method">
<dt id="msilib.RadioButtonGroup.add">
<code class="sig-name descname">add</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">width</em>, <em class="sig-param">height</em>, <em class="sig-param">text</em>, <em class="sig-param">value=None</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.RadioButtonGroup.add" title="永久链接至目标"></a></dt>
<dd><p>Add a radio button named <em>name</em> to the group, at the coordinates <em>x</em>, <em>y</em>,
<em>width</em>, <em>height</em>, and with the label <em>text</em>. If <em>value</em> is <code class="docutils literal notranslate"><span class="pre">None</span></code>, it
defaults to <em>name</em>.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="msilib.Dialog">
<em class="property">class </em><code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">Dialog</code><span class="sig-paren">(</span><em class="sig-param">db</em>, <em class="sig-param">name</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">w</em>, <em class="sig-param">h</em>, <em class="sig-param">attr</em>, <em class="sig-param">title</em>, <em class="sig-param">first</em>, <em class="sig-param">default</em>, <em class="sig-param">cancel</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Dialog" title="永久链接至目标"></a></dt>
<dd><p>Return a new <a class="reference internal" href="#msilib.Dialog" title="msilib.Dialog"><code class="xref py py-class docutils literal notranslate"><span class="pre">Dialog</span></code></a> object. An entry in the <code class="docutils literal notranslate"><span class="pre">Dialog</span></code> table is made,
with the specified coordinates, dialog attributes, title, name of the first,
default, and cancel controls.</p>
<dl class="method">
<dt id="msilib.Dialog.control">
<code class="sig-name descname">control</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">type</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">width</em>, <em class="sig-param">height</em>, <em class="sig-param">attributes</em>, <em class="sig-param">property</em>, <em class="sig-param">text</em>, <em class="sig-param">control_next</em>, <em class="sig-param">help</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Dialog.control" title="永久链接至目标"></a></dt>
<dd><p>Return a new <a class="reference internal" href="#msilib.Control" title="msilib.Control"><code class="xref py py-class docutils literal notranslate"><span class="pre">Control</span></code></a> object. An entry in the <code class="docutils literal notranslate"><span class="pre">Control</span></code> table is
made with the specified parameters.</p>
<p>This is a generic method; for specific types, specialized methods are
provided.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Dialog.text">
<code class="sig-name descname">text</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">width</em>, <em class="sig-param">height</em>, <em class="sig-param">attributes</em>, <em class="sig-param">text</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Dialog.text" title="永久链接至目标"></a></dt>
<dd><p>Add and return a <code class="docutils literal notranslate"><span class="pre">Text</span></code> control.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Dialog.bitmap">
<code class="sig-name descname">bitmap</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">width</em>, <em class="sig-param">height</em>, <em class="sig-param">text</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Dialog.bitmap" title="永久链接至目标"></a></dt>
<dd><p>Add and return a <code class="docutils literal notranslate"><span class="pre">Bitmap</span></code> control.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Dialog.line">
<code class="sig-name descname">line</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">width</em>, <em class="sig-param">height</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Dialog.line" title="永久链接至目标"></a></dt>
<dd><p>Add and return a <code class="docutils literal notranslate"><span class="pre">Line</span></code> control.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Dialog.pushbutton">
<code class="sig-name descname">pushbutton</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">width</em>, <em class="sig-param">height</em>, <em class="sig-param">attributes</em>, <em class="sig-param">text</em>, <em class="sig-param">next_control</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Dialog.pushbutton" title="永久链接至目标"></a></dt>
<dd><p>Add and return a <code class="docutils literal notranslate"><span class="pre">PushButton</span></code> control.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Dialog.radiogroup">
<code class="sig-name descname">radiogroup</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">width</em>, <em class="sig-param">height</em>, <em class="sig-param">attributes</em>, <em class="sig-param">property</em>, <em class="sig-param">text</em>, <em class="sig-param">next_control</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Dialog.radiogroup" title="永久链接至目标"></a></dt>
<dd><p>Add and return a <code class="docutils literal notranslate"><span class="pre">RadioButtonGroup</span></code> control.</p>
</dd></dl>
<dl class="method">
<dt id="msilib.Dialog.checkbox">
<code class="sig-name descname">checkbox</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">width</em>, <em class="sig-param">height</em>, <em class="sig-param">attributes</em>, <em class="sig-param">property</em>, <em class="sig-param">text</em>, <em class="sig-param">next_control</em><span class="sig-paren">)</span><a class="headerlink" href="#msilib.Dialog.checkbox" title="永久链接至目标"></a></dt>
<dd><p>Add and return a <code class="docutils literal notranslate"><span class="pre">CheckBox</span></code> control.</p>
</dd></dl>
</dd></dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368286.aspx">Dialog Table</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368044.aspx">Control Table</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368039.aspx">Control Types</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368035.aspx">ControlCondition Table</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368037.aspx">ControlEvent Table</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa368559.aspx">EventMapping Table</a>
<a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa370962.aspx">RadioButton Table</a></p>
</div>
</section>
<section id="precomputed-tables">
<span id="msi-tables"></span><h2>Precomputed tables<a class="headerlink" href="#precomputed-tables" title="永久链接至标题"></a></h2>
<p><a class="reference internal" href="#module-msilib" title="msilib: Creation of Microsoft Installer files, and CAB files. (Windows)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib</span></code></a> provides a few subpackages that contain only schema and table
definitions. Currently, these definitions are based on MSI version 2.0.</p>
<dl class="data">
<dt id="msilib.schema">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">schema</code><a class="headerlink" href="#msilib.schema" title="永久链接至目标"></a></dt>
<dd><p>This is the standard MSI schema for MSI 2.0, with the <em>tables</em> variable
providing a list of table definitions, and <em>_Validation_records</em> providing the
data for MSI validation.</p>
</dd></dl>
<dl class="data">
<dt id="msilib.sequence">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">sequence</code><a class="headerlink" href="#msilib.sequence" title="永久链接至目标"></a></dt>
<dd><p>此模块包含针对标准序列表的表内容: <em>AdminExecuteSequence</em>, <em>AdminUISequence</em>, <em>AdvtExecuteSequence</em>, <em>InstallExecuteSequence</em><em>InstallUISequence</em></p>
</dd></dl>
<dl class="data">
<dt id="msilib.text">
<code class="sig-prename descclassname">msilib.</code><code class="sig-name descname">text</code><a class="headerlink" href="#msilib.text" title="永久链接至目标"></a></dt>
<dd><p>此模块包含 UIText 和 ActionText 表的定义,用于标准安装器动作。</p>
</dd></dl>
</section>
</section>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../contents.html">目录</a></h3>
<ul>
<li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib</span></code> --- 读写 Microsoft Installer 文件</a><ul>
<li><a class="reference internal" href="#database-objects">Database Objects</a></li>
<li><a class="reference internal" href="#view-objects">View Objects</a></li>
<li><a class="reference internal" href="#summary-information-objects">Summary Information Objects</a></li>
<li><a class="reference internal" href="#record-objects">Record Objects</a></li>
<li><a class="reference internal" href="#errors">Errors</a></li>
<li><a class="reference internal" href="#cab-objects">CAB Objects</a></li>
<li><a class="reference internal" href="#directory-objects">Directory Objects</a></li>
<li><a class="reference internal" href="#features">相关特性</a></li>
<li><a class="reference internal" href="#gui-classes">GUI classes</a></li>
<li><a class="reference internal" href="#precomputed-tables">Precomputed tables</a></li>
</ul>
</li>
</ul>
<h4>上一个主题</h4>
<p class="topless"><a href="windows.html"
title="上一章">Windows系统相关模块</a></p>
<h4>下一个主题</h4>
<p class="topless"><a href="msvcrt.html"
title="下一章"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msvcrt</span></code> --- 来自 MS VC++ 运行时的有用例程</a></p>
<div role="note" aria-label="source link">
<h3>本页</h3>
<ul class="this-page-menu">
<li><a href="../bugs.html">报告 Bug</a></li>
<li>
<a href="https://github.com/python/cpython/blob/3.8/Doc/library/msilib.rst"
rel="nofollow">显示源代码
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>导航</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="总目录"
>索引</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python 模块索引"
>模块</a> |</li>
<li class="right" >
<a href="msvcrt.html" title="msvcrt --- 来自 MS VC++ 运行时的有用例程"
>下一页</a> |</li>
<li class="right" >
<a href="windows.html" title="Windows系统相关模块"
>上一页</a> |</li>
<li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://www.python.org/">Python</a> &#187;</li>
<li class="switchers">
<div class="language_switcher_placeholder"></div>
<div class="version_switcher_placeholder"></div>
</li>
<li>
</li>
<li id="cpython-language-and-version">
<a href="../index.html">3.8.20 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="index.html" >Python 标准库</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="windows.html" >Windows系统相关模块</a> &#187;</li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="../search.html" method="get">
<input placeholder="快速搜索" aria-label="快速搜索" type="text" name="q" />
<input type="submit" value="转向" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
|
</li>
</ul>
</div>
<div class="footer">
&copy; <a href="../copyright.html">版权所有</a> 2001-2024, Python Software Foundation.
<br />
This page is licensed under the Python Software Foundation License Version 2.
<br />
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
<br />
<br />
The Python Software Foundation is a non-profit corporation.
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最后更新于 12月 09, 2024.
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
<br />
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 2.4.4.
</div>
</body>
</html>