Skip to content

Latest commit

 

History

History
155 lines (125 loc) · 4.7 KB

nf-msi-msiisproductelevateda.md

File metadata and controls

155 lines (125 loc) · 4.7 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:msi.MsiIsProductElevatedA
MsiIsProductElevatedA function (msi.h)
The MsiIsProductElevated function returns whether or not the product is managed. (ANSI)
MsiIsProductElevatedA
msi/MsiIsProductElevatedA
setup\msiisproductelevated.htm
setup
1bf6616c-3d5a-45c9-ab69-c0bb41b3e067
12/05/2018
MsiIsProductElevated, MsiIsProductElevated function, MsiIsProductElevatedA, MsiIsProductElevatedW, _msi_msiisproductelevated, msi/MsiIsProductElevated, msi/MsiIsProductElevatedA, msi/MsiIsProductElevatedW, setup.msiisproductelevated
msi.h
Windows
Windows Installer 5.0 on Windows Server 2012, Windows 8, 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 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
MsiIsProductElevatedW (Unicode) and MsiIsProductElevatedA (ANSI)
Msi.lib
Msi.dll
Windows
19H1
MsiIsProductElevatedA
msi/MsiIsProductElevatedA
c++
APIRef
kbSyntax
DllExport
Msi.dll
MsiIsProductElevated
MsiIsProductElevatedA
MsiIsProductElevatedW

MsiIsProductElevatedA function

-description

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.

-parameters

-param szProduct [in]

The full product code GUID of the product.

This parameter is required and cannot be NULL or empty.

-param pfElevated [out]

A pointer to a BOOL for the result.

This parameter cannot be NULL.

-returns

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
ERROR_UNKNOWN_PRODUCT
The product is not currently known.
ERROR_INVALID_PARAMETER
An invalid argument is passed to the function.
ERROR_BAD_CONFIGURATION
The configuration information for the product is invalid.
ERROR_FUNCTION_FAILED
The function failed.
ERROR_CALL_NOT_IMPLEMENTED
The function is not available for a specific platform.

-see-also

Determining Installation Context

Installing a Package with Elevated Privileges for a Non-Admin

-remarks

Note

The msi.h header defines MsiIsProductElevated as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.