diff options
author | Simon Rozman <simon@rozman.si> | 2021-03-19 11:52:11 +0100 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2021-03-19 11:52:11 +0100 |
commit | a6fa9c1b678c8bd4212cae6b2a55fb7b279b6c6e (patch) | |
tree | a00b03aa8f3ab669581771542c67c0b2485bffe0 | |
parent | api: make .h filenames lowercase for building with MinGW on Linux (diff) | |
download | wintun-a6fa9c1b678c8bd4212cae6b2a55fb7b279b6c6e.tar.xz wintun-a6fa9c1b678c8bd4212cae6b2a55fb7b279b6c6e.zip |
project: add support for intermediate versioning
While the Wintun driver is typically released only at <major>.<minor>
milestones, the wintun.dll did see some intermediate releases.
To make MSI logic correctly decide to upgrade local wintun.dll file, the
version inscribed in wintun.dll file resources should increment in those
intermediate releases. MSI ignores file timestamps. One could use
REINSTALLMODE=emus Installer property to force copying wintun.dll when
its version doesn't change. But REINSTALLMODE applies to all files in
the MSI session and would be an additional requirement when authoring
MSI packages with wintun.dll.
Bumping only the final ZIP filename version is not sufficient.
Therefore, a <major>.<minor> or <major>.<minor>.<build> versioning is
introduced. Furthermore, we no longer distinguish between WintunVersion
and WintunVersionStr. All our releases used strictly numeric
<major>.<minor> notation, making WintunVersion and WintunVersionStr
always the same.
When the driver didn't change, just bump the version in wintun.proj and
run `msbuild wintun.proj /t:Zip` to rebuild the wintun.dll and make the
new ZIP file.
Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r-- | api/resources.rc | 8 | ||||
-rw-r--r-- | driver/wintun.rc | 8 | ||||
-rw-r--r-- | wintun.proj | 2 | ||||
-rw-r--r-- | wintun.props | 11 |
4 files changed, 16 insertions, 13 deletions
diff --git a/api/resources.rc b/api/resources.rc index 607eee6..869e9b9 100644 --- a/api/resources.rc +++ b/api/resources.rc @@ -27,8 +27,8 @@ wintun-arm64.dll RCDATA "arm64\\wintun.dll" #define EXPAND(x) STRINGIZE(x) VS_VERSION_INFO VERSIONINFO -FILEVERSION WINTUN_VERSION_MAJ, WINTUN_VERSION_MIN, 0, 0 -PRODUCTVERSION WINTUN_VERSION_MAJ, WINTUN_VERSION_MIN, 0, 0 +FILEVERSION WINTUN_VERSION_MAJ, WINTUN_VERSION_MIN, WINTUN_VERSION_REL, 0 +PRODUCTVERSION WINTUN_VERSION_MAJ, WINTUN_VERSION_MIN, WINTUN_VERSION_REL, 0 FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE VFT2_UNKNOWN @@ -39,12 +39,12 @@ BEGIN BEGIN VALUE "CompanyName", "WireGuard LLC" VALUE "FileDescription", "Wintun API Library" - VALUE "FileVersion", EXPAND(WINTUN_VERSION_STR) + VALUE "FileVersion", EXPAND(WINTUN_VERSION) VALUE "InternalName", "wintun.dll" VALUE "LegalCopyright", "Copyright \xa9 2018-2021 WireGuard LLC. All Rights Reserved." VALUE "OriginalFilename", "wintun.dll" VALUE "ProductName", "Wintun Driver" - VALUE "ProductVersion", EXPAND(WINTUN_VERSION_STR) + VALUE "ProductVersion", EXPAND(WINTUN_VERSION) VALUE "Comments", "https://www.wintun.net/" END END diff --git a/driver/wintun.rc b/driver/wintun.rc index 8552b80..0f452a7 100644 --- a/driver/wintun.rc +++ b/driver/wintun.rc @@ -10,8 +10,8 @@ #define EXPAND(x) STRINGIZE(x) VS_VERSION_INFO VERSIONINFO -FILEVERSION WINTUN_VERSION_MAJ, WINTUN_VERSION_MIN, 0, 0 -PRODUCTVERSION WINTUN_VERSION_MAJ, WINTUN_VERSION_MIN, 0, 0 +FILEVERSION WINTUN_VERSION_MAJ, WINTUN_VERSION_MIN, WINTUN_VERSION_REL, 0 +PRODUCTVERSION WINTUN_VERSION_MAJ, WINTUN_VERSION_MIN, WINTUN_VERSION_REL, 0 FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DRV FILESUBTYPE VFT2_DRV_SYSTEM @@ -22,12 +22,12 @@ BEGIN BEGIN VALUE "CompanyName", "WireGuard LLC" VALUE "FileDescription", "Wintun Driver" - VALUE "FileVersion", EXPAND(WINTUN_VERSION_STR) + VALUE "FileVersion", EXPAND(WINTUN_VERSION) VALUE "InternalName", "wintun.sys" VALUE "LegalCopyright", "Copyright \xa9 2018-2021 WireGuard LLC. All Rights Reserved." VALUE "OriginalFilename", "wintun.sys" VALUE "ProductName", "Wintun Driver" - VALUE "ProductVersion", EXPAND(WINTUN_VERSION_STR) + VALUE "ProductVersion", EXPAND(WINTUN_VERSION) VALUE "Comments", "https://www.wintun.net/" END END diff --git a/wintun.proj b/wintun.proj index fb73ab0..af42d03 100644 --- a/wintun.proj +++ b/wintun.proj @@ -100,7 +100,7 @@ Zip Building --> <PropertyGroup> - <ZipTargetPath>dist\wintun-$(WintunVersionStr).zip</ZipTargetPath> + <ZipTargetPath>dist\wintun-$(WintunVersion).zip</ZipTargetPath> <ZipIntDir>dist\.tmp\</ZipIntDir> </PropertyGroup> <ItemGroup> diff --git a/wintun.props b/wintun.props index 7f397f3..4219ebe 100644 --- a/wintun.props +++ b/wintun.props @@ -8,8 +8,11 @@ <PropertyGroup> <WintunVersionMaj>0</WintunVersionMaj> <WintunVersionMin>10</WintunVersionMin> - <WintunVersionStr>0.10</WintunVersionStr><!-- Used in filenames and ProductVersion resource string, may contain strings. --> - <WintunVersion>$(WintunVersionMaj).$(WintunVersionMin)</WintunVersion><!-- Used for versioning, must be n.n[.n[.n]]. --> + <WintunVersionRel>2</WintunVersionRel> + + <!-- Used for versioning, must be n.n[.n[.n]]. --> + <WintunVersion>$(WintunVersionMaj).$(WintunVersionMin)</WintunVersion> + <WintunVersion Condition="'$(WintunVersionRel)'!='0'">$(WintunVersion).$(WintunVersionRel)</WintunVersion> <!-- .vcxproj are using different platform names. --> <WintunPlatform Condition="'$(Platform)'=='ARM'">arm</WintunPlatform> @@ -19,11 +22,11 @@ </PropertyGroup> <ItemDefinitionGroup> <ClCompile> - <PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_STR="$(WintunVersionStr)";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REL=$(WintunVersionRel);WINTUN_VERSION="$(WintunVersion)";%(PreprocessorDefinitions)</PreprocessorDefinitions> <WarningLevel>Level4</WarningLevel> </ClCompile> <ResourceCompile> - <PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_STR="$(WintunVersionStr)";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REL=$(WintunVersionRel);WINTUN_VERSION="$(WintunVersion)";%(PreprocessorDefinitions)</PreprocessorDefinitions> </ResourceCompile> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> |