diff options
author | Simon Rozman <simon@rozman.si> | 2019-08-09 13:02:37 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-12 09:11:27 +0200 |
commit | d1ddf1522a98b7e02f6383a3c18cba8561f13a8c (patch) | |
tree | 7aa4fc9e385a684cb9b51967bdb46922e52dd3e4 /installer | |
parent | build: use setlocal to keep build environment local (diff) | |
download | wireguard-windows-d1ddf1522a98b7e02f6383a3c18cba8561f13a8c.tar.xz wireguard-windows-d1ddf1522a98b7e02f6383a3c18cba8561f13a8c.zip |
build: fix batch file status returning
Apparently, exit /b works only halfway in Windows 8 and later. The
%errorlevel% is correct after batch exits, but && and || do not honor
it.
The `cmd /c exit` doesn't actually quit the batch processing, therefore
it must be at the very end of the batch file. Even `goto :eof` resets
the return status for && and ||.
Source: https://www.computerhope.com/forum/index.php/topic,65815.msg920454.html#msg920454
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'installer')
-rw-r--r-- | installer/build.bat | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/installer/build.bat b/installer/build.bat index 295ce437..8d438af9 100644 --- a/installer/build.bat +++ b/installer/build.bat @@ -47,10 +47,6 @@ if exist .deps\prepared goto :build echo [+] Success. exit /b 0 -:error - echo [-] Failed with error #%errorlevel%. - exit /b %errorlevel% - :download echo [+] Downloading %1 curl -#fLo %1 %2 || exit /b 1 @@ -72,3 +68,7 @@ if exist .deps\prepared goto :build echo [+] Linking %1 "%WIX%bin\light" %WIX_LIGHT_FLAGS% -out "dist\wireguard-%~1-%WIREGUARD_VERSION%.msi" "%~1\wireguard.wixobj" || exit /b %errorlevel% goto :eof + +:error + echo [-] Failed with error #%errorlevel%. + cmd /c exit %errorlevel% |