blob: 0a420329748cb306b802e016db298195ad8ae28c [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001:mod:`msilib` --- Read and write Microsoft Installer files
2==========================================================
3
4.. module:: msilib
5 :platform: Windows
6 :synopsis: Creation of Microsoft Installer files, and CAB files.
Terry Jan Reedyfa089b92016-06-11 15:02:54 -04007
Georg Brandl116aa622007-08-15 14:28:22 +00008.. moduleauthor:: Martin v. Löwis <martin@v.loewis.de>
9.. sectionauthor:: Martin v. Löwis <martin@v.loewis.de>
10
Terry Jan Reedyfa089b92016-06-11 15:02:54 -040011**Source code:** :source:`Lib/msilib/__init__.py`
Georg Brandl116aa622007-08-15 14:28:22 +000012
13.. index:: single: msi
14
Terry Jan Reedyfa089b92016-06-11 15:02:54 -040015--------------
16
Georg Brandl116aa622007-08-15 14:28:22 +000017The :mod:`msilib` supports the creation of Microsoft Installer (``.msi``) files.
18Because these files often contain an embedded "cabinet" file (``.cab``), it also
19exposes an API to create CAB files. Support for reading ``.cab`` files is
20currently not implemented; read support for the ``.msi`` database is possible.
21
22This package aims to provide complete access to all tables in an ``.msi`` file,
23therefore, it is a fairly low-level API. Two primary applications of this
24package are the :mod:`distutils` command ``bdist_msi``, and the creation of
25Python installer package itself (although that currently uses a different
26version of ``msilib``).
27
28The package contents can be roughly split into four parts: low-level CAB
29routines, low-level MSI routines, higher-level MSI routines, and standard table
30structures.
31
32
33.. function:: FCICreate(cabname, files)
34
35 Create a new CAB file named *cabname*. *files* must be a list of tuples, each
36 containing the name of the file on disk, and the name of the file inside the CAB
37 file.
38
39 The files are added to the CAB file in the order they appear in the list. All
40 files are added into a single CAB file, using the MSZIP compression algorithm.
41
42 Callbacks to Python for the various steps of MSI creation are currently not
43 exposed.
44
45
Christian Heimesfaf2f632008-01-06 16:59:19 +000046.. function:: UuidCreate()
Georg Brandl116aa622007-08-15 14:28:22 +000047
48 Return the string representation of a new unique identifier. This wraps the
Georg Brandl60203b42010-10-06 10:11:56 +000049 Windows API functions :c:func:`UuidCreate` and :c:func:`UuidToString`.
Georg Brandl116aa622007-08-15 14:28:22 +000050
51
52.. function:: OpenDatabase(path, persist)
53
54 Return a new database object by calling MsiOpenDatabase. *path* is the file
55 name of the MSI file; *persist* can be one of the constants
56 ``MSIDBOPEN_CREATEDIRECT``, ``MSIDBOPEN_CREATE``, ``MSIDBOPEN_DIRECT``,
57 ``MSIDBOPEN_READONLY``, or ``MSIDBOPEN_TRANSACT``, and may include the flag
58 ``MSIDBOPEN_PATCHFILE``. See the Microsoft documentation for the meaning of
59 these flags; depending on the flags, an existing database is opened, or a new
60 one created.
61
62
63.. function:: CreateRecord(count)
64
Georg Brandl60203b42010-10-06 10:11:56 +000065 Return a new record object by calling :c:func:`MSICreateRecord`. *count* is the
Georg Brandl116aa622007-08-15 14:28:22 +000066 number of fields of the record.
67
68
69.. function:: init_database(name, schema, ProductName, ProductCode, ProductVersion, Manufacturer)
70
Christian Heimesd3eb5a152008-02-24 00:38:49 +000071 Create and return a new database *name*, initialize it with *schema*, and set
Georg Brandl116aa622007-08-15 14:28:22 +000072 the properties *ProductName*, *ProductCode*, *ProductVersion*, and
73 *Manufacturer*.
74
75 *schema* must be a module object containing ``tables`` and
76 ``_Validation_records`` attributes; typically, :mod:`msilib.schema` should be
77 used.
78
79 The database will contain just the schema and the validation records when this
80 function returns.
81
82
Christian Heimesd3eb5a152008-02-24 00:38:49 +000083.. function:: add_data(database, table, records)
Georg Brandl116aa622007-08-15 14:28:22 +000084
Christian Heimesd3eb5a152008-02-24 00:38:49 +000085 Add all *records* to the table named *table* in *database*.
Georg Brandl116aa622007-08-15 14:28:22 +000086
Christian Heimesd3eb5a152008-02-24 00:38:49 +000087 The *table* argument must be one of the predefined tables in the MSI schema,
88 e.g. ``'Feature'``, ``'File'``, ``'Component'``, ``'Dialog'``, ``'Control'``,
89 etc.
90
91 *records* should be a list of tuples, each one containing all fields of a
92 record according to the schema of the table. For optional fields,
93 ``None`` can be passed.
94
Serhiy Storchaka95949422013-08-27 19:40:23 +030095 Field values can be ints, strings, or instances of the Binary class.
Georg Brandl116aa622007-08-15 14:28:22 +000096
97
98.. class:: Binary(filename)
99
100 Represents entries in the Binary table; inserting such an object using
101 :func:`add_data` reads the file named *filename* into the table.
102
103
104.. function:: add_tables(database, module)
105
106 Add all table content from *module* to *database*. *module* must contain an
107 attribute *tables* listing all tables for which content should be added, and one
108 attribute per table that has the actual content.
109
110 This is typically used to install the sequence tables.
111
112
113.. function:: add_stream(database, name, path)
114
115 Add the file *path* into the ``_Stream`` table of *database*, with the stream
116 name *name*.
117
118
119.. function:: gen_uuid()
120
121 Return a new UUID, in the format that MSI typically requires (i.e. in curly
122 braces, and with all hexdigits in upper-case).
123
124
125.. seealso::
126
Georg Brandl5d941342016-02-26 19:37:12 +0100127 `FCICreateFile <https://msdn.microsoft.com/library?url=/library/en-us/devnotes/winprog/fcicreate.asp>`_
128 `UuidCreate <https://msdn.microsoft.com/library?url=/library/en-us/rpc/rpc/uuidcreate.asp>`_
129 `UuidToString <https://msdn.microsoft.com/library?url=/library/en-us/rpc/rpc/uuidtostring.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000130
131.. _database-objects:
132
133Database Objects
134----------------
135
136
137.. method:: Database.OpenView(sql)
138
Georg Brandl60203b42010-10-06 10:11:56 +0000139 Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the SQL
Georg Brandl116aa622007-08-15 14:28:22 +0000140 statement to execute.
141
142
143.. method:: Database.Commit()
144
145 Commit the changes pending in the current transaction, by calling
Georg Brandl60203b42010-10-06 10:11:56 +0000146 :c:func:`MSIDatabaseCommit`.
Georg Brandl116aa622007-08-15 14:28:22 +0000147
148
149.. method:: Database.GetSummaryInformation(count)
150
151 Return a new summary information object, by calling
Georg Brandl60203b42010-10-06 10:11:56 +0000152 :c:func:`MsiGetSummaryInformation`. *count* is the maximum number of updated
Georg Brandl116aa622007-08-15 14:28:22 +0000153 values.
154
155
156.. seealso::
157
Georg Brandl5d941342016-02-26 19:37:12 +0100158 `MSIDatabaseOpenView <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msidatabaseopenview.asp>`_
159 `MSIDatabaseCommit <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msidatabasecommit.asp>`_
160 `MSIGetSummaryInformation <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msigetsummaryinformation.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000161
162.. _view-objects:
163
164View Objects
165------------
166
167
Benjamin Peterson41181742008-07-02 20:22:54 +0000168.. method:: View.Execute(params)
Georg Brandl116aa622007-08-15 14:28:22 +0000169
Georg Brandl60203b42010-10-06 10:11:56 +0000170 Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If
Benjamin Peterson41181742008-07-02 20:22:54 +0000171 *params* is not ``None``, it is a record describing actual values of the
172 parameter tokens in the query.
Georg Brandl116aa622007-08-15 14:28:22 +0000173
174
175.. method:: View.GetColumnInfo(kind)
176
177 Return a record describing the columns of the view, through calling
Georg Brandl60203b42010-10-06 10:11:56 +0000178 :c:func:`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or
Georg Brandl116aa622007-08-15 14:28:22 +0000179 ``MSICOLINFO_TYPES``.
180
181
182.. method:: View.Fetch()
183
Georg Brandl60203b42010-10-06 10:11:56 +0000184 Return a result record of the query, through calling :c:func:`MsiViewFetch`.
Georg Brandl116aa622007-08-15 14:28:22 +0000185
186
187.. method:: View.Modify(kind, data)
188
Georg Brandl60203b42010-10-06 10:11:56 +0000189 Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of
Georg Brandl116aa622007-08-15 14:28:22 +0000190 ``MSIMODIFY_SEEK``, ``MSIMODIFY_REFRESH``, ``MSIMODIFY_INSERT``,
191 ``MSIMODIFY_UPDATE``, ``MSIMODIFY_ASSIGN``, ``MSIMODIFY_REPLACE``,
192 ``MSIMODIFY_MERGE``, ``MSIMODIFY_DELETE``, ``MSIMODIFY_INSERT_TEMPORARY``,
193 ``MSIMODIFY_VALIDATE``, ``MSIMODIFY_VALIDATE_NEW``,
194 ``MSIMODIFY_VALIDATE_FIELD``, or ``MSIMODIFY_VALIDATE_DELETE``.
195
196 *data* must be a record describing the new data.
197
198
199.. method:: View.Close()
200
Georg Brandl60203b42010-10-06 10:11:56 +0000201 Close the view, through :c:func:`MsiViewClose`.
Georg Brandl116aa622007-08-15 14:28:22 +0000202
203
204.. seealso::
205
Georg Brandl5d941342016-02-26 19:37:12 +0100206 `MsiViewExecute <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewexecute.asp>`_
207 `MSIViewGetColumnInfo <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewgetcolumninfo.asp>`_
208 `MsiViewFetch <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewfetch.asp>`_
209 `MsiViewModify <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewmodify.asp>`_
210 `MsiViewClose <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewclose.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000211
212.. _summary-objects:
213
214Summary Information Objects
215---------------------------
216
217
218.. method:: SummaryInformation.GetProperty(field)
219
Georg Brandl60203b42010-10-06 10:11:56 +0000220 Return a property of the summary, through :c:func:`MsiSummaryInfoGetProperty`.
Georg Brandl116aa622007-08-15 14:28:22 +0000221 *field* is the name of the property, and can be one of the constants
222 ``PID_CODEPAGE``, ``PID_TITLE``, ``PID_SUBJECT``, ``PID_AUTHOR``,
223 ``PID_KEYWORDS``, ``PID_COMMENTS``, ``PID_TEMPLATE``, ``PID_LASTAUTHOR``,
224 ``PID_REVNUMBER``, ``PID_LASTPRINTED``, ``PID_CREATE_DTM``,
225 ``PID_LASTSAVE_DTM``, ``PID_PAGECOUNT``, ``PID_WORDCOUNT``, ``PID_CHARCOUNT``,
226 ``PID_APPNAME``, or ``PID_SECURITY``.
227
228
229.. method:: SummaryInformation.GetPropertyCount()
230
231 Return the number of summary properties, through
Georg Brandl60203b42010-10-06 10:11:56 +0000232 :c:func:`MsiSummaryInfoGetPropertyCount`.
Georg Brandl116aa622007-08-15 14:28:22 +0000233
234
235.. method:: SummaryInformation.SetProperty(field, value)
236
Georg Brandl60203b42010-10-06 10:11:56 +0000237 Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have the
Georg Brandl116aa622007-08-15 14:28:22 +0000238 same values as in :meth:`GetProperty`, *value* is the new value of the property.
239 Possible value types are integer and string.
240
241
242.. method:: SummaryInformation.Persist()
243
244 Write the modified properties to the summary information stream, using
Georg Brandl60203b42010-10-06 10:11:56 +0000245 :c:func:`MsiSummaryInfoPersist`.
Georg Brandl116aa622007-08-15 14:28:22 +0000246
247
248.. seealso::
249
Georg Brandl5d941342016-02-26 19:37:12 +0100250 `MsiSummaryInfoGetProperty <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msisummaryinfogetproperty.asp>`_
251 `MsiSummaryInfoGetPropertyCount <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msisummaryinfogetpropertycount.asp>`_
252 `MsiSummaryInfoSetProperty <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msisummaryinfosetproperty.asp>`_
253 `MsiSummaryInfoPersist <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msisummaryinfopersist.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000254
255.. _record-objects:
256
257Record Objects
258--------------
259
260
261.. method:: Record.GetFieldCount()
262
263 Return the number of fields of the record, through
Georg Brandl60203b42010-10-06 10:11:56 +0000264 :c:func:`MsiRecordGetFieldCount`.
Georg Brandl116aa622007-08-15 14:28:22 +0000265
266
Martin v. Löwise95593e2008-06-02 10:08:54 +0000267.. method:: Record.GetInteger(field)
268
269 Return the value of *field* as an integer where possible. *field* must
270 be an integer.
271
272
273.. method:: Record.GetString(field)
274
275 Return the value of *field* as a string where possible. *field* must
276 be an integer.
277
278
Georg Brandl116aa622007-08-15 14:28:22 +0000279.. method:: Record.SetString(field, value)
280
Georg Brandl60203b42010-10-06 10:11:56 +0000281 Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be an
Georg Brandl116aa622007-08-15 14:28:22 +0000282 integer; *value* a string.
283
284
285.. method:: Record.SetStream(field, value)
286
287 Set *field* to the contents of the file named *value*, through
Georg Brandl60203b42010-10-06 10:11:56 +0000288 :c:func:`MsiRecordSetStream`. *field* must be an integer; *value* a string.
Georg Brandl116aa622007-08-15 14:28:22 +0000289
290
291.. method:: Record.SetInteger(field, value)
292
Georg Brandl60203b42010-10-06 10:11:56 +0000293 Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* and
Georg Brandl116aa622007-08-15 14:28:22 +0000294 *value* must be an integer.
295
296
297.. method:: Record.ClearData()
298
Georg Brandl60203b42010-10-06 10:11:56 +0000299 Set all fields of the record to 0, through :c:func:`MsiRecordClearData`.
Georg Brandl116aa622007-08-15 14:28:22 +0000300
301
302.. seealso::
303
Georg Brandl5d941342016-02-26 19:37:12 +0100304 `MsiRecordGetFieldCount <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordgetfieldcount.asp>`_
305 `MsiRecordSetString <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordsetstring.asp>`_
306 `MsiRecordSetStream <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordsetstream.asp>`_
307 `MsiRecordSetInteger <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordsetinteger.asp>`_
308 `MsiRecordClear <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordclear.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000309
310.. _msi-errors:
311
312Errors
313------
314
315All wrappers around MSI functions raise :exc:`MsiError`; the string inside the
316exception will contain more detail.
317
318
319.. _cab:
320
321CAB Objects
322-----------
323
324
325.. class:: CAB(name)
326
327 The class :class:`CAB` represents a CAB file. During MSI construction, files
328 will be added simultaneously to the ``Files`` table, and to a CAB file. Then,
329 when all files have been added, the CAB file can be written, then added to the
330 MSI file.
331
332 *name* is the name of the CAB file in the MSI file.
333
334
Benjamin Petersone41251e2008-04-25 01:59:09 +0000335 .. method:: append(full, file, logical)
Georg Brandl116aa622007-08-15 14:28:22 +0000336
Benjamin Petersone41251e2008-04-25 01:59:09 +0000337 Add the file with the pathname *full* to the CAB file, under the name
338 *logical*. If there is already a file named *logical*, a new file name is
339 created.
Georg Brandl116aa622007-08-15 14:28:22 +0000340
Benjamin Petersone41251e2008-04-25 01:59:09 +0000341 Return the index of the file in the CAB file, and the new name of the file
342 inside the CAB file.
Georg Brandl116aa622007-08-15 14:28:22 +0000343
344
Benjamin Petersone41251e2008-04-25 01:59:09 +0000345 .. method:: commit(database)
Georg Brandl116aa622007-08-15 14:28:22 +0000346
Benjamin Petersone41251e2008-04-25 01:59:09 +0000347 Generate a CAB file, add it as a stream to the MSI file, put it into the
348 ``Media`` table, and remove the generated file from the disk.
Georg Brandl116aa622007-08-15 14:28:22 +0000349
350
351.. _msi-directory:
352
353Directory Objects
354-----------------
355
356
Éric Araujo29087652010-12-26 02:38:05 +0000357.. class:: Directory(database, cab, basedir, physical, logical, default, [componentflags])
Georg Brandl116aa622007-08-15 14:28:22 +0000358
359 Create a new directory in the Directory table. There is a current component at
360 each point in time for the directory, which is either explicitly created through
361 :meth:`start_component`, or implicitly when files are added for the first time.
362 Files are added into the current component, and into the cab file. To create a
363 directory, a base directory object needs to be specified (can be ``None``), the
364 path to the physical directory, and a logical directory name. *default*
365 specifies the DefaultDir slot in the directory table. *componentflags* specifies
366 the default flags that new components get.
367
368
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000369 .. method:: start_component(component=None, feature=None, flags=None, keyfile=None, uuid=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000370
Benjamin Petersone41251e2008-04-25 01:59:09 +0000371 Add an entry to the Component table, and make this component the current
372 component for this directory. If no component name is given, the directory
373 name is used. If no *feature* is given, the current feature is used. If no
374 *flags* are given, the directory's default flags are used. If no *keyfile*
375 is given, the KeyPath is left null in the Component table.
Georg Brandl116aa622007-08-15 14:28:22 +0000376
377
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000378 .. method:: add_file(file, src=None, version=None, language=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000379
Benjamin Petersone41251e2008-04-25 01:59:09 +0000380 Add a file to the current component of the directory, starting a new one
381 if there is no current component. By default, the file name in the source
382 and the file table will be identical. If the *src* file is specified, it
383 is interpreted relative to the current directory. Optionally, a *version*
384 and a *language* can be specified for the entry in the File table.
Georg Brandl116aa622007-08-15 14:28:22 +0000385
386
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000387 .. method:: glob(pattern, exclude=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000388
Benjamin Petersone41251e2008-04-25 01:59:09 +0000389 Add a list of files to the current component as specified in the glob
390 pattern. Individual files can be excluded in the *exclude* list.
Georg Brandl116aa622007-08-15 14:28:22 +0000391
392
Benjamin Petersone41251e2008-04-25 01:59:09 +0000393 .. method:: remove_pyc()
Georg Brandl116aa622007-08-15 14:28:22 +0000394
Benjamin Petersone41251e2008-04-25 01:59:09 +0000395 Remove ``.pyc``/``.pyo`` files on uninstall.
Georg Brandl116aa622007-08-15 14:28:22 +0000396
397
398.. seealso::
399
Georg Brandl5d941342016-02-26 19:37:12 +0100400 `Directory Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/directory_table.asp>`_
401 `File Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/file_table.asp>`_
402 `Component Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/component_table.asp>`_
403 `FeatureComponents Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/featurecomponents_table.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000404
405.. _features:
406
407Features
408--------
409
410
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000411.. class:: Feature(db, id, title, desc, display, level=1, parent=None, directory=None, attributes=0)
Georg Brandl116aa622007-08-15 14:28:22 +0000412
413 Add a new record to the ``Feature`` table, using the values *id*, *parent.id*,
414 *title*, *desc*, *display*, *level*, *directory*, and *attributes*. The
415 resulting feature object can be passed to the :meth:`start_component` method of
416 :class:`Directory`.
417
418
Benjamin Petersone41251e2008-04-25 01:59:09 +0000419 .. method:: set_current()
Georg Brandl116aa622007-08-15 14:28:22 +0000420
Benjamin Petersone41251e2008-04-25 01:59:09 +0000421 Make this feature the current feature of :mod:`msilib`. New components are
422 automatically added to the default feature, unless a feature is explicitly
423 specified.
Georg Brandl116aa622007-08-15 14:28:22 +0000424
425
426.. seealso::
427
Georg Brandl5d941342016-02-26 19:37:12 +0100428 `Feature Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/feature_table.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000429
430.. _msi-gui:
431
432GUI classes
433-----------
434
435:mod:`msilib` provides several classes that wrap the GUI tables in an MSI
Serhiy Storchakabfdcd432013-10-13 23:09:14 +0300436database. However, no standard user interface is provided; use
437:mod:`~distutils.command.bdist_msi` to create MSI files with a user-interface
438for installing Python packages.
Georg Brandl116aa622007-08-15 14:28:22 +0000439
440
441.. class:: Control(dlg, name)
442
443 Base class of the dialog controls. *dlg* is the dialog object the control
444 belongs to, and *name* is the control's name.
445
446
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000447 .. method:: event(event, argument, condition=1, ordering=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000448
Benjamin Petersone41251e2008-04-25 01:59:09 +0000449 Make an entry into the ``ControlEvent`` table for this control.
Georg Brandl116aa622007-08-15 14:28:22 +0000450
451
Benjamin Petersone41251e2008-04-25 01:59:09 +0000452 .. method:: mapping(event, attribute)
Georg Brandl116aa622007-08-15 14:28:22 +0000453
Benjamin Petersone41251e2008-04-25 01:59:09 +0000454 Make an entry into the ``EventMapping`` table for this control.
Georg Brandl116aa622007-08-15 14:28:22 +0000455
456
Benjamin Petersone41251e2008-04-25 01:59:09 +0000457 .. method:: condition(action, condition)
Georg Brandl116aa622007-08-15 14:28:22 +0000458
Benjamin Petersone41251e2008-04-25 01:59:09 +0000459 Make an entry into the ``ControlCondition`` table for this control.
Georg Brandl116aa622007-08-15 14:28:22 +0000460
461
462.. class:: RadioButtonGroup(dlg, name, property)
463
464 Create a radio button control named *name*. *property* is the installer property
465 that gets set when a radio button is selected.
466
467
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000468 .. method:: add(name, x, y, width, height, text, value=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000469
Benjamin Petersone41251e2008-04-25 01:59:09 +0000470 Add a radio button named *name* to the group, at the coordinates *x*, *y*,
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000471 *width*, *height*, and with the label *text*. If *value* is ``None``, it
Benjamin Petersone41251e2008-04-25 01:59:09 +0000472 defaults to *name*.
Georg Brandl116aa622007-08-15 14:28:22 +0000473
474
475.. class:: Dialog(db, name, x, y, w, h, attr, title, first, default, cancel)
476
477 Return a new :class:`Dialog` object. An entry in the ``Dialog`` table is made,
478 with the specified coordinates, dialog attributes, title, name of the first,
479 default, and cancel controls.
480
481
Benjamin Petersone41251e2008-04-25 01:59:09 +0000482 .. method:: control(name, type, x, y, width, height, attributes, property, text, control_next, help)
Georg Brandl116aa622007-08-15 14:28:22 +0000483
Benjamin Petersone41251e2008-04-25 01:59:09 +0000484 Return a new :class:`Control` object. An entry in the ``Control`` table is
485 made with the specified parameters.
Georg Brandl116aa622007-08-15 14:28:22 +0000486
Benjamin Petersone41251e2008-04-25 01:59:09 +0000487 This is a generic method; for specific types, specialized methods are
488 provided.
Georg Brandl116aa622007-08-15 14:28:22 +0000489
490
Benjamin Petersone41251e2008-04-25 01:59:09 +0000491 .. method:: text(name, x, y, width, height, attributes, text)
Georg Brandl116aa622007-08-15 14:28:22 +0000492
Benjamin Petersone41251e2008-04-25 01:59:09 +0000493 Add and return a ``Text`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000494
495
Benjamin Petersone41251e2008-04-25 01:59:09 +0000496 .. method:: bitmap(name, x, y, width, height, text)
Georg Brandl116aa622007-08-15 14:28:22 +0000497
Benjamin Petersone41251e2008-04-25 01:59:09 +0000498 Add and return a ``Bitmap`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000499
500
Benjamin Petersone41251e2008-04-25 01:59:09 +0000501 .. method:: line(name, x, y, width, height)
Georg Brandl116aa622007-08-15 14:28:22 +0000502
Benjamin Petersone41251e2008-04-25 01:59:09 +0000503 Add and return a ``Line`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000504
505
Benjamin Petersone41251e2008-04-25 01:59:09 +0000506 .. method:: pushbutton(name, x, y, width, height, attributes, text, next_control)
Georg Brandl116aa622007-08-15 14:28:22 +0000507
Benjamin Petersone41251e2008-04-25 01:59:09 +0000508 Add and return a ``PushButton`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000509
510
Benjamin Petersone41251e2008-04-25 01:59:09 +0000511 .. method:: radiogroup(name, x, y, width, height, attributes, property, text, next_control)
Georg Brandl116aa622007-08-15 14:28:22 +0000512
Benjamin Petersone41251e2008-04-25 01:59:09 +0000513 Add and return a ``RadioButtonGroup`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000514
515
Benjamin Petersone41251e2008-04-25 01:59:09 +0000516 .. method:: checkbox(name, x, y, width, height, attributes, property, text, next_control)
Georg Brandl116aa622007-08-15 14:28:22 +0000517
Benjamin Petersone41251e2008-04-25 01:59:09 +0000518 Add and return a ``CheckBox`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000519
520
521.. seealso::
522
Georg Brandl5d941342016-02-26 19:37:12 +0100523 `Dialog Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/dialog_table.asp>`_
524 `Control Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/control_table.asp>`_
525 `Control Types <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/controls.asp>`_
526 `ControlCondition Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/controlcondition_table.asp>`_
527 `ControlEvent Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/controlevent_table.asp>`_
528 `EventMapping Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/eventmapping_table.asp>`_
529 `RadioButton Table <https://msdn.microsoft.com/library?url=/library/en-us/msi/setup/radiobutton_table.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000530
531.. _msi-tables:
532
533Precomputed tables
534------------------
535
536:mod:`msilib` provides a few subpackages that contain only schema and table
537definitions. Currently, these definitions are based on MSI version 2.0.
538
539
540.. data:: schema
541
542 This is the standard MSI schema for MSI 2.0, with the *tables* variable
543 providing a list of table definitions, and *_Validation_records* providing the
544 data for MSI validation.
545
546
547.. data:: sequence
548
549 This module contains table contents for the standard sequence tables:
550 *AdminExecuteSequence*, *AdminUISequence*, *AdvtExecuteSequence*,
551 *InstallExecuteSequence*, and *InstallUISequence*.
552
553
554.. data:: text
555
556 This module contains definitions for the UIText and ActionText tables, for the
557 standard installer actions.