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