-
Notifications
You must be signed in to change notification settings - Fork 21
/
generate-binaries.bat
139 lines (110 loc) · 3.66 KB
/
generate-binaries.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
@echo off
fltmc >nul 2>&1 && (
rem Running as admin.
) || (
echo "ERROR: Installer must be run as admin."
pause
exit 1
)
rem Change working directory to directory of batch file using (not always same as script dir)
cd /D "%~dp0"
set "UE_64_ROOT_PATH=C:\Program Files\Epic Games"
set "UE_32_ROOT_PATH=C:\Program Files (x86)\Epic Games"
set UE_ROOT_PATH=""
set CUSTOM_UE_ROOT_PATH=""
rem Localize Unreal Engine root path:
echo.
:while_root_not_found
if exist "%UE_64_ROOT_PATH%" (
echo "Found 64bit"
set "UE_ROOT_PATH=%UE_64_ROOT_PATH%"
) else if exist "%UE_32_ROOT_PATH%" (
echo "Found 32bit"
set "UE_ROOT_PATH=%UE_32_ROOT_PATH%"
) else if exist "%CUSTOM_UE_ROOT_PATH%" (
echo "Found custom path %CUSTOM_UE_ROOT_PATH%"
set "UE_ROOT_PATH=%CUSTOM_UE_ROOT_PATH%"
)
if exist "%UE_ROOT_PATH%\" (
echo "Unreal Engine root found: %UE_ROOT_PATH%"
) else (
echo "Unreal Engine installation folder not found: %UE_ROOT_PATH%"
set /p CUSTOM_UE_ROOT_PATH="Please enter Unreal Engine installation path: "
goto :while_root_not_found
)
:while_version_not_decided
rem Ask user which version of unreal to install to
echo.
echo "Installed versions:"
dir /A:D /B "%UE_ROOT_PATH%"
echo.
set /p UNREAL_VERSION_FOLDER="Select Unreal Engine version to build for: "
rem If nothing was typed by user
if "%UNREAL_VERSION_FOLDER%"=="" (
goto :while_version_not_decided
)
set "SELECTED_PATH=%UE_ROOT_PATH%\%UNREAL_VERSION_FOLDER%"
if exist "%SELECTED_PATH%\" (
echo "Unreal Engine version folder found: '%SELECTED_PATH%'."
set "UE_ROOT_PATH=%SELECTED_PATH%"
) else (
echo "Could not find path '%SELECTED_PATH%'."
set UNREAL_VERSION_FOLDER=""
goto :while_version_not_decided
)
rem Localize "QTM Connect Unreal" plugin root path:
echo.
set "UNREAL_PLUGIN_SOURCE_PATH=%cd%\Qualisys"
set "VERIFY_IF_CORRECT_FOLDER=%UNREAL_PLUGIN_SOURCE_PATH%\QTMConnect"
if exist "%VERIFY_IF_CORRECT_FOLDER%" (
echo "QTM Connect Unreal plugin found."
) else (
echo "QTM Connect Unreal plugin not found. Installer must be in plugin root."
pause
exit 1
)
echo.
rem set "QTM_CONNECT_UNREAL_FOLDER_NAME=Qualisys"
set "UNREAL_PLUGIN_DEST_PATH=%UE_ROOT_PATH%\Engine\Plugins"
echo "Copying plugin to %UNREAL_PLUGIN_DEST_PATH%"
rem This is needed or else variables will only be assigned once
rem Also, expand variables in for loop (or, within parentheses) with !MY_VAR! else it will cache
setlocal enabledelayedexpansion
rem Copy files
for /d %%i in ("%UNREAL_PLUGIN_SOURCE_PATH%\*") do (
rem Get folder path and name
set "FOLDER_PATH=%%i"
set "PLUGIN_NAME=%%~nxi"
set "SOURCE_DIR=!FOLDER_PATH!"
set "DEST_DIR=%UNREAL_PLUGIN_DEST_PATH%\!PLUGIN_NAME!\"
echo "Copying plugin '!PLUGIN_NAME!'..."
echo.
xcopy "!SOURCE_DIR!" "!DEST_DIR!" /e /i /h /Y
echo.
)
set "BUILD_ROOT=%UE_ROOT_PATH%\[TempFolder]\build"
rem Build plugins
for /d %%i in ("%UNREAL_PLUGIN_SOURCE_PATH%\*") do (
rem Get folder path and name
set "FOLDER_PATH=%%i"
set "PLUGIN_NAME=%%~nxi"
set "PLUGIN_BUILD_DIR=!BUILD_ROOT!\!PLUGIN_NAME!"
set "PLUGIN_FILE=!UNREAL_PLUGIN_DEST_PATH!\!PLUGIN_NAME!\!PLUGIN_NAME!.uplugin"
echo "Building plugin '!PLUGIN_NAME!'..."
rem echo "PLUGIN_BUILD_DIR '!PLUGIN_BUILD_DIR!'"
rem echo "PLUGIN_FILE '!PLUGIN_FILE!'"
echo.
rem Run in sub-processes to not clutter local variables
start /WAIT /B CMD /C CALL "%UE_ROOT_PATH%\Engine\Build\BatchFiles\RunUAT.bat" BuildPlugin^
-Plugin="!PLUGIN_FILE!"^
-Package="!PLUGIN_BUILD_DIR!"^
-ClientConfig=Shipping^
-Configuration=Shipping
echo.
)
echo.
rem Open build folder
start "" "%BUILD_ROOT%"
if NOT ["%errorlevel%"]==["0"] pause
echo "DONE!"
pause