aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/installer
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-04-25 11:48:43 +0200
committerSimon Rozman <simon@rozman.si>2019-04-25 11:58:13 +0200
commit013e63d54bcc6bf8730e351ccf4fabf241540fd1 (patch)
treef339728a648854ceebe7beb3cf6d5a863841f8ec /installer
parentinstaller: prevent double quoting when substituting batch parameters (diff)
downloadwireguard-windows-013e63d54bcc6bf8730e351ccf4fabf241540fd1.tar.xz
wireguard-windows-013e63d54bcc6bf8730e351ccf4fabf241540fd1.zip
installer: unify dependency downloading
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'installer')
-rw-r--r--installer/build.bat24
1 files changed, 11 insertions, 13 deletions
diff --git a/installer/build.bat b/installer/build.bat
index c22daa5b..5e8b2032 100644
--- a/installer/build.bat
+++ b/installer/build.bat
@@ -18,19 +18,10 @@ if exist .deps\prepared goto :build
rmdir /s /q .deps 2> NUL
mkdir .deps || goto :error
cd .deps || goto :error
- echo [+] Downloading wix-binaries
- curl -#fLo wix-binaries.zip http://wixtoolset.org/downloads/v3.14.0.2812/wix314-binaries.zip || goto :error
- echo [+] Verifying wix-binaries
- for /f %%a in ('CertUtil -hashfile wix-binaries.zip SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="923892298f37514622c58cbbd9c2cadf2822d9bb53df8ee83aaeb05280777611" goto :error
- rem echo [+] Downloading wintun-x86
- rem curl -#fo wintun-x86.msm https://www.wintun.net/builds/wintun-x86-0.1.msm || goto :error
- rem echo [+] Verifying wintun-x86
- rem for /f %%a in ('CertUtil -hashfile wintun-x86.msm SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="5390762183e181804b28eb13815b6210f85a1280057b815f749b06768215f817" goto :error
- echo [+] Downloading wintun-amd64
- curl -#fo wintun-amd64.msm https://www.wintun.net/builds/wintun-amd64-0.1.msm || goto :error
- echo [+] Verifying wintun-amd64
- for /f %%a in ('CertUtil -hashfile wintun-amd64.msm SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="850b8e76ced2b1bbbfd601b04726b6e491d14b583694d139855c1d337ee48590" goto :error
- echo [+] Extracting wix-binaries
+ call :download wix-binaries.zip http://wixtoolset.org/downloads/v3.14.0.2812/wix314-binaries.zip 923892298f37514622c58cbbd9c2cadf2822d9bb53df8ee83aaeb05280777611 || goto :error
+ rem call :download wintun-x86.msm https://www.wintun.net/builds/wintun-x86-0.1.msm 5390762183e181804b28eb13815b6210f85a1280057b815f749b06768215f817 || goto :error
+ call :download wintun-amd64.msm https://www.wintun.net/builds/wintun-amd64-0.1.msm 850b8e76ced2b1bbbfd601b04726b6e491d14b583694d139855c1d337ee48590 || goto :error
+ echo [+] Extracting wix-binaries.zip
mkdir wix\bin || goto :error
tar -xf wix-binaries.zip -C wix\bin || goto :error
echo [+] Cleaning up
@@ -60,6 +51,13 @@ if exist .deps\prepared goto :build
echo [-] Failed with error #%errorlevel%.
goto :out
+:download
+ echo [+] Downloading %1
+ curl -#fLo %1 %2 || exit /b %errorlevel%
+ echo [+] Verifying %1
+ for /f %%a in ('CertUtil -hashfile %1 SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="%~3" exit /b 1
+ goto :eof
+
:msi
echo [+] Compiling %1
"%WIX%bin\candle.exe" %WIX_CANDLE_FLAGS% -dPlatform="%~1" -out "%~1\wireguard.wixobj" -arch %2 wireguard.wxs || exit /b %errorlevel%