[build] Try to find 7z.exe on PATH first

This ensures compatibility with AppVeyor without breaking the Jenkins buildbot
This commit is contained in:
oddMLan 2019-09-29 19:14:53 -07:00
parent b60d6a03fd
commit b323e9cf2f
1 changed files with 9 additions and 6 deletions

View File

@ -1,12 +1,15 @@
@ECHO OFF
SETLOCAL
if exist "C:\Program Files\7-Zip\7z.exe" ( set zip="C:\Program Files\7-Zip\7z.exe")
for /f "delims=" %%a in ('WHERE 7z 2^>nul') do set "zip=%%a"
if %zip% == "" (
echo can not find 7z.exe
goto :EndErr
if "%zip%" == "" (
if exist "C:\Program Files\7-Zip\7z.exe" (
set "zip=C:\Program Files\7-Zip\7z.exe"
) else (
echo can not find 7z.exe
goto :EndErr
)
)
set ZipFileName=project64
@ -49,7 +52,7 @@ copy "%base_dir%\Plugin\Input\PJ64_NRage.dll" "%base_dir%\Bin\Package\Plugin\Inp
copy "%base_dir%\Plugin\RSP\RSP 1.7.dll" "%base_dir%\Bin\Package\Plugin\RSP"
cd %base_dir%\Bin\Package
%zip% a -tzip -r "%base_dir%\Package\%ZipFileName%" *
"%zip%" a -tzip -r "%base_dir%\Package\%ZipFileName%" *
cd /d %current_dir%
echo Package %ZipFileName% created