From f3b7e4bc79815cd190d852a4a3591424fc99002d Mon Sep 17 00:00:00 2001
From: gpotter2 <gabriel@potter.fr>
Date: Wed, 31 May 2017 21:08:59 +0200
Subject: [PATCH] Add Npcap installer

---
 .appveyor.yml              |  3 ++-
 .appveyor/InstallNpcap.ps1 | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 .appveyor/InstallNpcap.ps1

diff --git a/.appveyor.yml b/.appveyor.yml
index d92886c0..5c698a56 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -12,8 +12,9 @@ build: off
 
 install:
   # Install the npcap, windump and wireshark suites
-  - choco install -y npcap wireshark
+  - ps: .\.appveyor\InstallNpcap.ps1
   - ps: .\.appveyor\InstallWindump.ps1
+  - choco install -y wireshark
   # Install Python modules
   - "%PYTHON%\\python -m pip install cryptography coverage mock pyreadline"
   - set PATH="%PYTHON%\\Scripts\\;%PATH%"
diff --git a/.appveyor/InstallNpcap.ps1 b/.appveyor/InstallNpcap.ps1
new file mode 100644
index 00000000..48595484
--- /dev/null
+++ b/.appveyor/InstallNpcap.ps1
@@ -0,0 +1,19 @@
+# Config
+$urlPath = "https://nmap.org/npcap/dist/npcap-0.90.exe"
+$checksum = "0477a42a9c54f31a7799fb3ee0537826041730f462abfc066fe36d81c50721a7"
+
+############
+############
+# Download the file
+wget $urlPath -UseBasicParsing -OutFile $PSScriptRoot"\npcap.exe"
+# Now let's check its checksum
+$_chksum = $(CertUtil -hashfile $PSScriptRoot"\npcap.exe" SHA256)[1] -replace " ",""
+if ($_chksum -ne $checksum){
+    echo "Checksums does NOT match !"
+    exit
+} else {
+    echo "Checksums matches !"
+}
+# Run installer
+Start-Process $PSScriptRoot"\npcap.exe" -ArgumentList "/loopback_support=yes /S" -wait
+echo "Npcap installation completed"
\ No newline at end of file
-- 
GitLab