Skip to main content

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​

ParameterTypeDescription
threadsnumber(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_cacheboolean(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_servicesboolean(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
usernamestring(optional) Username for patch installation authentication.
passwordstring(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.
patchesarray<object>An array of missing patches or packages to be installed.
patches.titlestringThe title of a missing patch or package. This value should be retrieved from the GetMissingPatches method response.
patches.productstringThe product a missing patch or the package will be installed for, this value should be obtained from the return of GetMissingPatches.
patches.vendorstring(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.versionstring(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?.
modenumber(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_actionnumber(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_repairstring(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​

PropertyTypeDescription
result.methodnumberThe method ID that generated this result.
result.codenumberThe result code. See Result Codes.
result.timingnumberThe measured time for the method call in milliseconds.
result.timestampstringThe timestamp in seconds of when the call was made.
result.patchesarray<object>(optional) An array of missing patches or packages that are input by the user.
result.patches.titlestringThe title of a patch or package.
result.patches.productstringThe product of this patch or package name.
result.patches.vendorstring(optional) The vendor of the product a missing patch or package. Only available if user input it in json_in.
result.patches.statestringThe 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_requiredboolean(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.versionstring(optional) The version of the patch or package that was installed successfully.
result.patches.return_codenumber(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.dependenciesarray<object>(optional) (Linux only) The package dependencies required for installation.
result.patches.dependencies.namestring(optional) (Linux only) The dependency name.
result.patches.dependencies.statusstring(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_versionstring(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_versionstring(optional) (Linux only) The package dependencies installed version.
result.patches.codestring(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_sourcestring(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​

CodeNameDescription
0WAAPI_OKThe operation completed successfully.
3WAAPI_PARTIAL_SUCCESSPartial success - some patches were installed successfully while others failed. Check individual patch states in the result.
10WAAPI_OK_RESTART_TO_ENABLERestart is required to enable the installed patches.
-1WAAPI_ERROR_GENERALGeneral error that is not yet defined.
-11WAAPI_ERROR_COMPONENT_METHOD_NOT_SUPPORTED(macOS only) The input.restart_action parameter is not supported on Intel devices.
-17WAAPI_ERROR_NO_CONNECTIONNo internet connectivity to online host to install the update.
-19WAAPI_ERROR_INVALID_CREDENTIALSIncorrect authentication information provided to install missing patches.
-20WAAPI_ERROR_INVALID_INPUT_ARGSRequired patches information is missing or incorrect, or the input parameters do not match the method's documented requirements.
-22WAAPI_ERROR_ACCESS_DENIEDAdministrator permission (sudo) is required to install patches.
-24WAAPI_ERROR_NOT_RUNNINGThe package manager service is not running, causing the patch installation to fail.
-27WAAPI_ERROR_NATIVE_APIProblem with the native API used to install missing patches.
-28WAAPI_ERROR_NOT_FOUNDThe patch(es) to install were not found and installation cannot continue.
-49WAAPI_ERROR_THREAD_TIMEOUTTimeout reached during patch installation. Retry or reinstall the patches.
-60WAAPI_ERROR_3RD_PARTY_HOST_CONNECTION_NOT_ESTABLISHED(Windows Update Agent only) Unable to start the wa_3rd_party_host process to install missing patches.
-64WAAPI_ERROR_PASSWORD_REQUIRED(macOS only) Password not provided when installing on Apple Silicon chip or T1/T2 chip.
-70WAAPI_ERROR_RESOURCE_BUSY(Linux only) The system is busy (e.g., another process is using the package manager). See troubleshooting guide.
-81WAAPI_ERROR_MISSING_PACKAGE_DEPENDENCIES(Linux only) Dependency packages cannot be upgraded, causing the installation to fail.
-82WAAPI_ERROR_PACKAGE_ON_HOLD(Linux only) Package is on hold by the user and cannot be upgraded.
-87WAAPI_ERROR_PATCH_TITLE_NOT_FOUND(macOS only) No such update found or incorrect patch title provided.
note

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