aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2020-03-10 08:47:13 +0100
committerSimon Rozman <simon@rozman.si>2020-03-10 08:47:13 +0100
commit22b06855ba6b082079f87aef2e3fdc3efd758c92 (patch)
treecea727cbc24d31e0c8c22f1d11167f928bb1412d
parentReschedule EvaluateWintun between InstallInitialize and InstallFinalize (diff)
downloadwintun-sr/arm64-wip.tar.xz
wintun-sr/arm64-wip.zip
installer: ARM64 is always Windows 10sr/arm64-wip
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.c8
-rw-r--r--installer/installer.vcxproj2
-rw-r--r--installer/resources.rc2
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"