From 3f6e30830121cbf2ee3e39c87333b51b9553e041 Mon Sep 17 00:00:00 2001 From: bernat Date: Fri, 24 Apr 2020 12:21:15 +0200 Subject: [PATCH] Fix windows script to find UE4 directory --- Util/BuildTools/BuildCarlaUE4.bat | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Util/BuildTools/BuildCarlaUE4.bat b/Util/BuildTools/BuildCarlaUE4.bat index 00a8cbf19..233a643b8 100644 --- a/Util/BuildTools/BuildCarlaUE4.bat +++ b/Util/BuildTools/BuildCarlaUE4.bat @@ -1,5 +1,5 @@ @echo off -setlocal +setlocal enabledelayedexpansion rem BAT script that creates the binaries for Carla (carla.org). rem Run it through a cmd with the x64 Visual C++ Toolset enabled. @@ -14,6 +14,7 @@ rem ============================================================================ rem -- Parse arguments --------------------------------------------------------- rem ============================================================================ +set UE_VERSION=4.24 set BUILD_UE4_EDITOR=false set LAUNCH_UE4_EDITOR=false set REMOVE_INTERMEDIATE=false @@ -50,6 +51,14 @@ if %REMOVE_INTERMEDIATE% == false ( ) ) +rem Extract Unreal Engine root path +if not defined UE4_ROOT ( + set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\EpicGames\Unreal Engine\%UE_VERSION%" + set VALUE_NAME=InstalledDirectory + for /f "usebackq tokens=2*" %%A in (`reg query !KEY_NAME! /v !VALUE_NAME! /reg:64`) do set UE4_ROOT=%%B + if not defined UE4_ROOT goto error_unreal_no_found +) + rem Set the visual studio solution directory rem set UE4_PROJECT_FOLDER=%ROOT_PATH%Unreal\CarlaUE4\ @@ -145,3 +154,8 @@ rem ============================================================================ :bad_exit endlocal exit /b %errorlevel% + +:error_unreal_no_found + echo. + echo %FILE_N% [ERROR] Unreal Engine %UE_VERSION% not detected + goto bad_exit