Skip to content

Commit 4a4e1dd

Browse files
committed
Improve detection of failed installs in install script.
1 parent fae65c5 commit 4a4e1dd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

install_script.bat

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ REM copy the BuildCustomizations to VCTargets folder
141141
echo Installing build customisations...
142142
del /F /Q "%VCTargetsPath%\BuildCustomizations\yasm.*" >nul 2>&1
143143
copy /B /Y /V "%SCRIPTDIR%\yasm.*" "%VCTargetsPath%\BuildCustomizations\" >nul 2>&1
144-
if not exist "%VCTargetsPath%\BuildCustomizations\yasm.props" (
144+
if %ERRORLEVEL% neq 0 (
145145
echo Error: Failed to copy build customisations!
146146
echo Ensure that this script is run in a shell with the necessary write privileges
147147
goto Terminate
@@ -159,11 +159,8 @@ if not exist "%SCRIPTDIR%\yasm\" (
159159
REM copy yasm executable to VC installation folder
160160
echo Installing required YASM release binary...
161161
del /F /Q "%VCINSTALLDIR%\yasm.exe" >nul 2>&1
162-
move /Y "%SCRIPTDIR%\yasm.exe" "%VCINSTALLDIR%\" >nul 2>&1
163-
set INSTALLED=1
164-
if exist "%SCRIPTDIR%\yasm.exe" set INSTALLED=0
165-
if not exist "%VCINSTALLDIR%\yasm.exe" set INSTALLED=0
166-
if %INSTALLED% equ 0 (
162+
copy /B /Y /V "%SCRIPTDIR%\yasm.exe" "%VCINSTALLDIR%\" >nul 2>&1
163+
if %ERRORLEVEL% neq 0 (
167164
echo Error: Failed to install YASM binary!
168165
echo Ensure that this script is run in a shell with the necessary write privileges
169166
del /F /Q "%SCRIPTDIR%\yasm.exe" >nul 2>&1

0 commit comments

Comments
 (0)