The MsiIsProductElevated function returns whether or not the product is managed. Only applications that require elevated privileges for installation and being installed through advertisement are considered managed, which means that an application installed per-machine is always considered managed.
An application that is installed per-user is only considered managed if it is advertised by a local system process that is impersonating the user. For more information, see Advertising a Per-User Application to be Installed with Elevated Privileges.
MsiIsProductElevated verifies that the local system owns the product registry data. The function does not refer to account policies such as AlwaysInstallElevated.
Syntax
C++UINT MsiIsProductElevated(
__in LPCTSTR szProductCode,
__out BOOL *pfElevated
);
Parameters
- szProductCode [in]
-
The full product code GUID of the product.
This parameter is required and cannot be null or empty.
- pfElevated [out]
-
A pointer to a BOOL for the result.
This parameter cannot be null.
Return Value
If the function succeeds, the return value is ERROR_SUCCESS, and pfElevated is set to TRUE if the product is a managed application.
If the function fails, the return value is one of the error codes identified in the following table.
Return code | Description |
---|---|
|
The product is not currently known. |
|
An invalid argument is passed to the function. |
|
The configuration information for the product is invalid. |
|
The function failed. |
|
The function is not available for a specific platform. |
Requirements
Version | Windows Installer 5.0 on Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003, Windows XP, and Windows 2000. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version. |
---|---|
Header | Msi.h |
Library | Msi.lib |
DLL | Msi.dll |
Unicode and ANSI names | MsiIsProductElevatedW (Unicode) and MsiIsProductElevatedA (ANSI) |
See Also
Send comments about this topic to Microsoft
Build date: 8/13/2009
© 2009 Microsoft Corporation. All rights reserved.