📄 jwamsiquery.pas
字号:
{$IFDEF UNICODE}
function MsiDatabaseImport(hDatabase: MSIHANDLE; szFolderPath: LPCWSTR;
szFileName: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseImport}
{$ELSE}
function MsiDatabaseImport(hDatabase: MSIHANDLE; szFolderPath: LPCSTR;
szFileName: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseImport}
{$ENDIF}
// Export an MSI table from an open database to a text archive file
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
function MsiDatabaseExportA(hDatabase: MSIHANDLE; szTableName: LPCSTR;
szFolderPath: LPCSTR; szFileName: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseExportA}
function MsiDatabaseExportW(hDatabase: MSIHANDLE; szTableName: LPCWSTR;
szFolderPath: LPCWSTR; szFileName: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseExportW}
{$IFDEF UNICODE}
function MsiDatabaseExport(hDatabase: MSIHANDLE; szTableName: LPCWSTR;
szFolderPath: LPCWSTR; szFileName: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseExport}
{$ELSE}
function MsiDatabaseExport(hDatabase: MSIHANDLE; szTableName: LPCSTR;
szFolderPath: LPCSTR; szFileName: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseExport}
{$ENDIF}
// Merge two database together, allowing duplicate rows
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
function MsiDatabaseMergeA(hDatabase: MSIHANDLE; hDatabaseMerge: MSIHANDLE;
szTableName: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseMergeA}
function MsiDatabaseMergeW(hDatabase: MSIHANDLE; hDatabaseMerge: MSIHANDLE;
szTableName: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseMergeW}
{$IFDEF UNICODE}
function MsiDatabaseMerge(hDatabase: MSIHANDLE; hDatabaseMerge: MSIHANDLE;
szTableName: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseMerge}
{$ELSE}
function MsiDatabaseMerge(hDatabase: MSIHANDLE; hDatabaseMerge: MSIHANDLE;
szTableName: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseMerge}
{$ENDIF}
// Generate a transform file of differences between two databases
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
function MsiDatabaseGenerateTransformA(hDatabase: MSIHANDLE; hDatabaseReference: MSIHANDLE;
szTransformFile: LPCSTR; iReserved1: Integer; iReserved2: Integer): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseGenerateTransformA}
function MsiDatabaseGenerateTransformW(hDatabase: MSIHANDLE; hDatabaseReference: MSIHANDLE;
szTransformFile: LPCWSTR; iReserved1: Integer; iReserved2: Integer): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseGenerateTransformW}
{$IFDEF UNICODE}
function MsiDatabaseGenerateTransform(hDatabase: MSIHANDLE; hDatabaseReference: MSIHANDLE;
szTransformFile: LPCWSTR; iReserved1: Integer; iReserved2: Integer): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseGenerateTransform}
{$ELSE}
function MsiDatabaseGenerateTransform(hDatabase: MSIHANDLE; hDatabaseReference: MSIHANDLE;
szTransformFile: LPCSTR; iReserved1: Integer; iReserved2: Integer): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseGenerateTransform}
{$ENDIF}
// Apply a transform file containing database difference
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
function MsiDatabaseApplyTransformA(hDatabase: MSIHANDLE; szTransformFile: LPCSTR;
iErrorConditions: Integer): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseApplyTransformA}
function MsiDatabaseApplyTransformW(hDatabase: MSIHANDLE; szTransformFile: LPCWSTR;
iErrorConditions: Integer): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseApplyTransformW}
{$IFDEF UNICODE}
function MsiDatabaseApplyTransform(hDatabase: MSIHANDLE; szTransformFile: LPCWSTR;
iErrorConditions: Integer): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseApplyTransform}
{$ELSE}
function MsiDatabaseApplyTransform(hDatabase: MSIHANDLE; szTransformFile: LPCSTR;
iErrorConditions: Integer): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseApplyTransform}
{$ENDIF}
// Create summary information of existing transform to include validation and error conditions
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
function MsiCreateTransformSummaryInfoA(hDatabase: MSIHANDLE; hDatabaseReference: MSIHANDLE;
szTransformFile: LPCSTR; iErrorConditions: Integer; iValidation: Integer): UINT; stdcall;
{$EXTERNALSYM MsiCreateTransformSummaryInfoA}
function MsiCreateTransformSummaryInfoW(hDatabase: MSIHANDLE; hDatabaseReference: MSIHANDLE;
szTransformFile: LPCWSTR; iErrorConditions: Integer; iValidation: Integer): UINT; stdcall;
{$EXTERNALSYM MsiCreateTransformSummaryInfoW}
{$IFDEF UNICODE}
function MsiCreateTransformSummaryInfo(hDatabase: MSIHANDLE; hDatabaseReference: MSIHANDLE;
szTransformFile: LPCWSTR; iErrorConditions: Integer; iValidation: Integer): UINT; stdcall;
{$EXTERNALSYM MsiCreateTransformSummaryInfo}
{$ELSE}
function MsiCreateTransformSummaryInfo(hDatabase: MSIHANDLE; hDatabaseReference: MSIHANDLE;
szTransformFile: LPCSTR; iErrorConditions: Integer; iValidation: Integer): UINT; stdcall;
{$EXTERNALSYM MsiCreateTransformSummaryInfo}
{$ENDIF}
// Write out all persistent table data, ignored if database opened read-only
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
function MsiDatabaseCommit(hDatabase: MSIHANDLE): UINT; stdcall;
{$EXTERNALSYM MsiDatabaseCommit}
// Return the update state of a database
function MsiGetDatabaseState(hDatabase: MSIHANDLE): MSIDBSTATE; stdcall;
{$EXTERNALSYM MsiGetDatabaseState}
// --------------------------------------------------------------------------
// Record object functions
// --------------------------------------------------------------------------
// Create a new record object with the requested number of fields
// Field 0, not included in count, is used for format strings and op codes
// All fields are initialized to null
// Returns a handle to the created record, or 0 if memory could not be allocated
function MsiCreateRecord(cParams: UINT): MSIHANDLE; stdcall;
{$EXTERNALSYM MsiCreateRecord}
// Report whether a record field is NULL
// Returns TRUE if the field is null or does not exist
// Returns FALSE if the field contains data, or the handle is invalid
function MsiRecordIsNull(hRecord: MSIHANDLE; iField: UINT): BOOL; stdcall;
{$EXTERNALSYM MsiRecordIsNull}
// Return the length of a record field
// Returns 0 if field is NULL or non-existent
// Returns sizeof(Integer) if integer data
// Returns character count if string data (not counting null terminator)
// Returns bytes count if stream data
function MsiRecordDataSize(hRecord: MSIHANDLE; iField: UINT): UINT; stdcall;
{$EXTERNALSYM MsiRecordDataSize}
// Set a record field to an integer value
// Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_FIELD
function MsiRecordSetInteger(hRecord: MSIHANDLE; iField: UINT; iValue: Integer): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetInteger}
// Copy a string into the designated field
// A null string pointer and an empty string both set the field to null
// Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_FIELD
function MsiRecordSetStringA(hRecord: MSIHANDLE; iField: UINT; szValue: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetStringA}
function MsiRecordSetStringW(hRecord: MSIHANDLE; iField: UINT; szValue: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetStringW}
{$IFDEF UNICODE}
function MsiRecordSetString(hRecord: MSIHANDLE; iField: UINT; szValue: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetString}
{$ELSE}
function MsiRecordSetString(hRecord: MSIHANDLE; iField: UINT; szValue: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetString}
{$ENDIF}
// Return the integer value from a record field
// Returns the value MSI_NULL_INTEGER if the field is null
// or if the field is a string that cannot be converted to an integer
function MsiRecordGetInteger(hRecord: MSIHANDLE; iField: UINT): Integer; stdcall;
{$EXTERNALSYM MsiRecordGetInteger}
// Return the string value of a record field
// Integer fields will be converted to a string
// Null and non-existent fields will report a value of 0
// Fields containing stream data will return ERROR_INVALID_DATATYPE
// Returns ERROR_SUCCESS, ERROR_MORE_DATA,
// ERROR_INVALID_HANDLE, ERROR_INVALID_FIELD, ERROR_BAD_ARGUMENTS
function MsiRecordGetStringA(hRecord: MSIHANDLE; iField: UINT; szValueBuf: LPSTR;
var pcchValueBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiRecordGetStringA}
function MsiRecordGetStringW(hRecord: MSIHANDLE; iField: UINT; szValueBuf: LPWSTR;
var pcchValueBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiRecordGetStringW}
{$IFDEF UNICODE}
function MsiRecordGetString(hRecord: MSIHANDLE; iField: UINT; szValueBuf: LPWSTR;
var pcchValueBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiRecordGetString}
{$ELSE}
function MsiRecordGetString(hRecord: MSIHANDLE; iField: UINT; szValueBuf: LPSTR;
var pcchValueBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiRecordGetString}
{$ENDIF}
// Returns the number of fields allocated in the record
// Does not count field 0, used for formatting and op codes
function MsiRecordGetFieldCount(hRecord: MSIHANDLE): UINT; stdcall;
{$EXTERNALSYM MsiRecordGetFieldCount}
// Set a record stream field from a file
// The contents of the specified file will be read into a stream object
// The stream will be persisted if the record is inserted into the database
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
function MsiRecordSetStreamA(hRecord: MSIHANDLE; iField: UINT; szFilePath: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetStreamA}
function MsiRecordSetStreamW(hRecord: MSIHANDLE; iField: UINT; szFilePath: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetStreamW}
{$IFDEF UNICODE}
function MsiRecordSetStream(hRecord: MSIHANDLE; iField: UINT; szFilePath: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetStream}
{$ELSE}
function MsiRecordSetStream(hRecord: MSIHANDLE; iField: UINT; szFilePath: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiRecordSetStream}
{$ENDIF}
// Read bytes from a record stream field into a buffer
// Must set the in/out argument to the requested byte count to read
// The number of bytes transferred is returned through the argument
// If no more bytes are available, ERROR_SUCCESS is still returned
function MsiRecordReadStream(hRecord: MSIHANDLE; iField: UINT; szDataBuf: PChar;
var pcbDataBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiRecordReadStream}
// Clears all data fields in a record to NULL
function MsiRecordClearData(hRecord: MSIHANDLE): UINT; stdcall;
{$EXTERNALSYM MsiRecordClearData}
// --------------------------------------------------------------------------
// Functions to access a running installation, called from custom actions
// The install handle is the single argument passed to custom actions
// --------------------------------------------------------------------------
// Return a handle to the database currently in use by this installer instance
function MsiGetActiveDatabase(hInstall: MSIHANDLE): MSIHANDLE; stdcall;
{$EXTERNALSYM MsiGetActiveDatabase}
// Set the value for an installer property
// If the property is not defined, it will be created
// If the value is null or an empty string, the property will be removed
// Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_BAD_ARGUMENTS
function MsiSetPropertyA(hInstall: MSIHANDLE; szName: LPCSTR; szValue: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiSetPropertyA}
function MsiSetPropertyW(hInstall: MSIHANDLE; szName: LPCWSTR; szValue: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiSetPropertyW}
{$IFDEF UNICODE}
function MsiSetProperty(hInstall: MSIHANDLE; szName: LPCWSTR; szValue: LPCWSTR): UINT; stdcall;
{$EXTERNALSYM MsiSetProperty}
{$ELSE}
function MsiSetProperty(hInstall: MSIHANDLE; szName: LPCSTR; szValue: LPCSTR): UINT; stdcall;
{$EXTERNALSYM MsiSetProperty}
{$ENDIF}
// Get the value for an installer property
// If the property is not defined, it is equivalent to a 0-length value, not error
// Returns ERROR_SUCCESS, ERROR_MORE_DATA, ERROR_INVALID_HANDLE, ERROR_BAD_ARGUMENTS
function MsiGetPropertyA(hInstall: MSIHANDLE; szName: LPCSTR; szValueBuf: LPSTR;
var pcchValueBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiGetPropertyA}
function MsiGetPropertyW(hInstall: MSIHANDLE; szName: LPCWSTR; szValueBuf: LPWSTR;
var pcchValueBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiGetPropertyW}
{$IFDEF UNICODE}
function MsiGetProperty(hInstall: MSIHANDLE; szName: LPCWSTR; szValueBuf: LPWSTR;
var pcchValueBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiGetProperty}
{$ELSE}
function MsiGetProperty(hInstall: MSIHANDLE; szName: LPCSTR; szValueBuf: LPSTR;
var pcchValueBuf: DWORD): UINT; stdcall;
{$EXTERNALSYM MsiGetProperty}
{$ENDIF}
// Return the numeric language for the currently running install
// Returns 0 if an install not running
function MsiGetLanguage(hInstall: MSIHANDLE): LANGID; stdcall;
{$EXTERNALSYM MsiGetLanguage}
// Return one of the boolean internal installer states
// Returns FALSE if the handle is not active or if the mode is not implemented
function MsiGetMode(hInstall: MSIHANDLE; eRunMode: MSIRUNMODE): BOOL; stdcall;
{$EXTERNALSYM MsiGetMode}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -