blob: d3451c844bc15450d8ba0ed9ad336a99662f960b [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.
7.. moduleauthor:: Martin v. Löwis <martin@v.loewis.de>
8.. sectionauthor:: Martin v. Löwis <martin@v.loewis.de>
9
10
11.. index:: single: msi
12
Georg Brandl116aa622007-08-15 14:28:22 +000013The :mod:`msilib` supports the creation of Microsoft Installer (``.msi``) files.
14Because these files often contain an embedded "cabinet" file (``.cab``), it also
15exposes an API to create CAB files. Support for reading ``.cab`` files is
16currently not implemented; read support for the ``.msi`` database is possible.
17
18This package aims to provide complete access to all tables in an ``.msi`` file,
19therefore, it is a fairly low-level API. Two primary applications of this
20package are the :mod:`distutils` command ``bdist_msi``, and the creation of
21Python installer package itself (although that currently uses a different
22version of ``msilib``).
23
24The package contents can be roughly split into four parts: low-level CAB
25routines, low-level MSI routines, higher-level MSI routines, and standard table
26structures.
27
28
29.. function:: FCICreate(cabname, files)
30
31 Create a new CAB file named *cabname*. *files* must be a list of tuples, each
32 containing the name of the file on disk, and the name of the file inside the CAB
33 file.
34
35 The files are added to the CAB file in the order they appear in the list. All
36 files are added into a single CAB file, using the MSZIP compression algorithm.
37
38 Callbacks to Python for the various steps of MSI creation are currently not
39 exposed.
40
41
Christian Heimesfaf2f632008-01-06 16:59:19 +000042.. function:: UuidCreate()
Georg Brandl116aa622007-08-15 14:28:22 +000043
44 Return the string representation of a new unique identifier. This wraps the
Georg Brandl60203b42010-10-06 10:11:56 +000045 Windows API functions :c:func:`UuidCreate` and :c:func:`UuidToString`.
Georg Brandl116aa622007-08-15 14:28:22 +000046
47
48.. function:: OpenDatabase(path, persist)
49
50 Return a new database object by calling MsiOpenDatabase. *path* is the file
51 name of the MSI file; *persist* can be one of the constants
52 ``MSIDBOPEN_CREATEDIRECT``, ``MSIDBOPEN_CREATE``, ``MSIDBOPEN_DIRECT``,
53 ``MSIDBOPEN_READONLY``, or ``MSIDBOPEN_TRANSACT``, and may include the flag
54 ``MSIDBOPEN_PATCHFILE``. See the Microsoft documentation for the meaning of
55 these flags; depending on the flags, an existing database is opened, or a new
56 one created.
57
58
59.. function:: CreateRecord(count)
60
Georg Brandl60203b42010-10-06 10:11:56 +000061 Return a new record object by calling :c:func:`MSICreateRecord`. *count* is the
Georg Brandl116aa622007-08-15 14:28:22 +000062 number of fields of the record.
63
64
65.. function:: init_database(name, schema, ProductName, ProductCode, ProductVersion, Manufacturer)
66
Christian Heimesd3eb5a152008-02-24 00:38:49 +000067 Create and return a new database *name*, initialize it with *schema*, and set
Georg Brandl116aa622007-08-15 14:28:22 +000068 the properties *ProductName*, *ProductCode*, *ProductVersion*, and
69 *Manufacturer*.
70
71 *schema* must be a module object containing ``tables`` and
72 ``_Validation_records`` attributes; typically, :mod:`msilib.schema` should be
73 used.
74
75 The database will contain just the schema and the validation records when this
76 function returns.
77
78
Christian Heimesd3eb5a152008-02-24 00:38:49 +000079.. function:: add_data(database, table, records)
Georg Brandl116aa622007-08-15 14:28:22 +000080
Christian Heimesd3eb5a152008-02-24 00:38:49 +000081 Add all *records* to the table named *table* in *database*.
Georg Brandl116aa622007-08-15 14:28:22 +000082
Christian Heimesd3eb5a152008-02-24 00:38:49 +000083 The *table* argument must be one of the predefined tables in the MSI schema,
84 e.g. ``'Feature'``, ``'File'``, ``'Component'``, ``'Dialog'``, ``'Control'``,
85 etc.
86
87 *records* should be a list of tuples, each one containing all fields of a
88 record according to the schema of the table. For optional fields,
89 ``None`` can be passed.
90
Serhiy Storchaka95949422013-08-27 19:40:23 +030091 Field values can be ints, strings, or instances of the Binary class.
Georg Brandl116aa622007-08-15 14:28:22 +000092
93
94.. class:: Binary(filename)
95
96 Represents entries in the Binary table; inserting such an object using
97 :func:`add_data` reads the file named *filename* into the table.
98
99
100.. function:: add_tables(database, module)
101
102 Add all table content from *module* to *database*. *module* must contain an
103 attribute *tables* listing all tables for which content should be added, and one
104 attribute per table that has the actual content.
105
106 This is typically used to install the sequence tables.
107
108
109.. function:: add_stream(database, name, path)
110
111 Add the file *path* into the ``_Stream`` table of *database*, with the stream
112 name *name*.
113
114
115.. function:: gen_uuid()
116
117 Return a new UUID, in the format that MSI typically requires (i.e. in curly
118 braces, and with all hexdigits in upper-case).
119
120
121.. seealso::
122
123 `FCICreateFile <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devnotes/winprog/fcicreate.asp>`_
124 `UuidCreate <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/uuidcreate.asp>`_
125 `UuidToString <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/uuidtostring.asp>`_
126
127.. _database-objects:
128
129Database Objects
130----------------
131
132
133.. method:: Database.OpenView(sql)
134
Georg Brandl60203b42010-10-06 10:11:56 +0000135 Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the SQL
Georg Brandl116aa622007-08-15 14:28:22 +0000136 statement to execute.
137
138
139.. method:: Database.Commit()
140
141 Commit the changes pending in the current transaction, by calling
Georg Brandl60203b42010-10-06 10:11:56 +0000142 :c:func:`MSIDatabaseCommit`.
Georg Brandl116aa622007-08-15 14:28:22 +0000143
144
145.. method:: Database.GetSummaryInformation(count)
146
147 Return a new summary information object, by calling
Georg Brandl60203b42010-10-06 10:11:56 +0000148 :c:func:`MsiGetSummaryInformation`. *count* is the maximum number of updated
Georg Brandl116aa622007-08-15 14:28:22 +0000149 values.
150
151
152.. seealso::
153
Christian Heimes679db4a2008-01-18 09:56:22 +0000154 `MSIDatabaseOpenView <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msidatabaseopenview.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000155 `MSIDatabaseCommit <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msidatabasecommit.asp>`_
156 `MSIGetSummaryInformation <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msigetsummaryinformation.asp>`_
157
158.. _view-objects:
159
160View Objects
161------------
162
163
Benjamin Peterson41181742008-07-02 20:22:54 +0000164.. method:: View.Execute(params)
Georg Brandl116aa622007-08-15 14:28:22 +0000165
Georg Brandl60203b42010-10-06 10:11:56 +0000166 Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If
Benjamin Peterson41181742008-07-02 20:22:54 +0000167 *params* is not ``None``, it is a record describing actual values of the
168 parameter tokens in the query.
Georg Brandl116aa622007-08-15 14:28:22 +0000169
170
171.. method:: View.GetColumnInfo(kind)
172
173 Return a record describing the columns of the view, through calling
Georg Brandl60203b42010-10-06 10:11:56 +0000174 :c:func:`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or
Georg Brandl116aa622007-08-15 14:28:22 +0000175 ``MSICOLINFO_TYPES``.
176
177
178.. method:: View.Fetch()
179
Georg Brandl60203b42010-10-06 10:11:56 +0000180 Return a result record of the query, through calling :c:func:`MsiViewFetch`.
Georg Brandl116aa622007-08-15 14:28:22 +0000181
182
183.. method:: View.Modify(kind, data)
184
Georg Brandl60203b42010-10-06 10:11:56 +0000185 Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of
Georg Brandl116aa622007-08-15 14:28:22 +0000186 ``MSIMODIFY_SEEK``, ``MSIMODIFY_REFRESH``, ``MSIMODIFY_INSERT``,
187 ``MSIMODIFY_UPDATE``, ``MSIMODIFY_ASSIGN``, ``MSIMODIFY_REPLACE``,
188 ``MSIMODIFY_MERGE``, ``MSIMODIFY_DELETE``, ``MSIMODIFY_INSERT_TEMPORARY``,
189 ``MSIMODIFY_VALIDATE``, ``MSIMODIFY_VALIDATE_NEW``,
190 ``MSIMODIFY_VALIDATE_FIELD``, or ``MSIMODIFY_VALIDATE_DELETE``.
191
192 *data* must be a record describing the new data.
193
194
195.. method:: View.Close()
196
Georg Brandl60203b42010-10-06 10:11:56 +0000197 Close the view, through :c:func:`MsiViewClose`.
Georg Brandl116aa622007-08-15 14:28:22 +0000198
199
200.. seealso::
201
202 `MsiViewExecute <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewexecute.asp>`_
203 `MSIViewGetColumnInfo <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewgetcolumninfo.asp>`_
204 `MsiViewFetch <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewfetch.asp>`_
205 `MsiViewModify <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewmodify.asp>`_
206 `MsiViewClose <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewclose.asp>`_
207
208.. _summary-objects:
209
210Summary Information Objects
211---------------------------
212
213
214.. method:: SummaryInformation.GetProperty(field)
215
Georg Brandl60203b42010-10-06 10:11:56 +0000216 Return a property of the summary, through :c:func:`MsiSummaryInfoGetProperty`.
Georg Brandl116aa622007-08-15 14:28:22 +0000217 *field* is the name of the property, and can be one of the constants
218 ``PID_CODEPAGE``, ``PID_TITLE``, ``PID_SUBJECT``, ``PID_AUTHOR``,
219 ``PID_KEYWORDS``, ``PID_COMMENTS``, ``PID_TEMPLATE``, ``PID_LASTAUTHOR``,
220 ``PID_REVNUMBER``, ``PID_LASTPRINTED``, ``PID_CREATE_DTM``,
221 ``PID_LASTSAVE_DTM``, ``PID_PAGECOUNT``, ``PID_WORDCOUNT``, ``PID_CHARCOUNT``,
222 ``PID_APPNAME``, or ``PID_SECURITY``.
223
224
225.. method:: SummaryInformation.GetPropertyCount()
226
227 Return the number of summary properties, through
Georg Brandl60203b42010-10-06 10:11:56 +0000228 :c:func:`MsiSummaryInfoGetPropertyCount`.
Georg Brandl116aa622007-08-15 14:28:22 +0000229
230
231.. method:: SummaryInformation.SetProperty(field, value)
232
Georg Brandl60203b42010-10-06 10:11:56 +0000233 Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have the
Georg Brandl116aa622007-08-15 14:28:22 +0000234 same values as in :meth:`GetProperty`, *value* is the new value of the property.
235 Possible value types are integer and string.
236
237
238.. method:: SummaryInformation.Persist()
239
240 Write the modified properties to the summary information stream, using
Georg Brandl60203b42010-10-06 10:11:56 +0000241 :c:func:`MsiSummaryInfoPersist`.
Georg Brandl116aa622007-08-15 14:28:22 +0000242
243
244.. seealso::
245
246 `MsiSummaryInfoGetProperty <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfogetproperty.asp>`_
247 `MsiSummaryInfoGetPropertyCount <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfogetpropertycount.asp>`_
248 `MsiSummaryInfoSetProperty <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfosetproperty.asp>`_
249 `MsiSummaryInfoPersist <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfopersist.asp>`_
250
251.. _record-objects:
252
253Record Objects
254--------------
255
256
257.. method:: Record.GetFieldCount()
258
259 Return the number of fields of the record, through
Georg Brandl60203b42010-10-06 10:11:56 +0000260 :c:func:`MsiRecordGetFieldCount`.
Georg Brandl116aa622007-08-15 14:28:22 +0000261
262
Martin v. Löwise95593e2008-06-02 10:08:54 +0000263.. method:: Record.GetInteger(field)
264
265 Return the value of *field* as an integer where possible. *field* must
266 be an integer.
267
268
269.. method:: Record.GetString(field)
270
271 Return the value of *field* as a string where possible. *field* must
272 be an integer.
273
274
Georg Brandl116aa622007-08-15 14:28:22 +0000275.. method:: Record.SetString(field, value)
276
Georg Brandl60203b42010-10-06 10:11:56 +0000277 Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be an
Georg Brandl116aa622007-08-15 14:28:22 +0000278 integer; *value* a string.
279
280
281.. method:: Record.SetStream(field, value)
282
283 Set *field* to the contents of the file named *value*, through
Georg Brandl60203b42010-10-06 10:11:56 +0000284 :c:func:`MsiRecordSetStream`. *field* must be an integer; *value* a string.
Georg Brandl116aa622007-08-15 14:28:22 +0000285
286
287.. method:: Record.SetInteger(field, value)
288
Georg Brandl60203b42010-10-06 10:11:56 +0000289 Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* and
Georg Brandl116aa622007-08-15 14:28:22 +0000290 *value* must be an integer.
291
292
293.. method:: Record.ClearData()
294
Georg Brandl60203b42010-10-06 10:11:56 +0000295 Set all fields of the record to 0, through :c:func:`MsiRecordClearData`.
Georg Brandl116aa622007-08-15 14:28:22 +0000296
297
298.. seealso::
299
300 `MsiRecordGetFieldCount <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordgetfieldcount.asp>`_
301 `MsiRecordSetString <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetstring.asp>`_
302 `MsiRecordSetStream <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetstream.asp>`_
303 `MsiRecordSetInteger <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetinteger.asp>`_
304 `MsiRecordClear <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordclear.asp>`_
305
306.. _msi-errors:
307
308Errors
309------
310
311All wrappers around MSI functions raise :exc:`MsiError`; the string inside the
312exception will contain more detail.
313
314
315.. _cab:
316
317CAB Objects
318-----------
319
320
321.. class:: CAB(name)
322
323 The class :class:`CAB` represents a CAB file. During MSI construction, files
324 will be added simultaneously to the ``Files`` table, and to a CAB file. Then,
325 when all files have been added, the CAB file can be written, then added to the
326 MSI file.
327
328 *name* is the name of the CAB file in the MSI file.
329
330
Benjamin Petersone41251e2008-04-25 01:59:09 +0000331 .. method:: append(full, file, logical)
Georg Brandl116aa622007-08-15 14:28:22 +0000332
Benjamin Petersone41251e2008-04-25 01:59:09 +0000333 Add the file with the pathname *full* to the CAB file, under the name
334 *logical*. If there is already a file named *logical*, a new file name is
335 created.
Georg Brandl116aa622007-08-15 14:28:22 +0000336
Benjamin Petersone41251e2008-04-25 01:59:09 +0000337 Return the index of the file in the CAB file, and the new name of the file
338 inside the CAB file.
Georg Brandl116aa622007-08-15 14:28:22 +0000339
340
Benjamin Petersone41251e2008-04-25 01:59:09 +0000341 .. method:: commit(database)
Georg Brandl116aa622007-08-15 14:28:22 +0000342
Benjamin Petersone41251e2008-04-25 01:59:09 +0000343 Generate a CAB file, add it as a stream to the MSI file, put it into the
344 ``Media`` table, and remove the generated file from the disk.
Georg Brandl116aa622007-08-15 14:28:22 +0000345
346
347.. _msi-directory:
348
349Directory Objects
350-----------------
351
352
Éric Araujo29087652010-12-26 02:38:05 +0000353.. class:: Directory(database, cab, basedir, physical, logical, default, [componentflags])
Georg Brandl116aa622007-08-15 14:28:22 +0000354
355 Create a new directory in the Directory table. There is a current component at
356 each point in time for the directory, which is either explicitly created through
357 :meth:`start_component`, or implicitly when files are added for the first time.
358 Files are added into the current component, and into the cab file. To create a
359 directory, a base directory object needs to be specified (can be ``None``), the
360 path to the physical directory, and a logical directory name. *default*
361 specifies the DefaultDir slot in the directory table. *componentflags* specifies
362 the default flags that new components get.
363
364
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000365 .. method:: start_component(component=None, feature=None, flags=None, keyfile=None, uuid=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000366
Benjamin Petersone41251e2008-04-25 01:59:09 +0000367 Add an entry to the Component table, and make this component the current
368 component for this directory. If no component name is given, the directory
369 name is used. If no *feature* is given, the current feature is used. If no
370 *flags* are given, the directory's default flags are used. If no *keyfile*
371 is given, the KeyPath is left null in the Component table.
Georg Brandl116aa622007-08-15 14:28:22 +0000372
373
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000374 .. method:: add_file(file, src=None, version=None, language=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000375
Benjamin Petersone41251e2008-04-25 01:59:09 +0000376 Add a file to the current component of the directory, starting a new one
377 if there is no current component. By default, the file name in the source
378 and the file table will be identical. If the *src* file is specified, it
379 is interpreted relative to the current directory. Optionally, a *version*
380 and a *language* can be specified for the entry in the File table.
Georg Brandl116aa622007-08-15 14:28:22 +0000381
382
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000383 .. method:: glob(pattern, exclude=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000384
Benjamin Petersone41251e2008-04-25 01:59:09 +0000385 Add a list of files to the current component as specified in the glob
386 pattern. Individual files can be excluded in the *exclude* list.
Georg Brandl116aa622007-08-15 14:28:22 +0000387
388
Benjamin Petersone41251e2008-04-25 01:59:09 +0000389 .. method:: remove_pyc()
Georg Brandl116aa622007-08-15 14:28:22 +0000390
Benjamin Petersone41251e2008-04-25 01:59:09 +0000391 Remove ``.pyc``/``.pyo`` files on uninstall.
Georg Brandl116aa622007-08-15 14:28:22 +0000392
393
394.. seealso::
395
Georg Brandl495f7b52009-10-27 15:28:25 +0000396 `Directory Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/directory_table.asp>`_
397 `File Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/file_table.asp>`_
398 `Component Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/component_table.asp>`_
399 `FeatureComponents Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/featurecomponents_table.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000400
401.. _features:
402
403Features
404--------
405
406
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000407.. class:: Feature(db, id, title, desc, display, level=1, parent=None, directory=None, attributes=0)
Georg Brandl116aa622007-08-15 14:28:22 +0000408
409 Add a new record to the ``Feature`` table, using the values *id*, *parent.id*,
410 *title*, *desc*, *display*, *level*, *directory*, and *attributes*. The
411 resulting feature object can be passed to the :meth:`start_component` method of
412 :class:`Directory`.
413
414
Benjamin Petersone41251e2008-04-25 01:59:09 +0000415 .. method:: set_current()
Georg Brandl116aa622007-08-15 14:28:22 +0000416
Benjamin Petersone41251e2008-04-25 01:59:09 +0000417 Make this feature the current feature of :mod:`msilib`. New components are
418 automatically added to the default feature, unless a feature is explicitly
419 specified.
Georg Brandl116aa622007-08-15 14:28:22 +0000420
421
422.. seealso::
423
Georg Brandl495f7b52009-10-27 15:28:25 +0000424 `Feature Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/feature_table.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000425
426.. _msi-gui:
427
428GUI classes
429-----------
430
431:mod:`msilib` provides several classes that wrap the GUI tables in an MSI
Serhiy Storchakabfdcd432013-10-13 23:09:14 +0300432database. However, no standard user interface is provided; use
433:mod:`~distutils.command.bdist_msi` to create MSI files with a user-interface
434for installing Python packages.
Georg Brandl116aa622007-08-15 14:28:22 +0000435
436
437.. class:: Control(dlg, name)
438
439 Base class of the dialog controls. *dlg* is the dialog object the control
440 belongs to, and *name* is the control's name.
441
442
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000443 .. method:: event(event, argument, condition=1, ordering=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000444
Benjamin Petersone41251e2008-04-25 01:59:09 +0000445 Make an entry into the ``ControlEvent`` table for this control.
Georg Brandl116aa622007-08-15 14:28:22 +0000446
447
Benjamin Petersone41251e2008-04-25 01:59:09 +0000448 .. method:: mapping(event, attribute)
Georg Brandl116aa622007-08-15 14:28:22 +0000449
Benjamin Petersone41251e2008-04-25 01:59:09 +0000450 Make an entry into the ``EventMapping`` table for this control.
Georg Brandl116aa622007-08-15 14:28:22 +0000451
452
Benjamin Petersone41251e2008-04-25 01:59:09 +0000453 .. method:: condition(action, condition)
Georg Brandl116aa622007-08-15 14:28:22 +0000454
Benjamin Petersone41251e2008-04-25 01:59:09 +0000455 Make an entry into the ``ControlCondition`` table for this control.
Georg Brandl116aa622007-08-15 14:28:22 +0000456
457
458.. class:: RadioButtonGroup(dlg, name, property)
459
460 Create a radio button control named *name*. *property* is the installer property
461 that gets set when a radio button is selected.
462
463
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000464 .. method:: add(name, x, y, width, height, text, value=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000465
Benjamin Petersone41251e2008-04-25 01:59:09 +0000466 Add a radio button named *name* to the group, at the coordinates *x*, *y*,
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000467 *width*, *height*, and with the label *text*. If *value* is ``None``, it
Benjamin Petersone41251e2008-04-25 01:59:09 +0000468 defaults to *name*.
Georg Brandl116aa622007-08-15 14:28:22 +0000469
470
471.. class:: Dialog(db, name, x, y, w, h, attr, title, first, default, cancel)
472
473 Return a new :class:`Dialog` object. An entry in the ``Dialog`` table is made,
474 with the specified coordinates, dialog attributes, title, name of the first,
475 default, and cancel controls.
476
477
Benjamin Petersone41251e2008-04-25 01:59:09 +0000478 .. method:: control(name, type, x, y, width, height, attributes, property, text, control_next, help)
Georg Brandl116aa622007-08-15 14:28:22 +0000479
Benjamin Petersone41251e2008-04-25 01:59:09 +0000480 Return a new :class:`Control` object. An entry in the ``Control`` table is
481 made with the specified parameters.
Georg Brandl116aa622007-08-15 14:28:22 +0000482
Benjamin Petersone41251e2008-04-25 01:59:09 +0000483 This is a generic method; for specific types, specialized methods are
484 provided.
Georg Brandl116aa622007-08-15 14:28:22 +0000485
486
Benjamin Petersone41251e2008-04-25 01:59:09 +0000487 .. method:: text(name, x, y, width, height, attributes, text)
Georg Brandl116aa622007-08-15 14:28:22 +0000488
Benjamin Petersone41251e2008-04-25 01:59:09 +0000489 Add and return a ``Text`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000490
491
Benjamin Petersone41251e2008-04-25 01:59:09 +0000492 .. method:: bitmap(name, x, y, width, height, text)
Georg Brandl116aa622007-08-15 14:28:22 +0000493
Benjamin Petersone41251e2008-04-25 01:59:09 +0000494 Add and return a ``Bitmap`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000495
496
Benjamin Petersone41251e2008-04-25 01:59:09 +0000497 .. method:: line(name, x, y, width, height)
Georg Brandl116aa622007-08-15 14:28:22 +0000498
Benjamin Petersone41251e2008-04-25 01:59:09 +0000499 Add and return a ``Line`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000500
501
Benjamin Petersone41251e2008-04-25 01:59:09 +0000502 .. method:: pushbutton(name, x, y, width, height, attributes, text, next_control)
Georg Brandl116aa622007-08-15 14:28:22 +0000503
Benjamin Petersone41251e2008-04-25 01:59:09 +0000504 Add and return a ``PushButton`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000505
506
Benjamin Petersone41251e2008-04-25 01:59:09 +0000507 .. method:: radiogroup(name, x, y, width, height, attributes, property, text, next_control)
Georg Brandl116aa622007-08-15 14:28:22 +0000508
Benjamin Petersone41251e2008-04-25 01:59:09 +0000509 Add and return a ``RadioButtonGroup`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000510
511
Benjamin Petersone41251e2008-04-25 01:59:09 +0000512 .. method:: checkbox(name, x, y, width, height, attributes, property, text, next_control)
Georg Brandl116aa622007-08-15 14:28:22 +0000513
Benjamin Petersone41251e2008-04-25 01:59:09 +0000514 Add and return a ``CheckBox`` control.
Georg Brandl116aa622007-08-15 14:28:22 +0000515
516
517.. seealso::
518
Georg Brandl495f7b52009-10-27 15:28:25 +0000519 `Dialog Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/dialog_table.asp>`_
520 `Control Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/control_table.asp>`_
521 `Control Types <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/controls.asp>`_
522 `ControlCondition Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/controlcondition_table.asp>`_
523 `ControlEvent Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/controlevent_table.asp>`_
524 `EventMapping Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/eventmapping_table.asp>`_
525 `RadioButton Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/radiobutton_table.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000526
527.. _msi-tables:
528
529Precomputed tables
530------------------
531
532:mod:`msilib` provides a few subpackages that contain only schema and table
533definitions. Currently, these definitions are based on MSI version 2.0.
534
535
536.. data:: schema
537
538 This is the standard MSI schema for MSI 2.0, with the *tables* variable
539 providing a list of table definitions, and *_Validation_records* providing the
540 data for MSI validation.
541
542
543.. data:: sequence
544
545 This module contains table contents for the standard sequence tables:
546 *AdminExecuteSequence*, *AdminUISequence*, *AdvtExecuteSequence*,
547 *InstallExecuteSequence*, and *InstallUISequence*.
548
549
550.. data:: text
551
552 This module contains definitions for the UIText and ActionText tables, for the
553 standard installer actions.