📄 msi.h
字号:
// Force the installed state for a product feature
UINT WINAPI MsiConfigureFeatureA(
LPCSTR szProduct,
LPCSTR szFeature,
INSTALLSTATE eInstallState); // local/source/default/absent/lock/uncache
UINT WINAPI MsiConfigureFeatureW(
LPCWSTR szProduct,
LPCWSTR szFeature,
INSTALLSTATE eInstallState); // local/source/default/absent/lock/uncache
#ifdef UNICODE
#define MsiConfigureFeature MsiConfigureFeatureW
#else
#define MsiConfigureFeature MsiConfigureFeatureA
#endif // !UNICODE
// Reinstall feature, used to validate or correct problems
UINT WINAPI MsiReinstallFeatureA(
LPCSTR szProduct, // product code
LPCSTR szFeature, // feature ID, NULL for entire product
DWORD dwReinstallMode); // one or more REINSTALLMODE modes
UINT WINAPI MsiReinstallFeatureW(
LPCWSTR szProduct, // product code
LPCWSTR szFeature, // feature ID, NULL for entire product
DWORD dwReinstallMode); // one or more REINSTALLMODE modes
#ifdef UNICODE
#define MsiReinstallFeature MsiReinstallFeatureW
#else
#define MsiReinstallFeature MsiReinstallFeatureA
#endif // !UNICODE
// --------------------------------------------------------------------------
// Functions to return a path to a particular component.
// The state of the feature being used should have been checked previously.
// --------------------------------------------------------------------------
// Return full component path, performing any necessary installation
// calls MsiQueryFeatureState to detect that all components are installed
// then calls MsiConfigureFeature if any of its components are uninstalled
// then calls MsiLocateComponent to obtain the path the its key file
UINT WINAPI MsiProvideComponentA(
LPCSTR szProduct, // product code in case install required
LPCSTR szFeature, // feature ID in case install required
LPCSTR szComponent, // component ID
DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
LPSTR lpPathBuf, // returned path, NULL if not desired
DWORD *pcchPathBuf);// in/out buffer character count
UINT WINAPI MsiProvideComponentW(
LPCWSTR szProduct, // product code in case install required
LPCWSTR szFeature, // feature ID in case install required
LPCWSTR szComponent, // component ID
DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
LPWSTR lpPathBuf, // returned path, NULL if not desired
DWORD *pcchPathBuf);// in/out buffer character count
#ifdef UNICODE
#define MsiProvideComponent MsiProvideComponentW
#else
#define MsiProvideComponent MsiProvideComponentA
#endif // !UNICODE
// For an advertised component that registers descriptor strings,
// return full component path, performing any necessary installation.
// Calls MsiProvideComponent to install and return the path.
UINT WINAPI MsiProvideQualifiedComponentA(
LPCSTR szCategory, // component category ID
LPCSTR szQualifier, // specifies which component to access
DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
LPSTR lpPathBuf, // returned path, NULL if not desired
DWORD *pcchPathBuf); // in/out buffer character count
UINT WINAPI MsiProvideQualifiedComponentW(
LPCWSTR szCategory, // component category ID
LPCWSTR szQualifier, // specifies which component to access
DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
LPWSTR lpPathBuf, // returned path, NULL if not desired
DWORD *pcchPathBuf); // in/out buffer character count
#ifdef UNICODE
#define MsiProvideQualifiedComponent MsiProvideQualifiedComponentW
#else
#define MsiProvideQualifiedComponent MsiProvideQualifiedComponentA
#endif // !UNICODE
// For an advertised component that registers descriptor strings,
// return full component path, performing any necessary installation.
// If the szProduct is NULL the works same as MsiProvideQualifiedComponent,
// else will look for the descriptor advertised by the particular product ONLY.
// Calls MsiProvideComponent to install and return the path.
UINT WINAPI MsiProvideQualifiedComponentExA(
LPCSTR szCategory, // component category ID
LPCSTR szQualifier, // specifies which component to access
DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
LPCSTR szProduct, // the product code
DWORD dwUnused1, // not used, must be zero
DWORD dwUnused2, // not used, must be zero
LPSTR lpPathBuf, // returned path, NULL if not desired
DWORD *pcchPathBuf); // in/out buffer character count
UINT WINAPI MsiProvideQualifiedComponentExW(
LPCWSTR szCategory, // component category ID
LPCWSTR szQualifier, // specifies which component to access
DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
LPCWSTR szProduct, // the product code
DWORD dwUnused1, // not used, must be zero
DWORD dwUnused2, // not used, must be zero
LPWSTR lpPathBuf, // returned path, NULL if not desired
DWORD *pcchPathBuf); // in/out buffer character count
#ifdef UNICODE
#define MsiProvideQualifiedComponentEx MsiProvideQualifiedComponentExW
#else
#define MsiProvideQualifiedComponentEx MsiProvideQualifiedComponentExA
#endif // !UNICODE
// Return full path to an installed component
INSTALLSTATE WINAPI MsiGetComponentPathA(
LPCSTR szProduct, // product code for client product
LPCSTR szComponent, // component Id, string GUID
LPSTR lpPathBuf, // returned path
DWORD *pcchBuf); // in/out buffer character count
INSTALLSTATE WINAPI MsiGetComponentPathW(
LPCWSTR szProduct, // product code for client product
LPCWSTR szComponent, // component Id, string GUID
LPWSTR lpPathBuf, // returned path
DWORD *pcchBuf); // in/out buffer character count
#ifdef UNICODE
#define MsiGetComponentPath MsiGetComponentPathW
#else
#define MsiGetComponentPath MsiGetComponentPathA
#endif // !UNICODE
// --------------------------------------------------------------------------
// Functions to iterate registered products, features, and components.
// 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
#if (_WIN32_MSI >= 110)
// Enumerate products with given upgrade code
UINT WINAPI MsiEnumRelatedProductsA(
LPCSTR lpUpgradeCode, // upgrade code of products to enumerate
DWORD dwReserved, // reserved, must be 0
DWORD iProductIndex, // 0-based index into registered products
LPSTR lpProductBuf); // buffer of char count: 39 (size of string GUID)
UINT WINAPI MsiEnumRelatedProductsW(
LPCWSTR lpUpgradeCode, // upgrade code of products to enumerate
DWORD dwReserved, // reserved, must be 0
DWORD iProductIndex, // 0-based index into registered products
LPWSTR lpProductBuf); // buffer of char count: 39 (size of string GUID)
#ifdef UNICODE
#define MsiEnumRelatedProducts MsiEnumRelatedProductsW
#else
#define MsiEnumRelatedProducts MsiEnumRelatedProductsA
#endif // !UNICODE
#endif //(_WIN32_MSI >= 110)
// 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 lpApplicationDataBuf, // description buffer
DWORD *pcchApplicationDataBuf); // 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 lpApplicationDataBuf, // description buffer
DWORD *pcchApplicationDataBuf); // 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, // path to package, or database handle: #nnnn
MSIHANDLE *hProduct); // returned product handle, must be closed
UINT WINAPI MsiOpenPackageW(
LPCWSTR szPackagePath, // path to package, or database handle: #nnnn
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -