The VBScript file WiExport.vbs is provided in the Windows SDK Components for Windows Installer Developers. This sample shows how to write script to export tables into a Windows Installer database. The script sample connects to an Installer object, opens a database and exports tables to archive files.
The sample demonstrates the use of:
- OpenDatabase Method (Installer Object)
- LastErrorRecord method of the Installer object
- Export method
- OpenView method of the Database object
- Fetch method of the View object
- StringData property of the Record object
You'll require the CScript.exe or WScript.exe version of Windows Script Host to use this sample. To use CScript.exe to run this sample, type a command line at the command prompt using the following syntax. Help is displayed if the first argument is /? or if too few arguments are specified. To redirect the output to a file, end the command line with VBS > [path to file]. The sample returns a value of 0 for success, 1 if help is invoked, and 2 if the script fails.
cscript WiExport.vbs [path to database][path to folder][options][table name list]
Specify the path to the installer database from which the tables are being exported. Specify the path to the folder into which the exported archive files are to be copied. List the case-sensitive names of the database tables being exported. Specify '*' to export all the tables including _SummaryInformation.
The following options may be specified anywhere on the command line before the table name list.
|no option specified||Exported archive files may have a long file name.|
|/s||Force exported archive files to have short file names.|