Skip to main content

GetVersion

Will retrieve the version of the product. The product version returned will be as close to the version presented on the product's user interface. In some cases we are unable to determine the very minor versions of a product, in which case they will be omitted. If we are unable to determine the version of the product we will return L"0.0". If an error occurs while obtaining "architecture" information, the "error" key will be present in the "architecture"

Syntax​

Method ID​

#define WAAPI_MID_COMMON_GET_VERSION 100

JSON Input Structure​

{
"input": {
"method": 100,
"signature": number,
"instance_id": string
}
}

Input Properties​

ParameterTypeDescription
instance_idstring(optional) The current instance id of the product

JSON Output Structure​

{
"result": {
"method": 100,
"code": number,
"timing": number,
"timestamp": string,
"version": string,
"channel": string,
"release": string,
"architecture": {
"name": string,
"bitness": number
},
"language": {
"code": string,
"name": 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.versionstringWill return the version for the product.
result.architecture.namestringWill return the architecture name of the product.
result.architecture.bitnessnumberWill return the architecture type of the product.
result.language.codestringWill return the LANGID in hexadecimal format (eg: 0x409)
result.language.namestringWill return the Language-Culture (eg: en-US)
result.channelstring(optional) Will return the update channel of the product.
result.releasestring(optional) Will return the release version of the product. It may vary for certain products, such as release name, release version, release edition, etc.

Result Codes​

CodeNameDescription
0WAAPI_OKThe operation completed successfully.
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.

Knowledge Base​

(Windows only) When instance_id identifies a per-user product instance, GetVersion has to read that user's registry hive, so two additional return codes are possible.

WAAPI_ERROR_RESOURCE_BUSY means that user was signing in to Windows at the moment of the call - retry once the sign-in settles. GetVersion never copies a registry hive the OS is currently mounting (that would collide with the sign-in and push the user onto a temporary profile), so it waits briefly for the sign-in to finish and reads the hive live instead; if the sign-in has not completed within that short window this code is returned so the caller can retry.

WAAPI_ERROR_NATIVE_API means the instance owner's hive could not be read and no sign-in is in progress, so a retry cannot help - for example the profile path is redirected through a junction, or the profile is on a volume that does not support the cooperative-copy mechanism. Note that a hive the operating system is currently mounting (a sign-in in progress) is not in this category - that clears on its own and is reported as WAAPI_ERROR_RESOURCE_BUSY instead, so it is worth retrying. A hive merely held open by another process - an anti-malware product or the search indexer - does not block the read at all and does not produce an error. WAAPI_ERROR_NOT_FOUND means that user's profile no longer has registry hive files on disk at all (a stale profile entry). Reading another user's hive requires the SDK to run with administrator or LocalSystem privileges.

Examples​

Examples will be added here demonstrating the usage of this method.

See Also​


Last updated: 2026-10-01