diff options
author | Simon Rozman <simon@rozman.si> | 2019-08-07 09:20:30 +0200 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2019-08-07 09:43:17 +0200 |
commit | 94481e769da10c085c552def6a7463cea559c792 (patch) | |
tree | 13f3eb36a723de6482f4adcee1691fab09008d60 /installer/build.bat | |
parent | version: bump (diff) | |
download | wireguard-windows-94481e769da10c085c552def6a7463cea559c792.tar.xz wireguard-windows-94481e769da10c085c552def6a7463cea559c792.zip |
build: support building from arbitrary folder
The :installdeps used .deps folder in the current working folder, while
build failed expecting to find sources in the current working folder
as well.
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'installer/build.bat')
-rw-r--r-- | installer/build.bat | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/installer/build.bat b/installer/build.bat index 21082f52..eee8719d 100644 --- a/installer/build.bat +++ b/installer/build.bat @@ -2,14 +2,15 @@ rem SPDX-License-Identifier: MIT rem Copyright (C) 2019 WireGuard LLC. All Rights Reserved. +set OLDWIX=%WIX% set OLDPATHEXT=%PATHEXT% set PATHEXT=.exe +set BUILDDIR=%~dp0 +pushd %BUILDDIR% || exit /b 1 for /f "tokens=3" %%a in ('findstr /r "WIREGUARD_WINDOWS_VERSION_STRING.*[0-9.]*" ..\version.h') do set WIREGUARD_VERSION=%%a set WIREGUARD_VERSION=%WIREGUARD_VERSION:"=% -set STARTDIR=%cd% -set OLDWIX=%WIX% set WIX_CANDLE_FLAGS=-nologo -dWIREGUARD_VERSION="%WIREGUARD_VERSION%" set WIX_LIGHT_FLAGS=-nologo -spdb set WIX_LIGHT_FLAGS=%WIX_LIGHT_FLAGS% -sw1056 @@ -34,7 +35,7 @@ if exist .deps\prepared goto :build cd .. || goto :error :build - set WIX=%STARTDIR%\.deps\wix\ + set WIX=%BUILDDIR%.deps\wix\ call :msi x86 x86 || goto :error call :msi amd64 x64 || goto :error if exist ..\sign.bat call ..\sign.bat @@ -46,7 +47,7 @@ if exist .deps\prepared goto :build :out set WIX=%OLDWIX% set PATHEXT=%OLDPATHEXT% - cd %STARTDIR% + popd exit /b %errorlevel% :error |