diff options
author | Simon Rozman <simon@rozman.si> | 2020-03-10 08:47:13 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-10-30 16:50:58 +0100 |
commit | 6a65b11231456ad7bdc2367121d07530acf5456f (patch) | |
tree | d56d0501a48469a68b674e4ba032e25b1925c67b | |
parent | Use standard volatile semantics (diff) | |
download | wintun-6a65b11231456ad7bdc2367121d07530acf5456f.tar.xz wintun-6a65b11231456ad7bdc2367121d07530acf5456f.zip |
installer: ARM64 is always Windows 10
ARM64 support was introduced in Windows 10. There is no need to pack the
EV signed ARM64 driver for older Windows releases.
The only use-case we do want to pack an EV signed ARM64 driver (or test
signed) in the installer.dll is when we are doing the rundll32.exe
tests. Therefore, the Debug version still packs it.
If there is no driver available to pack, fail at compile time - rather
than build an installer.dll that would fail at runtime.
Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r-- | installer/installation.c | 8 | ||||
-rw-r--r-- | installer/installer.vcxproj | 2 | ||||
-rw-r--r-- | installer/resources.rc | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/installer/installation.c b/installer/installation.c index cd93ffb..cd5c300 100644 --- a/installer/installation.c +++ b/installer/installation.c @@ -272,10 +272,16 @@ InstallWintun(BOOL UpdateExisting) goto cleanupFree; BOOL UseWHQL = FALSE; -#ifdef HAVE_WHQL +#if defined(HAVE_EV) && defined(HAVE_WHQL) DWORD MajorVersion; RtlGetNtVersionNumbers(&MajorVersion, NULL, NULL); UseWHQL = MajorVersion >= 10; +#elif defined(HAVE_EV) + UseWHQL = FALSE; +#elif defined(HAVE_WHQL) + UseWHQL = TRUE; +#else + #error No driver available #endif if (!UseWHQL && !InstallWintunCertificate(TEXT("wintun.sys"))) PrintError(LOG_WARN, TEXT("Unable to install code signing certificate")); diff --git a/installer/installer.vcxproj b/installer/installer.vcxproj index b40bd90..c2f5468 100644 --- a/installer/installer.vcxproj +++ b/installer/installer.vcxproj @@ -129,10 +129,12 @@ <ItemDefinitionGroup> <ClCompile> <PreprocessorDefinitions>_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64' Or '$(Configuration)'=='Debug'">HAVE_EV;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="Exists('..\$(WintunPlatform)\$(Configuration)\whql\')">HAVE_WHQL;%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <ResourceCompile> <AdditionalIncludeDirectories>..\$(WintunPlatform)\$(Configuration);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64' Or '$(Configuration)'=='Debug'">HAVE_EV;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="Exists('..\$(WintunPlatform)\$(Configuration)\whql\')">HAVE_WHQL;%(PreprocessorDefinitions)</PreprocessorDefinitions> </ResourceCompile> <Link> diff --git a/installer/resources.rc b/installer/resources.rc index fd73afd..b0bca3c 100644 --- a/installer/resources.rc +++ b/installer/resources.rc @@ -6,9 +6,11 @@ #include <windows.h> #include <ntverp.h> +#ifdef HAVE_EV wintun.cat RCDATA "wintun\\wintun.cat" wintun.inf RCDATA "wintun\\wintun.inf" wintun.sys RCDATA "wintun\\wintun.sys" +#endif #ifdef HAVE_WHQL wintun-whql.cat RCDATA "whql\\wintun.cat" |