InstallMissingPatches
Will install the specified patches or packages identified in the most recent GetMissingPatches call.
Syntax
Method ID
#define WAAPI_MID_INSTALL_MISSING_PATCHES 1014
JSON Input Structure
{
"input": {
"method": 1014,
"signature": number,
"threads": number,
"install_from_cache": boolean,
"retry_internet_services": boolean,
"username": string,
"password": string,
"patches": [
{
"title": string,
"product": string,
"vendor": string,
"version": string
},
...
],
"mode": number,
"restart_action": number,
"auto_repair": string
}
}
Input Properties
| Parameter | Type | Description |
|---|---|---|
threads | number | (optional) The number of threads using to download patches, equal to number of patches can be downloaded at the same time. Default value = 4. |
install_from_cache | boolean | (optional) An array of missing patches or packages to be installed. Indicates if this method will use cache that was downloaded by DownloadMissingPatches or it will get patches/packages from the internet. Default is false. |
retry_internet_services | boolean | (optional) (Windows Update Agent only) If true, will retry with the internet services when failed with managed servers (if they are configured, such as WSUS, Configuration Server). Default value is true |
username | string | (optional) Username for patch installation authentication. |
password | string | (optional) The password that the product requires to install the patch. When used with a username parameter, this represents the specified user's password. When used without a username, this represents the current user's password. |
patches | array<object> | An array of missing patches or packages to be installed. |
patches.title | string | The title of a missing patch or package. This value should be retrieved from the GetMissingPatches method response. |
patches.product | string | The product a missing patch or the package will be installed for, this value should be obtained from the return of GetMissingPatches. |
patches.vendor | string | (optional) The vendor of the product a missing patch or package vendor will be installed for, this value should be obtained from the return of GetMissingPatches. |
patches.version | string | (optional) (Linux only) (Linux only) Allows installation of a specific patch or package version. If no version is specified, the latest available version will be installed. More info about the install specific version can be found at How do I install specific patch versions with InstallMissingPatches on Linux?. |
mode | number | (optional) (Dandified Yum only) 0: Base settings for Dandified Yum on all supported Linux distro. 1: Advanced settings for Dandified Yum on Amazon Linux 2023. Default value is 0. |
restart_action | number | (optional) (macOS - Software Update only) 0: Automatically restart - The update will download automatically. If necessary, your Mac will restart to begin installing the new macOS patches and may restart multiple times during the installation process. 1: No restart - The update will not automatically restart macOS. It will only download the patches and wait for the user to click the 'Restart Now' option in the Software Update UI. Default value is 0. More info about the restart action can be found at How to use input.restart_action when executing InstallMissingPatches with macOS Software Update?. |
auto_repair | string | (optional) (Advanced Packaging Tool only) Controls whether the SDK attempts to automatically repair a broken package manager state before installing. Default value is 'none'. If a broken state is detected: • none: Do not repair. Return WAAPI_ERROR_BROKEN_PACKAGE_MANAGER immediately. • auto: Attempt to repair the package manager state. If the repair succeeds, installation proceeds. If the repair fails, return WAAPI_ERROR_BROKEN_PACKAGE_MANAGER. Note: Repair operations may modify machine state beyond the requested installation, including removing packages to resolve dependency conflicts. |
JSON Output Structure
{
"result": {
"method": 1014,
"code": number,
"timing": number,
"timestamp": string,
"patches": [
{
"title": string,
"product": string,
"vendor": string,
"state": string,
"reboot_required": boolean,
"version": string,
"return_code": number,
"dependencies": [
{
"name": string,
"status": string,
"expected_version": string,
"installed_version": string
},
...
],
"code": string
},
...
],
"patches_source": string
}
}
Output Properties
| Property | Type | Description |
|---|---|---|
result.method | number | The method ID that generated this result. |
result.code | number | The result code. See Result Codes. |
result.timing | number | The measured time for the method call in milliseconds. |
result.timestamp | string | The timestamp in seconds of when the call was made. |
result.patches | array<object> | (optional) An array of missing patches or packages that are input by the user. |
result.patches.title | string | The title of a patch or package. |
result.patches.product | string | The product of this patch or package name. |
result.patches.vendor | string | (optional) The vendor of the product a missing patch or package. Only available if user input it in json_in. |
result.patches.state | string | The state of a patch or package after this method completed. It can be: • not_found: if the patch or package was not found in the result of GetMissingPatches.• not_found_in_cache: if this patch or package was not found in cache downloaded by DownloadMissingPatches, only available when install_from_cache = true.• download_failed: if the patch or package failed during the download phase. • cache_failed: if the patch or package was found in OESIS Framework cache but cannot be used for installation. • install_failed: patch or package was downloaded successfully but installation failed. • installed: patch or package was installed successfully. • canceled: the request was canceled by CancelAsyncRequest before this patch or package was installed. |
result.patches.reboot_required | boolean | (optional) True if this patch requires a 'reboot' to complete the installation phase, false if it does not. Present only when the patch manager reported a reboot state, so an absent field means no state was observed - typically because the installation did not complete - and is not equivalent to false. (Windows only: It should be 'Update and Restart' if available) |
result.patches.version | string | (optional) The version of the patch or package that was installed successfully. |
result.patches.return_code | number | (optional) A specific code that provides detailed context about the underlying reason for the general state. This allows clients to programmatically distinguish between different conditions within the same state. For example, when the state is download_failed or install_failed, the return_code helps identify whether the failure was due to internet connectivity issues, dependency problems, or other specific causes. |
result.patches.dependencies | array<object> | (optional) (Linux only) The package dependencies required for installation. |
result.patches.dependencies.name | string | (optional) (Linux only) The dependency name. |
result.patches.dependencies.status | string | (optional) (Linux only) The package dependencies status required for installation. Possible values are: installed, resolved, removed, install_failed, or unknown• installed: Indicates this dependency package has been installed successfully. • resolved: Indicates that the installed version of this dependency package already meets the main package's requirements. No update is required. • removed: Indicates that the dependency package has been removed after installation. • install_failed: Indicates this dependency package failed to install. • unknown: Unable to indicates the dependencies status.. |
result.patches.dependencies.expected_version | string | (optional) (Linux only) The package dependency version expected to match requirement. It may include the conditions and version of the package. For example: >= 2.4.1op1-1ubuntu4.10 |
result.patches.dependencies.installed_version | string | (optional) (Linux only) The package dependencies installed version. |
result.patches.code | string | (optional) (Windows Update Agent only) An HRESULT error code returned from a Win32 COM API call, represented as a hexadecimal string (e.g., 0x80004005), indicating the success or failure of the installation process. |
result.patches_source | string | (optional) (Windows Update Agent only) The source supplying patches: 'Windows Update', 'Microsoft Update', 'WSUS or Configuration Manager', 'Unknown', or the file path to the wsusscn2.cab in case WUA works in offline mode |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | The operation completed successfully. |
| 3 | WAAPI_PARTIAL_SUCCESS | Partial success - some patches were installed successfully while others failed. Check individual patch states in the result. |
| 10 | WAAPI_OK_RESTART_TO_ENABLE | Restart is required to enable the installed patches. |
| -1 | WAAPI_ERROR_GENERAL | General error that is not yet defined. |
| -11 | WAAPI_ERROR_COMPONENT_METHOD_NOT_SUPPORTED | (macOS only) The input.restart_action parameter is not supported on Intel devices. |
| -17 | WAAPI_ERROR_NO_CONNECTION | No internet connectivity to online host to install the update. |
| -19 | WAAPI_ERROR_INVALID_CREDENTIALS | Incorrect authentication information provided to install missing patches. |
| -20 | WAAPI_ERROR_INVALID_INPUT_ARGS | Required patches information is missing or incorrect, or the input parameters do not match the method's documented requirements. |
| -22 | WAAPI_ERROR_ACCESS_DENIED | Administrator permission (sudo) is required to install patches. |
| -24 | WAAPI_ERROR_NOT_RUNNING | The package manager service is not running, causing the patch installation to fail. |
| -27 | WAAPI_ERROR_NATIVE_API | Problem with the native API used to install missing patches. |
| -28 | WAAPI_ERROR_NOT_FOUND | The patch(es) to install were not found and installation cannot continue. |
| -49 | WAAPI_ERROR_THREAD_TIMEOUT | Timeout reached during patch installation. Retry or reinstall the patches. |
| -60 | WAAPI_ERROR_3RD_PARTY_HOST_CONNECTION_NOT_ESTABLISHED | (Windows Update Agent only) Unable to start the wa_3rd_party_host process to install missing patches. |
| -64 | WAAPI_ERROR_PASSWORD_REQUIRED | (macOS only) Password not provided when installing on Apple Silicon chip or T1/T2 chip. |
| -70 | WAAPI_ERROR_RESOURCE_BUSY | (Linux only) The system is busy (e.g., another process is using the package manager). See troubleshooting guide. |
| -81 | WAAPI_ERROR_MISSING_PACKAGE_DEPENDENCIES | (Linux only) Dependency packages cannot be upgraded, causing the installation to fail. |
| -82 | WAAPI_ERROR_PACKAGE_ON_HOLD | (Linux only) Package is on hold by the user and cannot be upgraded. |
| -87 | WAAPI_ERROR_PATCH_TITLE_NOT_FOUND | (macOS only) No such update found or incorrect patch title provided. |
Other codes may be returned. See the full Result Codes reference for the complete list.
Remarks
Error Handling
The results of this function are determined by the error code returned by the call. If successful, WAAPI_OK or a special success code will be returned. Always check both the function return value and the result.code field in the output JSON.
Linux Resource Busy
(Linux only) If the system is busy, WAAPI_ERROR_RESOURCE_BUSY will be returned. This is a generic error code that can occur in multiple scenarios.
For example, the apt package manager may return this error if another process is already using apt (e.g., unattended-upgr). You can find instructions to resolve this issue at resolve the WAAPI_ERROR_RESOURCE_BUSY.
macOS Software Update
(Software Update only) If the patch applies to an application such as Safari, the app will be forced to close to install the update.
Knowledge Base
(Linux only) If the system is busy, WAAPI_ERROR_RESOURCE_BUSY will be returned.
This is a generic error code that can occur in multiple scenarios.
For example, the apt package manager may return this error if another process is already using apt (e.g., unattended-upgr).
You can find instructions to resolve this issue at resolve the WAAPI_ERROR_RESOURCE_BUSY.
(Software Update only) If the patch applies to an application such as Safari, the app will be forced to close to install the update.
Examples
Examples will be added here demonstrating the usage of this method.
See Also
Last updated: 2026-10-01