Installs an exception package.
Syntax
void InstallComponentW(
_In_ LPCWSTR InfPath,
_In_opt_ const GUID *CompGuid,
_In_ DWORD Flags,
_In_opt_ INT VerMajor,
_In_opt_ INT VerMinor,
_In_opt_ INT VerBuild,
_In_opt_ INT VerQFE,
_In_opt_ LPCWSTR Name
);
Parameters
InfPath [in]
The path to the exception INF to process.
CompGuid [in, optional]
The GUID of the exception component being installed.
Flags [in]
The flags used to control installation behaviors. This parameter can be a combination of the following values.
| Value | Meaning |
|---|---|
| COMP_FLAGS_FORCE 0x00000020 | Skips the version check on file replacements. |
| COMP_FLAGS_NEEDS_UNINSTALL | Back up files that are updated to be used by an uninstall of the component. |
| COMP_FLAGS_NO_OVERWRITE | Skips backing up files if the Exception component version is the same as an installed component. This flag is used in a reinstallation scenario. |
| COMP_FLAGS_NOUI 0x00000002 | Suppresses all UI. |
| COMP_FLAGS_UPDATE_DLLCACHE | Forces the DLLCACHE directory to be updated when a system file is updated. |
| COMP_FLAGS_USE_SVCPACK_CACHE | Uses files cached by a Windows service pack install to supersede files backed up. |
VerMajor [in, optional]
The major version of the Exception component.
VerMinor [in, optional]
The minor version of the Exception component.
VerBuild [in, optional]
The build version of the Exception component.
VerQFE [in, optional]
The hotfix revision of the Exception component.
Name [in, optional]
The descriptive string of the component shown by the Windows File Protection dialog box if the operating system detects that a Windows File Protection protect file is damaged, tampered with, or corrupted.
Return value
This function returns an HRESULT value (S_OK or a failure code). A failure code can be checked against a value of 0x20000100 to determine whether the failure is because a reboot is required.
Remarks
Exception packages are Windows system files that are released outside of a full package Windows release and that update operating-system files. Exception packages are authored only by operating-system teams that have been granted authorization to update Windows system files.
To install and uninstall files that are not protected by Windows File Protection, use the functions documented in General Setup Functions. To install device drivers, venders should use functions documented in Device Installation Functions and PnP Configuration Manager Functions.
This function has no associated import library or header file; you must call it by using the LoadLibrary and GetProcAddress functions.
Requirements
| Requirement | Value |
|---|---|
| DLL | Msoobci.dll |
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
