blob: 270f4ff9f266efd1975ee9aeaa4e83e70c4470a7 [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
91 Field values can be int or long numbers, strings, or instances of the Binary
92 class.
Georg Brandl116aa622007-08-15 14:28:22 +000093
94
95.. class:: Binary(filename)
96
97 Represents entries in the Binary table; inserting such an object using
98 :func:`add_data` reads the file named *filename* into the table.
99
100
101.. function:: add_tables(database, module)
102
103 Add all table content from *module* to *database*. *module* must contain an
104 attribute *tables* listing all tables for which content should be added, and one
105 attribute per table that has the actual content.
106
107 This is typically used to install the sequence tables.
108
109
110.. function:: add_stream(database, name, path)
111
112 Add the file *path* into the ``_Stream`` table of *database*, with the stream
113 name *name*.
114
115
116.. function:: gen_uuid()
117
118 Return a new UUID, in the format that MSI typically requires (i.e. in curly
119 braces, and with all hexdigits in upper-case).
120
121
122.. seealso::
123
124 `FCICreateFile <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devnotes/winprog/fcicreate.asp>`_
125 `UuidCreate <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/uuidcreate.asp>`_
126 `UuidToString <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/uuidtostring.asp>`_
127
128.. _database-objects:
129
130Database Objects
131----------------
132
133
134.. method:: Database.OpenView(sql)
135
Georg Brandl60203b42010-10-06 10:11:56 +0000136 Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the SQL
Georg Brandl116aa622007-08-15 14:28:22 +0000137 statement to execute.
138
139
140.. method:: Database.Commit()
141
142 Commit the changes pending in the current transaction, by calling
Georg Brandl60203b42010-10-06 10:11:56 +0000143 :c:func:`MSIDatabaseCommit`.
Georg Brandl116aa622007-08-15 14:28:22 +0000144
145
146.. method:: Database.GetSummaryInformation(count)
147
148 Return a new summary information object, by calling
Georg Brandl60203b42010-10-06 10:11:56 +0000149 :c:func:`MsiGetSummaryInformation`. *count* is the maximum number of updated
Georg Brandl116aa622007-08-15 14:28:22 +0000150 values.
151
152
153.. seealso::
154
Christian Heimes679db4a2008-01-18 09:56:22 +0000155 `MSIDatabaseOpenView <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msidatabaseopenview.asp>`_
Georg Brandl116aa622007-08-15 14:28:22 +0000156 `MSIDatabaseCommit <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msidatabasecommit.asp>`_
157 `MSIGetSummaryInformation <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msigetsummaryinformation.asp>`_
158
159.. _view-objects:
160
161View Objects
162------------
163
164
Benjamin Peterson41181742008-07-02 20:22:54 +0000165.. method:: View.Execute(params)
Georg Brandl116aa622007-08-15 14:28:22 +0000166
Georg Brandl60203b42010-10-06 10:11:56 +0000167 Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If
Benjamin Peterson41181742008-07-02 20:22:54 +0000168 *params* is not ``None``, it is a record describing actual values of the
169 parameter tokens in the query.
Georg Brandl116aa622007-08-15 14:28:22 +0000170
171
172.. method:: View.GetColumnInfo(kind)
173
174 Return a record describing the columns of the view, through calling
Georg Brandl60203b42010-10-06 10:11:56 +0000175 :c:func:`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or
Georg Brandl116aa622007-08-15 14:28:22 +0000176 ``MSICOLINFO_TYPES``.
177
178
179.. method:: View.Fetch()
180
Georg Brandl60203b42010-10-06 10:11:56 +0000181 Return a result record of the query, through calling :c:func:`MsiViewFetch`.
Georg Brandl116aa622007-08-15 14:28:22 +0000182
183
184.. method:: View.Modify(kind, data)
185
Georg Brandl60203b42010-10-06 10:11:56 +0000186 Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of
Georg Brandl116aa622007-08-15 14:28:22 +0000187 ``MSIMODIFY_SEEK``, ``MSIMODIFY_REFRESH``, ``MSIMODIFY_INSERT``,
188 ``MSIMODIFY_UPDATE``, ``MSIMODIFY_ASSIGN``, ``MSIMODIFY_REPLACE``,
189 ``MSIMODIFY_MERGE``, ``MSIMODIFY_DELETE``, ``MSIMODIFY_INSERT_TEMPORARY``,
190 ``MSIMODIFY_VALIDATE``, ``MSIMODIFY_VALIDATE_NEW``,
191 ``MSIMODIFY_VALIDATE_FIELD``, or ``MSIMODIFY_VALIDATE_DELETE``.
192
193 *data* must be a record describing the new data.
194
195
196.. method:: View.Close()
197
Georg Brandl60203b42010-10-06 10:11:56 +0000198 Close the view, through :c:func:`MsiViewClose`.
Georg Brandl116aa622007-08-15 14:28:22 +0000199
200
201.. seealso::
202
203 `MsiViewExecute <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewexecute.asp>`_
204 `MSIViewGetColumnInfo <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewgetcolumninfo.asp>`_
205 `MsiViewFetch <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewfetch.asp>`_
206 `MsiViewModify <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewmodify.asp>`_
207 `MsiViewClose <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewclose.asp>`_
208
209.. _summary-objects:
210
211Summary Information Objects
212---------------------------
213
214
215.. method:: SummaryInformation.GetProperty(field)
216
Georg Brandl60203b42010-10-06 10:11:56 +0000217 Return a property of the summary, through :c:func:`MsiSummaryInfoGetProperty`.
Georg Brandl116aa622007-08-15 14:28:22 +0000218 *field* is the name of the property, and can be one of the constants
219 ``PID_CODEPAGE``, ``PID_TITLE``, ``PID_SUBJECT``, ``PID_AUTHOR``,
220 ``PID_KEYWORDS``, ``PID_COMMENTS``, ``PID_TEMPLATE``, ``PID_LASTAUTHOR``,
221 ``PID_REVNUMBER``, ``PID_LASTPRINTED``, ``PID_CREATE_DTM``,
222 ``PID_LASTSAVE_DTM``, ``PID_PAGECOUNT``, ``PID_WORDCOUNT``, ``PID_CHARCOUNT``,
223 ``PID_APPNAME``, or ``PID_SECURITY``.
224
225
226.. method:: SummaryInformation.GetPropertyCount()
227
228 Return the number of summary properties, through
Georg Brandl60203b42010-10-06 10:11:56 +0000229 :c:func:`MsiSummaryInfoGetPropertyCount`.
Georg Brandl116aa622007-08-15 14:28:22 +0000230
231
232.. method:: SummaryInformation.SetProperty(field, value)
233
Georg Brandl60203b42010-10-06 10:11:56 +0000234 Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have the
Georg Brandl116aa622007-08-15 14:28:22 +0000235 same values as in :meth:`GetProperty`, *value* is the new value of the property.
236 Possible value types are integer and string.
237
238
239.. method:: SummaryInformation.Persist()
240
241 Write the modified properties to the summary information stream, using
Georg Brandl60203b42010-10-06 10:11:56 +0000242 :c:func:`MsiSummaryInfoPersist`.
Georg Brandl116aa622007-08-15 14:28:22 +0000243
244
245.. seealso::
246
247 `MsiSummaryInfoGetProperty <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfogetproperty.asp>`_
248 `MsiSummaryInfoGetPropertyCount <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfogetpropertycount.asp>`_
249 `MsiSummaryInfoSetProperty <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfosetproperty.asp>`_
250 `MsiSummaryInfoPersist <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfopersist.asp>`_
251
252.. _record-objects:
253
254Record Objects
255--------------
256
257
258.. method:: Record.GetFieldCount()
259
260 Return the number of fields of the record, through
Georg Brandl60203b42010-10-06 10:11:56 +0000261 :c:func:`MsiRecordGetFieldCount`.
Georg Brandl116aa622007-08-15 14:28:22 +0000262
263
Martin v. Löwise95593e2008-06-02 10:08:54 +0000264.. method:: Record.GetInteger(field)
265
266 Return the value of *field* as an integer where possible. *field* must
267 be an integer.
268
269
270.. method:: Record.GetString(field)
271
272 Return the value of *field* as a string where possible. *field* must
273 be an integer.
274
275
Georg Brandl116aa622007-08-15 14:28:22 +0000276.. method:: Record.SetString(field, value)
277
Georg Brandl60203b42010-10-06 10:11:56 +0000278 Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be an
Georg Brandl116aa622007-08-15 14:28:22 +0000279 integer; *value* a string.
280
281
282.. method:: Record.SetStream(field, value)
283
284 Set *field* to the contents of the file named *value*, through
Georg Brandl60203b42010-10-06 10:11:56 +0000285 :c:func:`MsiRecordSetStream`. *field* must be an integer; *value* a string.
Georg Brandl116aa622007-08-15 14:28:22 +0000286
287
288.. method:: Record.SetInteger(field, value)
289
Georg Brandl60203b42010-10-06 10:11:56 +0000290 Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* and
Georg Brandl116aa622007-08-15 14:28:22 +0000291 *value* must be an integer.
292
293
294.. method:: Record.ClearData()
295
Georg Brandl60203b42010-10-06 10:11:56 +0000296 Set all fields of the record to 0, through :c:func:`MsiRecordClearData`.
Georg Brandl116aa622007-08-15 14:28:22 +0000297
298
299.. seealso::
300
301 `MsiRecordGetFieldCount <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordgetfieldcount.asp>`_
302 `MsiRecordSetString <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetstring.asp>`_
303 `MsiRecordSetStream <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetstream.asp>`_
304 `MsiRecordSetInteger <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetinteger.asp>`_
305 `MsiRecordClear <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordclear.asp>`_
306
307.. _msi-errors:
308
309Errors
310------
311
312All wrappers around MSI functions raise :exc:`MsiError`; the string inside the
313exception will contain more detail.
314
315
316.. _cab:
317
318CAB Objects
319-----------
320
321
322.. class:: CAB(name)
323
324 The class :class:`CAB` represents a CAB file. During MSI construction, files
325 will be added simultaneously to the ``Files`` table, and to a CAB file. Then,
326 when all files have been added, the CAB file can be written, then added to the
327 MSI file.
328
329 *name* is the name of the CAB file in the MSI file.
330
331
Benjamin Petersone41251e2008-04-25 01:59:09 +0000332 .. method:: append(full, file, logical)
Georg Brandl116aa622007-08-15 14:28:22 +0000333
Benjamin Petersone41251e2008-04-25 01:59:09 +0000334 Add the file with the pathname *full* to the CAB file, under the name
335 *logical*. If there is already a file named *logical*, a new file name is
336 created.
Georg Brandl116aa622007-08-15 14:28:22 +0000337
Benjamin Petersone41251e2008-04-25 01:59:09 +0000338 Return the index of the file in the CAB file, and the new name of the file
339 inside the CAB file.
Georg Brandl116aa622007-08-15 14:28:22 +0000340
341
Benjamin Petersone41251e2008-04-25 01:59:09 +0000342 .. method:: commit(database)
Georg Brandl116aa622007-08-15 14:28:22 +0000343
Benjamin Petersone41251e2008-04-25 01:59:09 +0000344 Generate a CAB file, add it as a stream to the MSI file, put it into the
345 ``Media`` table, and remove the generated file from the disk.
Georg Brandl116aa622007-08-15 14:28:22 +0000346
347
348.. _msi-directory:
349
350Directory Objects
351-----------------
352
353
Éric Araujo29087652010-12-26 02:38:05 +0000354.. class:: Directory(database, cab, basedir, physical, logical, default, [componentflags])
Georg Brandl116aa622007-08-15 14:28:22 +0000355
356 Create a new directory in the Directory table. There is a current component at
357 each point in time for the directory, which is either explicitly created through
358 :meth:`start_component`, or implicitly when files are added for the first time.
359 Files are added into the current component, and into the cab file. To create a
360 directory, a base directory object needs to be specified (can be ``None``), the
361 path to the physical directory, and a logical directory name. *default*
362 specifies the DefaultDir slot in the directory table. *componentflags* specifies
363 the default flags that new components get.
364
365
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000366 .. method:: start_component(component=None, feature=None, flags=None, keyfile=None, uuid=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000367
Benjamin Petersone41251e2008-04-25 01:59:09 +0000368 Add an entry to the Component table, and make this component the current
369 component for this directory. If no component name is given, the directory
370 name is used. If no *feature* is given, the current feature is used. If no
371 *flags* are given, the directory's default flags are used. If no *keyfile*
372 is given, the KeyPath is left null in the Component table.
Georg Brandl116aa622007-08-15 14:28:22 +0000373
374
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000375 .. method:: add_file(file, src=None, version=None, language=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000376
Benjamin Petersone41251e2008-04-25 01:59:09 +0000377 Add a file to the current component of the directory, starting a new one
378 if there is no current component. By default, the file name in the source
379 and the file table will be identical. If the *src* file is specified, it
380 is interpreted relative to the current directory. Optionally, a *version*
381 and a *language* can be specified for the entry in the File table.
Georg Brandl116aa622007-08-15 14:28:22 +0000382
383
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000384 .. method:: glob(pattern, exclude=None)
Georg Brandl116aa622007-08-15 14:28:22 +0000385
Benjamin Petersone41251e2008-04-25 01:59:09 +0000386 Add a list of files to the current component as specified in the glob
387 pattern. Individual files can be excluded in the *exclude* list.
Georg Brandl116aa622007-08-15 14:28:22 +0000388
389
Benjamin Petersone41251e2008-04-25 01:59:09 +0000390 .. method:: remove_pyc()
Georg Brandl116aa622007-08-15 14:28:22 +0000391
Benjamin Petersone41251e2008-04-25 01:59:09 +0000392 Remove ``.pyc``/``.pyo`` files on uninstall.
Georg Brandl116aa622007-08-15 14:28:22 +0000393
394
395.. seealso::
396
Georg Brandl495f7b52009-10-27 15:28:25 +0000397 `Directory Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/directory_table.asp>`_
398 `File Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/file_table.asp>`_
399 `Component Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/component_table.asp>`_
400 `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 +0000401
402.. _features:
403
404Features
405--------
406
407
Georg Brandlcd7f32b2009-06-08 09:13:45 +0000408.. class:: Feature(db, id, title, desc, display, level=1, parent=None, directory=None, attributes=0)
Georg Brandl116aa622007-08-15 14:28:22 +0000409
410 Add a new record to the ``Feature`` table, using the values *id*, *parent.id*,
411 *title*, *desc*, *display*, *level*, *directory*, and *attributes*. The
412 resulting feature object can be passed to the :meth:`start_component` method of
413 :class:`Directory`.
414
415
Benjamin Petersone41251e2008-04-25 01:59:09 +0000416 .. method:: set_current()
Georg Brandl116aa622007-08-15 14:28:22 +0000417
Benjamin Petersone41251e2008-04-25 01:59:09 +0000418 Make this feature the current feature of :mod:`msilib`. New components are
419 automatically added to the default feature, unless a feature is explicitly
420 specified.
Georg Brandl116aa622007-08-15 14:28:22 +0000421
422
423.. seealso::
424
Georg Brandl495f7b52009-10-27 15:28:25 +0000425 `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 +0000426
427.. _msi-gui:
428
429GUI classes
430-----------
431
432:mod:`msilib` provides several classes that wrap the GUI tables in an MSI
433database. However, no standard user interface is provided; use :mod:`bdist_msi`
434to create MSI files with a user-interface for installing Python packages.
435
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.