📄 msi.h
字号:
// As with reg keys, they accept a 0-based index into the enumeration.
// --------------------------------------------------------------------------
// Enumerate the registered products, either installed or advertised
UINT WINAPI MsiEnumProductsA(
DWORD iProductIndex, // 0-based index into registered products
LPSTR lpProductBuf); // buffer of char count: 39 (size of string GUID)
UINT WINAPI MsiEnumProductsW(
DWORD iProductIndex, // 0-based index into registered products
LPWSTR lpProductBuf); // buffer of char count: 39 (size of string GUID)
#ifdef UNICODE
#define MsiEnumProducts MsiEnumProductsW
#else
#define MsiEnumProducts MsiEnumProductsA
#endif // !UNICODE
// Enumerate the advertised features for a given product.
// If parent is not required, supplying NULL will improve performance.
UINT WINAPI MsiEnumFeaturesA(
LPCSTR szProduct,
DWORD iFeatureIndex, // 0-based index into published features
LPSTR lpFeatureBuf, // feature name buffer, size=MAX_FEATURE_CHARS+1
LPSTR lpParentBuf); // parent feature buffer, size=MAX_FEATURE_CHARS+1
UINT WINAPI MsiEnumFeaturesW(
LPCWSTR szProduct,
DWORD iFeatureIndex, // 0-based index into published features
LPWSTR lpFeatureBuf, // feature name buffer, size=MAX_FEATURE_CHARS+1
LPWSTR lpParentBuf); // parent feature buffer, size=MAX_FEATURE_CHARS+1
#ifdef UNICODE
#define MsiEnumFeatures MsiEnumFeaturesW
#else
#define MsiEnumFeatures MsiEnumFeaturesA
#endif // !UNICODE
// Enumerate the installed components for all products
UINT WINAPI MsiEnumComponentsA(
DWORD iComponentIndex, // 0-based index into installed components
LPSTR lpComponentBuf); // buffer of char count: 39 (size of string GUID)
UINT WINAPI MsiEnumComponentsW(
DWORD iComponentIndex, // 0-based index into installed components
LPWSTR lpComponentBuf); // buffer of char count: 39 (size of string GUID)
#ifdef UNICODE
#define MsiEnumComponents MsiEnumComponentsW
#else
#define MsiEnumComponents MsiEnumComponentsA
#endif // !UNICODE
// Enumerate the client products for a component
UINT WINAPI MsiEnumClientsA(
LPCSTR szComponent,
DWORD iProductIndex, // 0-based index into client products
LPSTR lpProductBuf); // buffer of char count: 39 (size of string GUID)
UINT WINAPI MsiEnumClientsW(
LPCWSTR szComponent,
DWORD iProductIndex, // 0-based index into client products
LPWSTR lpProductBuf); // buffer of char count: 39 (size of string GUID)
#ifdef UNICODE
#define MsiEnumClients MsiEnumClientsW
#else
#define MsiEnumClients MsiEnumClientsA
#endif // !UNICODE
// Enumerate the qualifiers for an advertised component.
UINT WINAPI MsiEnumComponentQualifiersA(
LPCSTR szComponent, // generic component ID that is qualified
DWORD iIndex, // 0-based index into qualifiers
LPSTR lpQualifierBuf, // qualifier buffer
DWORD *pcchQualifierBuf, // in/out qualifier buffer character count
LPSTR lpDescriptionBuf, // description buffer
DWORD *pcchDescriptionBuf); // in/out description buffer character count
UINT WINAPI MsiEnumComponentQualifiersW(
LPCWSTR szComponent, // generic component ID that is qualified
DWORD iIndex, // 0-based index into qualifiers
LPWSTR lpQualifierBuf, // qualifier buffer
DWORD *pcchQualifierBuf, // in/out qualifier buffer character count
LPWSTR lpDescriptionBuf, // description buffer
DWORD *pcchDescriptionBuf); // in/out description buffer character count
#ifdef UNICODE
#define MsiEnumComponentQualifiers MsiEnumComponentQualifiersW
#else
#define MsiEnumComponentQualifiers MsiEnumComponentQualifiersA
#endif // !UNICODE
// --------------------------------------------------------------------------
// Functions to obtain product or package information.
// --------------------------------------------------------------------------
// Open the installation for a product to obtain detailed information
UINT WINAPI MsiOpenProductA(
LPCSTR szProduct, // product code OR descriptor
MSIHANDLE *hProduct); // returned product handle, must be closed
UINT WINAPI MsiOpenProductW(
LPCWSTR szProduct, // product code OR descriptor
MSIHANDLE *hProduct); // returned product handle, must be closed
#ifdef UNICODE
#define MsiOpenProduct MsiOpenProductW
#else
#define MsiOpenProduct MsiOpenProductA
#endif // !UNICODE
// Open a product package in order to access product properties
UINT WINAPI MsiOpenPackageA(
LPCSTR szPackagePath, // location of package
MSIHANDLE *hProduct); // returned product handle, must be closed
UINT WINAPI MsiOpenPackageW(
LPCWSTR szPackagePath, // location of package
MSIHANDLE *hProduct); // returned product handle, must be closed
#ifdef UNICODE
#define MsiOpenPackage MsiOpenPackageW
#else
#define MsiOpenPackage MsiOpenPackageA
#endif // !UNICODE
// Provide the value for an installation property.
UINT WINAPI MsiGetProductPropertyA(
MSIHANDLE hProduct, // product handle obtained from MsiOpenProduct
LPCSTR szProperty, // property name, case-sensitive
LPSTR lpValueBuf, // returned value, NULL if not desired
DWORD *pcchValueBuf); // in/out buffer character count
UINT WINAPI MsiGetProductPropertyW(
MSIHANDLE hProduct, // product handle obtained from MsiOpenProduct
LPCWSTR szProperty, // property name, case-sensitive
LPWSTR lpValueBuf, // returned value, NULL if not desired
DWORD *pcchValueBuf); // in/out buffer character count
#ifdef UNICODE
#define MsiGetProductProperty MsiGetProductPropertyW
#else
#define MsiGetProductProperty MsiGetProductPropertyA
#endif // !UNICODE
// Determine whether a file is a package
// Returns ERROR_SUCCESS if file is a package.
UINT WINAPI MsiVerifyPackageA(
LPCSTR szPackagePath); // location of package
UINT WINAPI MsiVerifyPackageW(
LPCWSTR szPackagePath); // location of package
#ifdef UNICODE
#define MsiVerifyPackage MsiVerifyPackageW
#else
#define MsiVerifyPackage MsiVerifyPackageA
#endif // !UNICODE
// Provide descriptive information for product feature: title and description.
// Returns the install level for the feature, or -1 if feature is unknown.
// 0 = feature is not available on this machine
// 1 = highest priority, feature installed if parent is installed
// >1 = decreasing priority, feature installation based on InstallLevel property
UINT WINAPI MsiGetFeatureInfoA(
MSIHANDLE hProduct, // product handle obtained from MsiOpenProduct
LPCSTR szFeature, // feature name
DWORD *lpAttributes, // attribute flags for the feature <to be defined>
LPSTR lpTitleBuf, // returned localized name, NULL if not desired
DWORD *pcchTitleBuf, // in/out buffer character count
LPSTR lpHelpBuf, // returned description, NULL if not desired
DWORD *pcchHelpBuf); // in/out buffer character count
UINT WINAPI MsiGetFeatureInfoW(
MSIHANDLE hProduct, // product handle obtained from MsiOpenProduct
LPCWSTR szFeature, // feature name
DWORD *lpAttributes, // attribute flags for the feature <to be defined>
LPWSTR lpTitleBuf, // returned localized name, NULL if not desired
DWORD *pcchTitleBuf, // in/out buffer character count
LPWSTR lpHelpBuf, // returned description, NULL if not desired
DWORD *pcchHelpBuf); // in/out buffer character count
#ifdef UNICODE
#define MsiGetFeatureInfo MsiGetFeatureInfoW
#else
#define MsiGetFeatureInfo MsiGetFeatureInfoA
#endif // !UNICODE
// --------------------------------------------------------------------------
// Functions to install missing components and files. These should be used
// as a last resort.
// --------------------------------------------------------------------------
// Install a component unexpectedly missing, provided only for error recovery
// This would typically occur due to failue to establish feature availability
// The product feature having the smallest incremental cost is installed
UINT WINAPI MsiInstallMissingComponentA(
LPCSTR szProduct, // product code
LPCSTR szComponent, // component Id, string GUID
INSTALLSTATE eInstallState); // local/source/default, absent invalid
UINT WINAPI MsiInstallMissingComponentW(
LPCWSTR szProduct, // product code
LPCWSTR szComponent, // component Id, string GUID
INSTALLSTATE eInstallState); // local/source/default, absent invalid
#ifdef UNICODE
#define MsiInstallMissingComponent MsiInstallMissingComponentW
#else
#define MsiInstallMissingComponent MsiInstallMissingComponentA
#endif // !UNICODE
// Install a file unexpectedly missing, provided only for error recovery
// This would typically occur due to failue to establish feature availability
// The missing component is determined from the product's File table, then
// the product feature having the smallest incremental cost is installed
UINT WINAPI MsiInstallMissingFileA(
LPCSTR szProduct, // product code
LPCSTR szFile); // file name, without path
UINT WINAPI MsiInstallMissingFileW(
LPCWSTR szProduct, // product code
LPCWSTR szFile); // file name, without path
#ifdef UNICODE
#define MsiInstallMissingFile MsiInstallMissingFileW
#else
#define MsiInstallMissingFile MsiInstallMissingFileA
#endif // !UNICODE
#ifdef __cplusplus
}
#endif
// --------------------------------------------------------------------------
// Error codes for installer access functions - until merged to winerr.h
// --------------------------------------------------------------------------
#ifndef ERROR_INSTALL_FAILURE
#define ERROR_INSTALL_USEREXIT 1602L // User cancel installation.
#define ERROR_INSTALL_FAILURE 1603L // Fatal error during installation.
#define ERROR_INSTALL_SUSPEND 1604L // Installation suspended, incomplete.
#define ERROR_UNKNOWN_PRODUCT 1605L // Product code not registered.
#define ERROR_UNKNOWN_FEATURE 1606L // Feature ID not registered.
#define ERROR_UNKNOWN_COMPONENT 1607L // Component ID not registered.
#define ERROR_UNKNOWN_PROPERTY 1608L // Unknown property.
#define ERROR_INVALID_HANDLE_STATE 1609L // Handle is in an invalid state.
#define ERROR_BAD_CONFIGURATION 1610L // Configuration data corrupt.
#define ERROR_INDEX_ABSENT 1611L // Component qualifier not present.
#define ERROR_INSTALL_SOURCE_ABSENT 1612L // Install source unavailable.
#define ERROR_PRODUCT_UNINSTALLED 1614L // Product is uninstalled.
#define ERROR_BAD_QUERY_SYNTAX 1615L // SQL query syntax invalid or unsupported.
#define ERROR_INVALID_FIELD 1616L // Record field does not exist.
#endif
#ifndef ERROR_INSTALL_STARTING
#define ERROR_INSTALL_STARTING 1600L // Preparing to install...
#define ERROR_INSTALL_SERVICE_FAILURE 1601L // Failure accessing installation service.
#define ERROR_INSTALL_PACKAGE_VERSION 1613L // Database version unsupported.
#define ERROR_INVALID_COMMAND_LINE 1617L // Invalid command line argument.
#define ERROR_INSTALL_ALREADY_RUNNING 1618L // An installation is in progress.
#define ERROR_INSTALL_PACKAGE_OPEN_FAILED 1619L // Installation package could not be opened.
#define ERROR_INSTALL_PACKAGE_INVALID 1620L // Installation package invalid.
#define ERROR_INSTALL_UI_FAILURE 1621L // Could not initialize installer user interface.
#define ERROR_INSTALL_LOG_FAILURE 1622L // Error opening installation log file.
#define ERROR_INSTALL_LANGUAGE_UNSUPPORTED 1623L // Product language not supported by system.
#define ERROR_INSTALL_TRANFORM_FAILURE 1624L // Error applying transform to install package.
#define ERROR_INSTALL_PACKAGE_REJECTED 1625L // Install package signature not accepted.
#define ERROR_FUNCTION_NOT_CALLED 1626L // Function could not be executed.
#define ERROR_FUNCTION_FAILED 1627L // Function failed during execution.
#define ERROR_INVALID_TABLE 1628L // Invalid or unknown table specified.
#define ERROR_DATATYPE_MISMATCH 1629L // Data supplied is of wrong type.
#define ERROR_UNSUPPORTED_TYPE 1630L // Data of this type is not supported.
#define ERROR_CREATE_FAILED 1631L // Data of this type is not supported.
#endif
#ifndef ERROR_INSTALL_TEMP_UNWRITABLE
#define ERROR_INSTALL_TEMP_UNWRITABLE 1632L // Temp folder is full or inaccessible
#endif
#endif // _MSI_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -