内部版本字符串
内部版本标识或内部版本字符串是当前的 Microsoft Windows 版本使用的版本字符串格式的通用名称。在其完全展开的形式中,内部版本标识是 Windows 编译的唯一标识符,包括版本号、目标体系结构和内部版本类型、分支或实验室名称、专用生成的帐户用户名以及编译时间戳。
内部版本标识最初是在 Windows 2000 开发结束时引入的,尽管它们直到 Windows XP 开发的早期才插入到 Windows 内部版本本身中。从那时起,内部版本标识作为版本信息的一部分显示在 winver 中。它也是大多数 Windows 预发布版本显示的水印的高亮部分。
格式
Modern build tags most commonly use the following format:
version.arch.lab.timestamp
However, depending on the Windows version, the following formats may also be encountered:
version (lab.timestamp) version built by: lab at: timestamp version built by: lab
A build tag is composed of the following components:
version
is the full version number, i.e.6.3.9600.16384
. The major and minor version or the delta number is often omitted, in which case there is no default implied value.arch
is the target platform identifier suffixed by the build type (fre
for free/retail builds,chk
for checked/debug builds). This part is often left out when it is not considered necessary to identify the exact compile. Known target platform identifiers are as follows:x86
for 32-bit x86x64
,amd64
for 64-bit x86axp64
for 64-bit DEC Alphaia64
for Itaniumwoa
,arm
for ARM32arm64
for ARM64
lab
is the name of the branch or build lab that the build was compiled from. For private builds, this is followed (or replaced for early build tags) by the username of the account that initiated the build in parentheses; this can sometimes be an official build service account, likewincbld
(Windows Central Build Account) orwmbla
(Windows Main Build Lab Account). Private builds compiled after the migration to Git use the dummyGitEnlistment
lab name.timestamp
is the compilation date and time in theYYMMDD-hhmm
format.
The build tag may be followed by a hash of activation data from the registry, although it is not considered to be a part of the build tag itself.
Applying the above logic, the build tag 10.0.10240.16384.x86fre.th1.150709-1700
is the free/retail 32-bit x86 build of version 10.0.10240.16384, which was compiled from the th1
branch on 9 July 2015 17:00 (PT).
Location
The build tag of the currently running version of Windows is located in the registry under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
. Depending on the exact version being used, there are two string values named BuildLab
and BuildLabEx
. However, it might not necessarily match the tag reported in winver in certain Windows 10 updates, e.g. Windows 10 November 2019 Update and all updates since the May 2020 Update, as the build number is artificially increased by a separate mechanism in order to distinguish between the updates.
Since Windows Server 2022, the build tag can also be found under the OSClient
and ShellCommon
subkeys within HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft\BuildLayers
.
In older versions of Windows, the build tag is inserted into the file version information for system files. Due to the implementation of reproducible builds during the development of Windows 10 Creators Update, most files now only contain a dummy build tag with the full version number, but a placeholder lab and timestamp component, i.e. (WinBuild.160101.0800)
, as including build timestamps breaks the deterministic premise that compiling the same source code would always result in the exact same binary no matter what.