From 6a65b11231456ad7bdc2367121d07530acf5456f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 10 Mar 2020 08:47:13 +0100 Subject: [PATCH] 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 --- installer/installation.c | 8 +++++++- installer/installer.vcxproj | 2 ++ installer/resources.rc | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) 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 @@ _WINDOWS;_USRDLL;%(PreprocessorDefinitions) + HAVE_EV;%(PreprocessorDefinitions) HAVE_WHQL;%(PreprocessorDefinitions) ..\$(WintunPlatform)\$(Configuration);%(AdditionalIncludeDirectories) + HAVE_EV;%(PreprocessorDefinitions) HAVE_WHQL;%(PreprocessorDefinitions) 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 #include +#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"