home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / msiquery.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  42KB  |  894 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * MsiQuery.h - Interface to running installer for custom actions and tools    *
  4. *                                                                             *
  5. * Version 0.20                                                                *
  6. *                                                                             *
  7. * NOTES:  All buffers sizes are TCHAR count, null included only on input      *
  8. *         Return argument pointers may be null if not interested in value     *
  9. *         Returned handles of all types must be closed: MsiCloseHandle(h)     *
  10. *         Functions with UINT return type return a system error code          *
  11. *                                                                             *
  12. * Copyright (c) 1997, Microsoft Corp.      All rights reserved.               *
  13. *                                                                             *
  14. \*****************************************************************************/
  15.  
  16. #ifndef _MSIQUERY_H_
  17. #define _MSIQUERY_H_
  18. #include "msi.h"  // INSTALLSTATE
  19.  
  20.  
  21. #define MSI_NULL_INTEGER 0x80000000  // integer value reserved for null
  22.  
  23. // MsiOpenDatabase persist predefine values, otherwise output database path is used
  24. #define MSIDBOPEN_READONLY  (LPCTSTR)0  // database open read-only, no persistent changes
  25. #define MSIDBOPEN_TRANSACT  (LPCTSTR)1  // database read/write in transaction mode
  26. #define MSIDBOPEN_DIRECT    (LPCTSTR)2  // database direct read/write without transaction
  27. #define MSIDBOPEN_CREATE    (LPCTSTR)3  // create new database, direct mode read/write
  28.  
  29. typedef enum tagMSIDBSTATE
  30. {
  31.     MSIDBSTATE_ERROR    =-1,  // invalid database handle
  32.     MSIDBSTATE_READ     = 0,  // database open read-only, no persistent changes
  33.     MSIDBSTATE_WRITE    = 1,  // database readable and updatable
  34. } MSIDBSTATE;
  35.  
  36. typedef enum tagMSIMODIFY
  37. {
  38.     MSIMODIFY_REFRESH          = 0,  // refetch current record data
  39.     MSIMODIFY_INSERT           = 1,  // insert new record, fails if matching key exists
  40.     MSIMODIFY_UPDATE           = 2,  // update existing non-key data of fetched record
  41.     MSIMODIFY_ASSIGN           = 3,  // insert record, replacing any existing record
  42.     MSIMODIFY_REPLACE          = 4,  // update record, delete old if primary key edit
  43.     MSIMODIFY_MERGE            = 5,  // fails if record with duplicate key not identical
  44.     MSIMODIFY_DELETE           = 6,  // remove row referenced by this record from table
  45.     MSIMODIFY_INSERT_TEMPORARY = 7,  // insert a temporary record
  46.     MSIMODIFY_VALIDATE         = 8,  // validate a fetched record
  47.     MSIMODIFY_VALIDATE_NEW     = 9,  // validate a new record
  48.     MSIMODIFY_VALIDATE_FIELD   = 10, // validate field(s) of an incomplete record
  49.     MSIMODIFY_VALIDATE_DELETE  = 11, // validate before deleting record
  50. } MSIMODIFY;
  51.  
  52. typedef enum tagMSICOLINFO
  53. {
  54.     MSICOLINFO_NAMES = 0,  // return column names
  55.     MSICOLINFO_TYPES = 1,  // return column definitions, datatype code followed by width
  56. } MSICOLINFO;
  57.  
  58. typedef enum tagMSICONDITION
  59. {
  60.     MSICONDITION_FALSE = 0,  // expression evaluates to False
  61.     MSICONDITION_TRUE  = 1,  // expression evaluates to True
  62.     MSICONDITION_NONE  = 2,  // no expression present
  63.     MSICONDITION_ERROR = 3,  // syntax error in expression
  64. } MSICONDITION;
  65.  
  66. typedef enum tagMSIMESSAGE
  67. {
  68.     MSIMESSAGE_OutOfMemory =  0x00000000L, // out of memory, may call recursively
  69.     MSIMESSAGE_Error       =  0x01000000L, // error message,   [1] is message number in Error table
  70.     MSIMESSAGE_Warning     =  0x02000000L, // warning message, [1] message number in Error table
  71.     MSIMESSAGE_User        =  0x03000000L, // user request,    [1] message number in Error table
  72.     MSIMESSAGE_Info        =  0x04000000L, // informative message for log, not to be displayed
  73.     MSIMESSAGE_Diagnostic  =  0x05000000L, // debug notification, displayed only if no log
  74.     MSIMESSAGE_CommonData  =  0x06000000L, // info for UI: [1]=language Id, [2]=dialog caption
  75.     MSIMESSAGE_Reserved    =  0x07000000L, // reserved for future use
  76.     MSIMESSAGE_ActionStart =  0x08000000L, // progress: start of action, [1] action name, [2] description
  77.     MSIMESSAGE_ActionData  =  0x09000000L, // progress: data associated with individual action item
  78.     MSIMESSAGE_Progress    =  0x0A000000L, // progress: gauge info, [1] units so far, [2] total
  79.     MSIMESSAGE_ActionDone  =  0x0B000000L, // progress: end of action sequence, exit modeless dialog
  80. } MSIMESSAGE;
  81.  
  82. typedef enum tagMSICOSTTREE
  83. {
  84.     MSICOSTTREE_SELFONLY = 0,
  85.     MSICOSTTREE_CHILDREN = 1,
  86.     MSICOSTTREE_PARENTS  = 2,
  87.     MSICOSTTREE_PRODUCT  = 3,
  88. } MSICOSTTREE;
  89.  
  90. typedef enum tagMSIDBERROR
  91. {
  92.     MSIDBERROR_INVALIDARG        = -3, //  invalid argument
  93.     MSIDBERROR_MOREDATA          = -2, //  buffer too small
  94.     MSIDBERROR_FUNCTIONERROR     = -1, //  function error
  95.     MSIDBERROR_NOERROR           = 0,  //  no error
  96.     MSIDBERROR_DUPLICATEKEY      = 1,  //  new record duplicates primary keys of existing record in table
  97.     MSIDBERROR_REQUIRED          = 2,  //  non-nullable column, no null values allowed
  98.     MSIDBERROR_BADLINK           = 3,  //  corresponding record in foreign table not found
  99.     MSIDBERROR_OVERFLOW          = 4,  //  data greater than maximum value allowed
  100.     MSIDBERROR_UNDERFLOW         = 5,  //  data less than minimum value allowed
  101.     MSIDBERROR_NOTINSET          = 6,  //  data not a member of the values permitted in the set
  102.     MSIDBERROR_BADVERSION        = 7,  //  invalid version string
  103.     MSIDBERROR_BADCASE           = 8,  //  invalid case, must be all upper-case or all lower-case
  104.     MSIDBERROR_BADGUID           = 9,  //  invalid GUID
  105.     MSIDBERROR_BADWILDCARD       = 10, //  invalid wildcardfilename or use of wildcards
  106.     MSIDBERROR_BADIDENTIFIER     = 11, //  bad identifier
  107.     MSIDBERROR_BADLANGUAGE       = 12, //  bad language Id(s)
  108.     MSIDBERROR_BADFILENAME       = 13, //  bad filename
  109.     MSIDBERROR_BADPATH           = 14, //  bad path
  110.     MSIDBERROR_BADCONDITION      = 15, //  bad conditional statement
  111.     MSIDBERROR_BADFORMATTED      = 16, //  bad format string
  112.     MSIDBERROR_BADTEMPLATE       = 17, //  bad template string
  113.     MSIDBERROR_BADDEFAULTDIR     = 18, //  bad string in DefaultDir column of Directory table
  114.     MSIDBERROR_BADREGPATH        = 19, //  bad registry path string
  115.     MSIDBERROR_BADCUSTOMSOURCE   = 20, //  bad string in CustomSource column of CustomAction table
  116.     MSIDBERROR_BADPROPERTY       = 21, //  bad property string
  117.     MSIDBERROR_MISSINGDATA       = 22, //  _Validation table missing reference to column
  118.     MSIDBERROR_BADCATEGORY       = 23, //  Category column of _Validation table for column is invalid
  119.     MSIDBERROR_BADKEYTABLE       = 24, //  table in KeyTable column of _Validation table could not be found/loaded
  120.     MSIDBERROR_BADMAXMINVALUES   = 25, //  value in MaxValue column of _Validation table is less than value in MinValue column
  121.     MSIDBERROR_BADCABINET        = 26, //  bad cabinet name
  122.     MSIDBERROR_BADSHORTCUT       = 27, //  bad shortcut target
  123.     MSIDBERROR_STRINGOVERFLOW    = 28, //  string overflow (greater than length allowed in column def)
  124.     MSIDBERROR_BADLOCALIZEATTRIB = 29  //  invalid localization attribute (primary keys cannot be localized)
  125.  
  126. } MSIDBERROR;
  127.  
  128. typedef enum tagMSIRUNMODE
  129. {
  130.     MSIRUNMODE_ADMIN           =  0, // admin mode install, else product install
  131.     MSIRUNMODE_ADVERTISE       =  1, // installing advertisements, else installing or updating product
  132.     MSIRUNMODE_MAINTENANCE     =  2, // modifying an existing installation, else new installation
  133.     MSIRUNMODE_ROLLBACKENABLED =  3, // rollback is enabled
  134.     MSIRUNMODE_LOGENABLED      =  4, // log file active, enabled prior to install session
  135.     MSIRUNMODE_OPERATIONS      =  5, // spooling execute operations, else in determination phase
  136.     MSIRUNMODE_REBOOTATEND     =  6, // reboot needed after successful installation (settable)
  137.     MSIRUNMODE_REBOOTNOW       =  7, // reboot needed to continue installation (settable)
  138.     MSIRUNMODE_CABINET         =  8, // installing files from cabinets and files using Media table
  139.     MSIRUNMODE_SOURCESHORTNAMES=  9, // source LongFileNames suppressed via PID_MSISOURCE summary property
  140.     MSIRUNMODE_TARGETSHORTNAMES= 10, // target LongFileNames suppressed via SHORTFILENAMES property
  141.     MSIRUNMODE_RESERVED11      = 11, // future use
  142.     MSIRUNMODE_WINDOWS9X       = 12, // operating systems is Windows9?, else Windows NT
  143.     MSIRUNMODE_ZAWENABLED      = 13, // operating system supports demand installation
  144.     MSIRUNMODE_RESERVED14      = 14, // future use
  145.     MSIRUNMODE_RESERVED15      = 15, // future use
  146. } MSIRUNMODE;
  147.  
  148. #define MSIMESSAGE_TYPEMASK = 0xFF000000L  // mask for type code
  149.  
  150. // Note: MSIMESSAGE_ERROR, MSIMESSAGE_WARNING, MSIMESSAGE_USER are to or'd
  151. // with a message box style to indicate the buttons to display and return:
  152. // MB_OK,MB_OKCANCEL,MB_ABORTRETRYIGNORE,MB_YESNOCANCEL,MB_YESNO,MB_RETRYCANCEL
  153. // the default button (MB_DEFBUTTON1 is normal default):
  154. // MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3
  155. // and optionally an icon style:
  156. // MB_ICONERROR, MB_ICONQUESTION, MB_ICONWARNING, MB_ICONINFORMATION
  157.  
  158. #ifdef __cplusplus
  159. extern "C" {
  160. #endif
  161.  
  162. // --------------------------------------------------------------------------
  163. // Installer database access functions
  164. // --------------------------------------------------------------------------
  165.  
  166. // Prepare a database query, creating a view object
  167. // Returns ERROR_SUCCESS if successful, and the view handle is returned,
  168. // else ERROR_INVALID_HANDLE, ERROR_INVALID_HANDLE_STATE, ERROR_BAD_QUERY_SYNTAX, ERROR_GEN_FAILURE
  169.  
  170. UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hDatabase,
  171.     LPCSTR     szQuery,            // SQL query to be prepared
  172.     MSIHANDLE*  phView);            // returned view if TRUE
  173. UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE hDatabase,
  174.     LPCWSTR     szQuery,            // SQL query to be prepared
  175.     MSIHANDLE*  phView);            // returned view if TRUE
  176. #ifdef UNICODE
  177. #define MsiDatabaseOpenView  MsiDatabaseOpenViewW
  178. #else
  179. #define MsiDatabaseOpenView  MsiDatabaseOpenViewA
  180. #endif // !UNICODE
  181.  
  182. // Returns the MSIDBERROR enum and name of the column corresponding to the error
  183. // Similar to a GetLastError function, but for the view.  
  184. // Returns errors of MsiViewModify.
  185.  
  186. MSIDBERROR WINAPI MsiViewGetErrorA(MSIHANDLE hView,
  187.     LPSTR szColumnNameBuffer,  // buffer to hold column name 
  188.     DWORD* pcchBuf);             // size of buffer
  189. MSIDBERROR WINAPI MsiViewGetErrorW(MSIHANDLE hView,
  190.     LPWSTR szColumnNameBuffer,  // buffer to hold column name 
  191.     DWORD* pcchBuf);             // size of buffer
  192. #ifdef UNICODE
  193. #define MsiViewGetError  MsiViewGetErrorW
  194. #else
  195. #define MsiViewGetError  MsiViewGetErrorA
  196. #endif // !UNICODE
  197.  
  198. // Exectute the view query, supplying parameters as required
  199. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_HANDLE_STATE, ERROR_GEN_FAILURE
  200.  
  201. UINT WINAPI MsiViewExecute(MSIHANDLE hView,
  202.     MSIHANDLE hRecord);             // optional parameter record, or 0 if none
  203.  
  204. // Fetch the next sequential record from the view
  205. // Result is ERROR_SUCCESS if a row is found, and its handle is returned
  206. // else ERROR_NO_DATA if no records remain, and a null handle is returned
  207. // else result is error: ERROR_INVALID_HANDLE_STATE, ERROR_INVALID_HANDLE, ERROR_GEN_FAILURE
  208.  
  209. UINT WINAPI MsiViewFetch(MSIHANDLE hView,
  210.     MSIHANDLE  *phRecord);          // returned data record if fetch succeeds
  211.  
  212. // Modify a database record, parameters must match types in query columns
  213. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_HANDLE_STATE, ERROR_GEN_FAILURE, ERROR_ACCESS_DENIED
  214.  
  215. UINT WINAPI MsiViewModify(MSIHANDLE hView,
  216.     MSIMODIFY eModifyMode,         // modify action to perform
  217.     MSIHANDLE hRecord);            // record obtained from fetch, or new record
  218.  
  219. // Return the column names or specifications for the current view
  220. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_PARAMETER, or ERROR_INVALID_HANDLE_STATE
  221.  
  222. UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView,
  223.     MSICOLINFO eColumnInfo,        // retrieve columns names or definitions
  224.     MSIHANDLE *phRecord);          // returned data record containing all names or definitions
  225.  
  226. // Release the result set for an executed view, to allow re-execution
  227. // Only needs to be called if not all records have been fetched
  228. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_HANDLE_STATE
  229.  
  230. UINT WINAPI MsiViewClose(MSIHANDLE hView);
  231.  
  232. // Return a record containing the names of all primary key columns for a given table
  233. // Returns an MSIHANDLE for a record containing the name of each column.
  234. // The field count of the record corresponds to the number of primary key columns.
  235. // Field [0] of the record contains the table name.
  236. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_TABLE
  237.  
  238. UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hDatabase,
  239.     LPCSTR    szTableName,       // the name of a specific table <case-sensitive>
  240.     MSIHANDLE  *phRecord);         // returned record if ERROR_SUCCESS
  241. UINT WINAPI MsiDatabaseGetPrimaryKeysW(MSIHANDLE hDatabase,
  242.     LPCWSTR    szTableName,       // the name of a specific table <case-sensitive>
  243.     MSIHANDLE  *phRecord);         // returned record if ERROR_SUCCESS
  244. #ifdef UNICODE
  245. #define MsiDatabaseGetPrimaryKeys  MsiDatabaseGetPrimaryKeysW
  246. #else
  247. #define MsiDatabaseGetPrimaryKeys  MsiDatabaseGetPrimaryKeysA
  248. #endif // !UNICODE
  249.  
  250. // Return an enum defining the state of the table (temporary, unknown, or persistent).
  251. // Returns MSICONDITION_ERROR, MSICONDITION_FALSE, MSICONDITION_TRUE, MSICONDITION_NONE
  252.  
  253. MSICONDITION WINAPI MsiDatabaseIsTablePersistentA(MSIHANDLE hDatabase,
  254.     LPCSTR szTableName);         // the name of a specific table
  255. MSICONDITION WINAPI MsiDatabaseIsTablePersistentW(MSIHANDLE hDatabase,
  256.     LPCWSTR szTableName);         // the name of a specific table
  257. #ifdef UNICODE
  258. #define MsiDatabaseIsTablePersistent  MsiDatabaseIsTablePersistentW
  259. #else
  260. #define MsiDatabaseIsTablePersistent  MsiDatabaseIsTablePersistentA
  261. #endif // !UNICODE
  262.  
  263. // --------------------------------------------------------------------------
  264. // Summary information stream management functions
  265. // --------------------------------------------------------------------------
  266.  
  267. // Integer Property IDs:    1, 14, 15, 16, 19 
  268. // DateTime Property IDs:   10, 11, 12, 13
  269. // Text Property IDs:       2, 3, 4, 5, 6, 7, 8, 9, 18
  270. // Unsupported Propery IDs: 0 (PID_DICTIONARY), 17 (PID_THUMBNAIL)
  271.  
  272. // Obtain a handle for the _SummaryInformation stream for an MSI database     
  273.  
  274. UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, // 0 if not open
  275.     LPCSTR  szDatabasePath,  // path to database, 0 if database handle supplied
  276.     UINT     uiUpdateCount,    // maximium number of updated values, 0 to open read-only
  277.     MSIHANDLE *phSummaryInfo); // returned handle to summary information data
  278. UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase, // 0 if not open
  279.     LPCWSTR  szDatabasePath,  // path to database, 0 if database handle supplied
  280.     UINT     uiUpdateCount,    // maximium number of updated values, 0 to open read-only
  281.     MSIHANDLE *phSummaryInfo); // returned handle to summary information data
  282. #ifdef UNICODE
  283. #define MsiGetSummaryInformation  MsiGetSummaryInformationW
  284. #else
  285. #define MsiGetSummaryInformation  MsiGetSummaryInformationA
  286. #endif // !UNICODE
  287.  
  288. // Obtain the number of existing properties in the SummaryInformation stream
  289.  
  290. UINT WINAPI MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo,
  291.     UINT *puiPropertyCount); // pointer to location to return total property count
  292.  
  293. // Set a single summary information property
  294. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_UNKNOWN_PROPERTY
  295.  
  296. UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE hSummaryInfo,
  297.     UINT     uiProperty,     // property ID, one of allowed values for summary information
  298.     UINT     uiDataType,     // VT_I4, VT_LPSTR, VT_FILETIME, or VT_EMPTY
  299.     INT      iValue,         // integer value, used only if integer property
  300.     FILETIME *pftValue,      // pointer to filetime value, used only if datetime property
  301.     LPCSTR szValue);       // text value, used only if string property
  302. UINT WINAPI MsiSummaryInfoSetPropertyW(MSIHANDLE hSummaryInfo,
  303.     UINT     uiProperty,     // property ID, one of allowed values for summary information
  304.     UINT     uiDataType,     // VT_I4, VT_LPSTR, VT_FILETIME, or VT_EMPTY
  305.     INT      iValue,         // integer value, used only if integer property
  306.     FILETIME *pftValue,      // pointer to filetime value, used only if datetime property
  307.     LPCWSTR szValue);       // text value, used only if string property
  308. #ifdef UNICODE
  309. #define MsiSummaryInfoSetProperty  MsiSummaryInfoSetPropertyW
  310. #else
  311. #define MsiSummaryInfoSetProperty  MsiSummaryInfoSetPropertyA
  312. #endif // !UNICODE
  313.  
  314. // Get a single property from the summary information
  315. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_UNKNOWN_PROPERTY
  316.  
  317. UINT WINAPI MsiSummaryInfoGetPropertyA(MSIHANDLE hSummaryInfo,
  318.     UINT     uiProperty,     // property ID, one of allowed values for summary information
  319.     UINT     *puiDataType,   // returned type: VT_I4, VT_LPSTR, VT_FILETIME, VT_EMPTY
  320.     INT      *piValue,       // returned integer property data
  321.     FILETIME *pftValue,      // returned datetime property data
  322.     LPSTR  szValueBuf,     // buffer to return string property data
  323.     DWORD    *pcchValueBuf); // in/out buffer character count
  324. UINT WINAPI MsiSummaryInfoGetPropertyW(MSIHANDLE hSummaryInfo,
  325.     UINT     uiProperty,     // property ID, one of allowed values for summary information
  326.     UINT     *puiDataType,   // returned type: VT_I4, VT_LPSTR, VT_FILETIME, VT_EMPTY
  327.     INT      *piValue,       // returned integer property data
  328.     FILETIME *pftValue,      // returned datetime property data
  329.     LPWSTR  szValueBuf,     // buffer to return string property data
  330.     DWORD    *pcchValueBuf); // in/out buffer character count
  331. #ifdef UNICODE
  332. #define MsiSummaryInfoGetProperty  MsiSummaryInfoGetPropertyW
  333. #else
  334. #define MsiSummaryInfoGetProperty  MsiSummaryInfoGetPropertyA
  335. #endif // !UNICODE
  336.  
  337. // Write back changed information to summary information stream
  338.  
  339. UINT WINAPI MsiSummaryInfoPersist(MSIHANDLE hSummaryInfo);
  340.  
  341. // --------------------------------------------------------------------------
  342. // Installer database management functions - not used by custom actions
  343. // --------------------------------------------------------------------------
  344.  
  345. // Open an installer database, specifying the persistance mode
  346.  
  347. UINT WINAPI MsiOpenDatabaseA(
  348.     LPCSTR      szDatabasePath,  // path to database, 0 to create temporary database
  349.     LPCSTR      szPersist,       // output database path or one of predefined values
  350.     MSIHANDLE*   phDatabase);     // location to return database handle
  351. UINT WINAPI MsiOpenDatabaseW(
  352.     LPCWSTR      szDatabasePath,  // path to database, 0 to create temporary database
  353.     LPCWSTR      szPersist,       // output database path or one of predefined values
  354.     MSIHANDLE*   phDatabase);     // location to return database handle
  355. #ifdef UNICODE
  356. #define MsiOpenDatabase  MsiOpenDatabaseW
  357. #else
  358. #define MsiOpenDatabase  MsiOpenDatabaseA
  359. #endif // !UNICODE
  360.  
  361. // Import an MSI text archive table into an open database
  362.  
  363. UINT WINAPI MsiDatabaseImportA(MSIHANDLE hDatabase,
  364.     LPCSTR   szFolderPath,     // folder containing archive files
  365.     LPCSTR   szFileName);      // table archive file to be imported
  366. UINT WINAPI MsiDatabaseImportW(MSIHANDLE hDatabase,
  367.     LPCWSTR   szFolderPath,     // folder containing archive files
  368.     LPCWSTR   szFileName);      // table archive file to be imported
  369. #ifdef UNICODE
  370. #define MsiDatabaseImport  MsiDatabaseImportW
  371. #else
  372. #define MsiDatabaseImport  MsiDatabaseImportA
  373. #endif // !UNICODE
  374.  
  375. // Export an MSI table from an open database to a text archive file
  376.  
  377. UINT WINAPI MsiDatabaseExportA(MSIHANDLE hDatabase,
  378.     LPCSTR   szTableName,      // name of table in database <case-sensitive>
  379.     LPCSTR   szFolderPath,     // folder containing archive files
  380.     LPCSTR   szFileName);      // name of exported table archive file
  381. UINT WINAPI MsiDatabaseExportW(MSIHANDLE hDatabase,
  382.     LPCWSTR   szTableName,      // name of table in database <case-sensitive>
  383.     LPCWSTR   szFolderPath,     // folder containing archive files
  384.     LPCWSTR   szFileName);      // name of exported table archive file
  385. #ifdef UNICODE
  386. #define MsiDatabaseExport  MsiDatabaseExportW
  387. #else
  388. #define MsiDatabaseExport  MsiDatabaseExportA
  389. #endif // !UNICODE
  390.  
  391. // Merge two database together, allowing duplicate rows
  392.  
  393. UINT WINAPI MsiDatabaseMergeA(MSIHANDLE hDatabase,
  394.     MSIHANDLE hDatabaseMerge,    // database to be merged into hDatabase
  395.     LPCSTR   szTableName);      // name of non-persistent table to receive errors
  396. UINT WINAPI MsiDatabaseMergeW(MSIHANDLE hDatabase,
  397.     MSIHANDLE hDatabaseMerge,    // database to be merged into hDatabase
  398.     LPCWSTR   szTableName);      // name of non-persistent table to receive errors
  399. #ifdef UNICODE
  400. #define MsiDatabaseMerge  MsiDatabaseMergeW
  401. #else
  402. #define MsiDatabaseMerge  MsiDatabaseMergeA
  403. #endif // !UNICODE
  404.  
  405. // Generate a transform file of differences between two databases
  406.  
  407. UINT WINAPI MsiDatabaseGenerateTransformA(MSIHANDLE hDatabase,
  408.     MSIHANDLE hDatabaseReference, // base database to reference changes
  409.     LPCSTR   szTransformFile,    // name of generated transform file
  410.     int       iErrorConditions,    // conditions treated as errors when transform applied
  411.     int       iValidation);        // properties to be validated when transform applied
  412. UINT WINAPI MsiDatabaseGenerateTransformW(MSIHANDLE hDatabase,
  413.     MSIHANDLE hDatabaseReference, // base database to reference changes
  414.     LPCWSTR   szTransformFile,    // name of generated transform file
  415.     int       iErrorConditions,    // conditions treated as errors when transform applied
  416.     int       iValidation);        // properties to be validated when transform applied
  417. #ifdef UNICODE
  418. #define MsiDatabaseGenerateTransform  MsiDatabaseGenerateTransformW
  419. #else
  420. #define MsiDatabaseGenerateTransform  MsiDatabaseGenerateTransformA
  421. #endif // !UNICODE
  422.  
  423. // Apply a transform file containing database difference
  424.  
  425. UINT WINAPI MsiDatabaseApplyTransformA(MSIHANDLE hDatabase,
  426.     LPCSTR   szTransformFile,    // name of transform file
  427.     int       iErrorConditions);   // existing row conditions treated as errors
  428. UINT WINAPI MsiDatabaseApplyTransformW(MSIHANDLE hDatabase,
  429.     LPCWSTR   szTransformFile,    // name of transform file
  430.     int       iErrorConditions);   // existing row conditions treated as errors
  431. #ifdef UNICODE
  432. #define MsiDatabaseApplyTransform  MsiDatabaseApplyTransformW
  433. #else
  434. #define MsiDatabaseApplyTransform  MsiDatabaseApplyTransformA
  435. #endif // !UNICODE
  436.  
  437. // Write out all persistent table data, ignored if database opened read-only
  438.  
  439. UINT WINAPI MsiDatabaseCommit(MSIHANDLE hDatabase);
  440.  
  441. // Return the update state of a database
  442.  
  443. MSIDBSTATE WINAPI MsiGetDatabaseState(MSIHANDLE hDatabase);
  444.  
  445. // --------------------------------------------------------------------------
  446. // Record object functions
  447. // --------------------------------------------------------------------------
  448.  
  449. // Create a new record object with the requested number of fields
  450. // Field 0, not included in count, is used for format strings and op codes
  451. // All fields are initialized to null
  452. // Returns a handle to the created record, or 0 if memory could not be allocated
  453.  
  454. MSIHANDLE WINAPI MsiCreateRecord(
  455.     unsigned int cParams);                   // the number of data fields
  456.  
  457. // Report whether a record field is NULL
  458. // Returns TRUE if the field is null or does not exist
  459. // Returns FALSE if the field contains data, or the handle is invalid
  460.  
  461. BOOL WINAPI MsiRecordIsNull(MSIHANDLE hRecord,
  462.     unsigned int iField);
  463.  
  464. // Return the length of a record field
  465. // Returns 0 if field is NULL or non-existent
  466. // Returns sizeof(int) if integer data
  467. // Returns character count if string data (not counting null terminator)
  468. // Returns bytes count if stream data
  469.  
  470. unsigned int WINAPI MsiRecordDataSize(MSIHANDLE hRecord,
  471.     unsigned int iField);
  472.  
  473. // Set a record field to an integer value
  474. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_FIELD
  475.  
  476. UINT WINAPI MsiRecordSetInteger(MSIHANDLE hRecord,
  477.     unsigned int iField,
  478.     int iValue);
  479.  
  480. // Copy a string into the designated field
  481. // A null string pointer and an empty string both set the field to null
  482. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_FIELD
  483.  
  484. UINT WINAPI MsiRecordSetStringA(MSIHANDLE hRecord,
  485.     unsigned int iField,
  486.     LPCSTR      szValue);
  487. UINT WINAPI MsiRecordSetStringW(MSIHANDLE hRecord,
  488.     unsigned int iField,
  489.     LPCWSTR      szValue);
  490. #ifdef UNICODE
  491. #define MsiRecordSetString  MsiRecordSetStringW
  492. #else
  493. #define MsiRecordSetString  MsiRecordSetStringA
  494. #endif // !UNICODE
  495.  
  496. // Return the integer value from a record field
  497. // Returns the value MSI_NULL_INTEGER if the field is null
  498. // or if the field is a string that cannot be converted to an integer
  499.  
  500. int WINAPI MsiRecordGetInteger(MSIHANDLE hRecord,
  501.     unsigned int iField);
  502.  
  503. // Return the string value of a record field
  504. // Integer fields will be converted to a string
  505. // Null and non-existent fields will report a value of 0
  506. // Fields containing stream data will return ERROR_INVALID_DATATYPE
  507. // Returns ERROR_SUCCESS, ERROR_MORE_DATA, 
  508. //         ERROR_INVALID_HANDLE, ERROR_INVALID_FIELD, ERROR_BAD_ARGUMENTS
  509.  
  510. UINT WINAPI MsiRecordGetStringA(MSIHANDLE hRecord,
  511.     unsigned int iField,
  512.     LPSTR  szValueBuf,       // buffer for returned value
  513.     DWORD   *pcchValueBuf);   // in/out buffer character count
  514. UINT WINAPI MsiRecordGetStringW(MSIHANDLE hRecord,
  515.     unsigned int iField,
  516.     LPWSTR  szValueBuf,       // buffer for returned value
  517.     DWORD   *pcchValueBuf);   // in/out buffer character count
  518. #ifdef UNICODE
  519. #define MsiRecordGetString  MsiRecordGetStringW
  520. #else
  521. #define MsiRecordGetString  MsiRecordGetStringA
  522. #endif // !UNICODE
  523.  
  524. // Returns the number of fields allocated in the record
  525. // Does not count field 0, used for formatting and op codes
  526.  
  527. unsigned int WINAPI MsiRecordGetFieldCount(MSIHANDLE hRecord);
  528.  
  529. // Set a record stream field from a file
  530. // The contents of the specified file will be read into a stream object
  531. // The stream will be persisted if the record is inserted into the database
  532.  
  533. UINT WINAPI MsiRecordSetStreamA(MSIHANDLE hRecord,
  534.     unsigned int iField,
  535.     LPCSTR      szFilePath);   // path to file containing stream data
  536. UINT WINAPI MsiRecordSetStreamW(MSIHANDLE hRecord,
  537.     unsigned int iField,
  538.     LPCWSTR      szFilePath);   // path to file containing stream data
  539. #ifdef UNICODE
  540. #define MsiRecordSetStream  MsiRecordSetStreamW
  541. #else
  542. #define MsiRecordSetStream  MsiRecordSetStreamA
  543. #endif // !UNICODE
  544.  
  545. // Read bytes from a record stream field into a buffer
  546. // Must set the in/out argument to the requested byte count to read
  547. // The number of bytes transferred is returned through the argument
  548. // If no more bytes are available, ERROR_SUCCESS is still returned
  549.  
  550. UINT WINAPI MsiRecordReadStream(MSIHANDLE hRecord,
  551.     unsigned int iField,
  552.     char    *szDataBuf,     // buffer to receive bytes from stream
  553.     DWORD   *pcbDataBuf);   // in/out buffer byte count
  554.  
  555. // Clears all data fields in a record to NULL
  556.  
  557. UINT WINAPI MsiRecordClearData(MSIHANDLE hRecord);
  558.  
  559. // --------------------------------------------------------------------------
  560. // Functions to access a running installation, called from custom actions
  561. // The install handle is the single argument passed to custom actions
  562. // --------------------------------------------------------------------------
  563.  
  564. // Return a handle to the database currently in use by this installer instance
  565.  
  566. MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall); // returns handle to database, 0 if none active
  567.  
  568. // Set the value for an installer property
  569. // If the property is not defined, it will be created
  570. // If the value is null or an empty string, the property will be removed
  571. // Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_BAD_ARGUMENTS
  572.  
  573. UINT WINAPI MsiSetPropertyA(MSIHANDLE hInstall,
  574.     LPCSTR   szName,       // property identifier, case-sensitive
  575.     LPCSTR   szValue);     // property value, null to undefine property
  576. UINT WINAPI MsiSetPropertyW(MSIHANDLE hInstall,
  577.     LPCWSTR   szName,       // property identifier, case-sensitive
  578.     LPCWSTR   szValue);     // property value, null to undefine property
  579. #ifdef UNICODE
  580. #define MsiSetProperty  MsiSetPropertyW
  581. #else
  582. #define MsiSetProperty  MsiSetPropertyA
  583. #endif // !UNICODE
  584.  
  585. // Get the value for an installer property
  586. // If the property is not defined, it is equivalent to a 0-length value, not error
  587. // Returns ERROR_SUCCESS, ERROR_MORE_DATA, ERROR_INVALID_HANDLE, ERROR_BAD_ARGUMENTS
  588.  
  589. UINT  WINAPI MsiGetPropertyA(MSIHANDLE hInstall,
  590.     LPCSTR szName,           // property identifier, case-sensitive
  591.     LPSTR  szValueBuf,       // buffer for returned property value
  592.     DWORD   *pcchValueBuf);   // in/out buffer character count
  593. UINT  WINAPI MsiGetPropertyW(MSIHANDLE hInstall,
  594.     LPCWSTR szName,           // property identifier, case-sensitive
  595.     LPWSTR  szValueBuf,       // buffer for returned property value
  596.     DWORD   *pcchValueBuf);   // in/out buffer character count
  597. #ifdef UNICODE
  598. #define MsiGetProperty  MsiGetPropertyW
  599. #else
  600. #define MsiGetProperty  MsiGetPropertyA
  601. #endif // !UNICODE
  602.  
  603. // Return the numeric language for the currently running install
  604. // Returns 0 if an install not running
  605.  
  606. LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall);
  607.  
  608. // Return one of the boolean internal installer states
  609. // Returns FALSE if the handle is not active or if the mode is not implemented
  610.  
  611. BOOL WINAPI MsiGetMode(MSIHANDLE hInstall,
  612.     MSIRUNMODE eRunMode);   // particular mode for which the state is returned
  613.  
  614. // Set an internal install session boolean mode - Note: most modes are read-only
  615. // Returns ERROR_SUCCESS if the mode can be set to the desired state
  616. // Returns ERROR_ACCESS_DENIED if the mode is not settable
  617. // Returns ERROR_INVALID_HANDLE if the handle is not an active install session
  618.  
  619. UINT WINAPI MsiSetMode(MSIHANDLE hInstall,
  620.     MSIRUNMODE eRunMode,    // particular mode for which state is to be set
  621.     BOOL fState);           // new state for bit flag
  622.  
  623. // Format record data using a format string containing field markers and/or properties
  624. // Record field 0 must contain the format string
  625. // Other fields must contain data that may be referenced by the format string.
  626.  
  627. UINT WINAPI MsiFormatRecordA(MSIHANDLE hInstall,
  628.     MSIHANDLE hRecord,        // handle to record, field 0 contains format string
  629.     LPSTR    szResultBuf,    // buffer to return formatted string
  630.     DWORD    *pcchResultBuf); // in/out buffer character count
  631. UINT WINAPI MsiFormatRecordW(MSIHANDLE hInstall,
  632.     MSIHANDLE hRecord,        // handle to record, field 0 contains format string
  633.     LPWSTR    szResultBuf,    // buffer to return formatted string
  634.     DWORD    *pcchResultBuf); // in/out buffer character count
  635. #ifdef UNICODE
  636. #define MsiFormatRecord  MsiFormatRecordW
  637. #else
  638. #define MsiFormatRecord  MsiFormatRecordA
  639. #endif // !UNICODE
  640.  
  641. // Execute another action, either built-in, custom, or UI wizard
  642. // Returns ERROR_FUNCTION_NOT_CALLED if action not found
  643. // Returns ERROR_SUCCESS if action completed succesfully
  644. // Returns ERROR_INSTALL_USEREXIT if user cancelled during action
  645. // Returns ERROR_INSTALL_FAILURE if action failed
  646. // Returns ERROR_INSTALL_SUSPEND if user suspended installation
  647. // Returns ERROR_MORE_DATA if action wishes to skip remaining actions
  648. // Returns ERROR_INVALID_HANDLE_STATE if install session not active
  649. // Returns ERROR_INVALID_DATA if failure calling custom action
  650. // Returns ERROR_INVALID_HANDLE or ERROR_INVALID_PARAMETER if arguments invalid
  651.  
  652. UINT WINAPI MsiDoActionA(MSIHANDLE hInstall,
  653.     LPCSTR szAction);     // name of action to call, case-sensitive
  654. UINT WINAPI MsiDoActionW(MSIHANDLE hInstall,
  655.     LPCWSTR szAction);     // name of action to call, case-sensitive
  656. #ifdef UNICODE
  657. #define MsiDoAction  MsiDoActionW
  658. #else
  659. #define MsiDoAction  MsiDoActionA
  660. #endif // !UNICODE
  661.  
  662. // Execute another action sequence, as descibed in the specified table
  663. // Returns the same error codes as MsiDoAction
  664.  
  665. UINT WINAPI MsiSequenceA(MSIHANDLE hInstall,
  666.     LPCSTR szTable,       // name of table containing action sequence
  667.     INT iSequenceMode);     // reserved, must be 0
  668. UINT WINAPI MsiSequenceW(MSIHANDLE hInstall,
  669.     LPCWSTR szTable,       // name of table containing action sequence
  670.     INT iSequenceMode);     // reserved, must be 0
  671. #ifdef UNICODE
  672. #define MsiSequence  MsiSequenceW
  673. #else
  674. #define MsiSequence  MsiSequenceA
  675. #endif // !UNICODE
  676.  
  677. // Send an error record to the installer for processing.
  678. // If field 0 (template) is not set, field 1 must be set to the error code,
  679. //   corresponding the the error message in the Error database table,
  680. //   and the message will be formatted using the template from the Error table
  681. //   before passing it to the UI handler for display.
  682. // Returns Win32 button codes: IDOK IDCANCEL IDABORT IDRETRY IDIGNORE IDYES IDNO
  683. //   or 0 if no action taken, or -1 if invalid argument or handle
  684.  
  685. int WINAPI MsiProcessMessage(MSIHANDLE hInstall,
  686.     MSIMESSAGE eMessageType,    // type of message
  687.     MSIHANDLE hRecord);         // record containing message format and data
  688.  
  689. // Evaluate a conditional expression containing property names and values
  690.  
  691. MSICONDITION WINAPI MsiEvaluateConditionA(MSIHANDLE hInstall,
  692.     LPCSTR  szCondition);
  693. MSICONDITION WINAPI MsiEvaluateConditionW(MSIHANDLE hInstall,
  694.     LPCWSTR  szCondition);
  695. #ifdef UNICODE
  696. #define MsiEvaluateCondition  MsiEvaluateConditionW
  697. #else
  698. #define MsiEvaluateCondition  MsiEvaluateConditionA
  699. #endif // !UNICODE
  700.  
  701. // Get the installed state and requested action state of a feature
  702.  
  703. UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall,
  704.     LPCSTR     szFeature,     // feature name within product
  705.     INSTALLSTATE *piInstalled,  // returned current install state
  706.     INSTALLSTATE *piAction);    // action taken during install session
  707. UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall,
  708.     LPCWSTR     szFeature,     // feature name within product
  709.     INSTALLSTATE *piInstalled,  // returned current install state
  710.     INSTALLSTATE *piAction);    // action taken during install session
  711. #ifdef UNICODE
  712. #define MsiGetFeatureState  MsiGetFeatureStateW
  713. #else
  714. #define MsiGetFeatureState  MsiGetFeatureStateA
  715. #endif // !UNICODE
  716.  
  717. // Request a feature to be set to a specified state
  718.  
  719. UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall,
  720.     LPCSTR     szFeature,     // feature name within product
  721.     INSTALLSTATE iState);       // requested state for feature
  722. UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall,
  723.     LPCWSTR     szFeature,     // feature name within product
  724.     INSTALLSTATE iState);       // requested state for feature
  725. #ifdef UNICODE
  726. #define MsiSetFeatureState  MsiSetFeatureStateW
  727. #else
  728. #define MsiSetFeatureState  MsiSetFeatureStateA
  729. #endif // !UNICODE
  730.  
  731. // Get the installed state and requested action state of a component
  732.  
  733. UINT WINAPI MsiGetComponentStateA(MSIHANDLE hInstall,
  734.     LPCSTR     szComponent,   // component name within product
  735.     INSTALLSTATE *piInstalled,  // returned current install state
  736.     INSTALLSTATE *piAction);    // action taken during install session
  737. UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall,
  738.     LPCWSTR     szComponent,   // component name within product
  739.     INSTALLSTATE *piInstalled,  // returned current install state
  740.     INSTALLSTATE *piAction);    // action taken during install session
  741. #ifdef UNICODE
  742. #define MsiGetComponentState  MsiGetComponentStateW
  743. #else
  744. #define MsiGetComponentState  MsiGetComponentStateA
  745. #endif // !UNICODE
  746.  
  747. // Request a component to be set to a specified state
  748.  
  749. UINT WINAPI MsiSetComponentStateA(MSIHANDLE hInstall,
  750.     LPCSTR     szComponent,   // component name within product
  751.     INSTALLSTATE iState);       // requested state for component
  752. UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall,
  753.     LPCWSTR     szComponent,   // component name within product
  754.     INSTALLSTATE iState);       // requested state for component
  755. #ifdef UNICODE
  756. #define MsiSetComponentState  MsiSetComponentStateW
  757. #else
  758. #define MsiSetComponentState  MsiSetComponentStateA
  759. #endif // !UNICODE
  760.  
  761. // Return the disk cost for a feature and related features
  762. // Can specify either current feature state or proposed state
  763. // Can specify extent of related features to cost
  764. // Note that adding costs for several features may produce an
  765. // excessively large cost due to shared components and parents.
  766.  
  767. UINT  WINAPI MsiGetFeatureCostA(MSIHANDLE hInstall,
  768.     LPCSTR      szFeature,      // name of feature
  769.     MSICOSTTREE  iCostTree,     // portion of tree to cost
  770.     INSTALLSTATE iState,        // requested state, or INSTALLSTATE_UNKNOWN
  771.     INT          *piCost);      // returned cost, in units of 512 bytes
  772. UINT  WINAPI MsiGetFeatureCostW(MSIHANDLE hInstall,
  773.     LPCWSTR      szFeature,      // name of feature
  774.     MSICOSTTREE  iCostTree,     // portion of tree to cost
  775.     INSTALLSTATE iState,        // requested state, or INSTALLSTATE_UNKNOWN
  776.     INT          *piCost);      // returned cost, in units of 512 bytes
  777. #ifdef UNICODE
  778. #define MsiGetFeatureCost  MsiGetFeatureCostW
  779. #else
  780. #define MsiGetFeatureCost  MsiGetFeatureCostA
  781. #endif // !UNICODE
  782.  
  783. // Set the install level for a full product installation (not a feature request)
  784. // Setting the value to 0 initialized components and features to the default level
  785.  
  786. UINT  WINAPI MsiSetInstallLevel(MSIHANDLE hInstall,
  787.     int iInstallLevel);
  788.  
  789. // Get the valid install states for a feature
  790. // Returns INSTALLSTATE_DEFAULT if both INSTALLSTATE_LOCAL, INSTALLSTATE_SOURCE
  791.  
  792. UINT  WINAPI MsiGetFeatureValidStatesA(MSIHANDLE hInstall,
  793.     LPCSTR szFeature,
  794.     INSTALLSTATE *pInstallState);
  795. UINT  WINAPI MsiGetFeatureValidStatesW(MSIHANDLE hInstall,
  796.     LPCWSTR szFeature,
  797.     INSTALLSTATE *pInstallState);
  798. #ifdef UNICODE
  799. #define MsiGetFeatureValidStates  MsiGetFeatureValidStatesW
  800. #else
  801. #define MsiGetFeatureValidStates  MsiGetFeatureValidStatesA
  802. #endif // !UNICODE
  803.  
  804. // Return the full source path for a folder in the Directory table
  805.  
  806. UINT WINAPI MsiGetSourcePathA(MSIHANDLE hInstall,
  807.     LPCSTR     szFolder,       // folder identifier, primary key into Directory table
  808.     LPSTR      szPathBuf,      // buffer to return full path
  809.     DWORD       *pcchPathBuf);  // in/out buffer character count
  810. UINT WINAPI MsiGetSourcePathW(MSIHANDLE hInstall,
  811.     LPCWSTR     szFolder,       // folder identifier, primary key into Directory table
  812.     LPWSTR      szPathBuf,      // buffer to return full path
  813.     DWORD       *pcchPathBuf);  // in/out buffer character count
  814. #ifdef UNICODE
  815. #define MsiGetSourcePath  MsiGetSourcePathW
  816. #else
  817. #define MsiGetSourcePath  MsiGetSourcePathA
  818. #endif // !UNICODE
  819.  
  820. // Return the full target path for a folder in the Directory table
  821.  
  822. UINT WINAPI MsiGetTargetPathA(MSIHANDLE hInstall,
  823.     LPCSTR     szFolder,       // folder identifier, primary key into Directory table
  824.     LPSTR      szPathBuf,      // buffer to return full path
  825.     DWORD       *pcchPathBuf);  // in/out buffer character count
  826. UINT WINAPI MsiGetTargetPathW(MSIHANDLE hInstall,
  827.     LPCWSTR     szFolder,       // folder identifier, primary key into Directory table
  828.     LPWSTR      szPathBuf,      // buffer to return full path
  829.     DWORD       *pcchPathBuf);  // in/out buffer character count
  830. #ifdef UNICODE
  831. #define MsiGetTargetPath  MsiGetTargetPathW
  832. #else
  833. #define MsiGetTargetPath  MsiGetTargetPathA
  834. #endif // !UNICODE
  835.  
  836. // Set the full target path for a folder in the Directory table
  837.  
  838. UINT WINAPI MsiSetTargetPathA(MSIHANDLE hInstall,
  839.     LPCSTR     szFolder,       // folder identifier, primary key into Directory table
  840.     LPCSTR     szFolderPath);  // full path for folder, ending in directory separator
  841. UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall,
  842.     LPCWSTR     szFolder,       // folder identifier, primary key into Directory table
  843.     LPCWSTR     szFolderPath);  // full path for folder, ending in directory separator
  844. #ifdef UNICODE
  845. #define MsiSetTargetPath  MsiSetTargetPathW
  846. #else
  847. #define MsiSetTargetPath  MsiSetTargetPathA
  848. #endif // !UNICODE
  849.  
  850. // --------------------------------------------------------------------------
  851. // Functions for rendering UI dialogs from the database representations.
  852. // Purpose is for product development, not for use during installation.
  853. // --------------------------------------------------------------------------
  854.  
  855. // Enable UI in preview mode to facilitate authoring of UI dialogs.
  856. // The preview mode will end when the handle is closed.
  857.  
  858. UINT WINAPI MsiEnableUIPreview(MSIHANDLE hDatabase,
  859.     MSIHANDLE* phPreview);       // returned handle for UI preview capability
  860.  
  861. // Display any UI dialog as modeless and inactive.
  862. // Supplying a null name will remove any current dialog.
  863.  
  864. UINT WINAPI MsiPreviewDialogA(MSIHANDLE hPreview,
  865.     LPCSTR szDialogName);      // dialog to display, Dialog table key
  866. UINT WINAPI MsiPreviewDialogW(MSIHANDLE hPreview,
  867.     LPCWSTR szDialogName);      // dialog to display, Dialog table key
  868. #ifdef UNICODE
  869. #define MsiPreviewDialog  MsiPreviewDialogW
  870. #else
  871. #define MsiPreviewDialog  MsiPreviewDialogA
  872. #endif // !UNICODE
  873.  
  874. // Display a billboard within a host control in the displayed dialog.
  875. // Supplying a null billboard name will remove any billboard displayed.
  876.  
  877. UINT WINAPI MsiPreviewBillboardA(MSIHANDLE hPreview,
  878.     LPCSTR szControlName,      // name of control that accepts billboards
  879.     LPCSTR szBillboard);       // name of billboard to display
  880. UINT WINAPI MsiPreviewBillboardW(MSIHANDLE hPreview,
  881.     LPCWSTR szControlName,      // name of control that accepts billboards
  882.     LPCWSTR szBillboard);       // name of billboard to display
  883. #ifdef UNICODE
  884. #define MsiPreviewBillboard  MsiPreviewBillboardW
  885. #else
  886. #define MsiPreviewBillboard  MsiPreviewBillboardA
  887. #endif // !UNICODE
  888.  
  889. #ifdef __cplusplus
  890. }
  891. #endif
  892.  
  893. #endif // _MSIQUERY_H_
  894.