forked from BlankeLab/ExVR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_dependencies.cmd
150 lines (127 loc) · 3.99 KB
/
install_dependencies.cmd
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
140
141
142
143
144
145
146
147
148
149
150
@echo off
Rem Compressed files
SET "BUILD_ZIP=%~dp0_build.zip"
SET "RESOURCES_ZIP=%~dp0_resources.zip"
SET "THIRDPARTY_ZIP=%~dp0_thirdparty.zip"
Rem Uncompressed directories
SET "BUILD_DIR=%~dp0_build"
SET "RESOURCES_DIR=%~dp0_resources"
SET "THIRDPARTY_DIR=%~dp0_thirdparty"
Rem Destination directories
SET "DEST_PARENT_BUILD_DIR=%~dp0cpp-projects"
SET "DEST_PARENT_RESOURCES_DIR=%~dp0cpp-projects"
SET "DEST_PARENT_THIRDPARTY_DIR=%~dp0cpp-projects"
SET "DEST_BUILD_DIR=%DEST_PARENT_BUILD_DIR%\_build"
SET "DEST_RESOURCES_DIR=%DEST_PARENT_RESOURCES_DIR%\_resources"
SET "DEST_THIRDPARTY_DIR=%DEST_PARENT_THIRDPARTY_DIR%\_thirdparty"
SET "TOOLSET_DIR=%~dp0toolset"
SET "TOOLSET_SCRIPT=%TOOLSET_DIR%\install_dependencies.cmd"
Rem Tools
SET "UNZIP_EXE=%TOOLSET_DIR%\tools\unzip.exe"
Rem Debug paths
rem echo %BUILD_ZIP%
rem echo %RESOURCES_ZIP%
rem echo %THIRDPARTY_ZIP%
rem echo %UNZIP_EXE%
rem echo %DEST_BUILD_DIR%
rem echo %DEST_RESOURCES_DIR%
rem echo %DEST_THIRDPARTY_DIR%
Rem Check if destination directories exist
IF NOT EXIST %DEST_PARENT_BUILD_DIR% (
echo "Cannot find %DEST_PARENT_BUILD_DIR% directory"
exit /b %ERRORLEVEL%
)
IF NOT EXIST %DEST_PARENT_RESOURCES_DIR% (
echo "Cannot find %DEST_PARENT_RESOURCES_DIR% directory"
exit /b %ERRORLEVEL%
)
IF NOT EXIST %DEST_PARENT_THIRDPARTY_DIR% (
echo "Cannot find %DEST_PARENT_THIRDPARTY_DIR% directory"
exit /b %ERRORLEVEL%
)
Rem Remove zip files if already existing
IF EXIST %BUILD_ZIP% (
echo "Remove %BUILD_ZIP% existing zip file"
DEL /F %BUILD_ZIP%
)
IF EXIST %RESOURCES_ZIP% (
echo "Remove %RESOURCES_ZIP% existing zip file"
DEL /F %RESOURCES_ZIP%
)
IF EXIST %THIRDPARTY_ZIP% (
echo "Remove %THIRDPARTY_ZIP% existing zip file"
DEL /F %THIRDPARTY_ZIP%
)
Rem Remove extracted directories if already existing
IF EXIST %BUILD_DIR% (
echo "Remove %BUILD_DIR% existing directory"
RMDIR /S /Q %BUILD_DIR%
)
IF EXIST %RESOURCES_DIR% (
echo "Remove %RESOURCES_DIR% existing directory"
RMDIR /S /Q %RESOURCES_DIR%
)
IF EXIST %THIRDPARTY_DIR% (
echo "Remove %THIRDPARTY_DIR% existing directory"
RMDIR /S /Q %THIRDPARTY_DIR%
)
echo "Download zip files."
bitsadmin.exe /transfer "Download build hierarchy" https://github.com/FlorianLance/exvr/releases/download/Dependencies/_build.zip "%BUILD_ZIP%"
bitsadmin.exe /transfer "Download resources" https://github.com/FlorianLance/exvr/releases/download/Dependencies/_resources.zip "%RESOURCES_ZIP%"
bitsadmin.exe /transfer "Download thirdparty" https://github.com/FlorianLance/exvr/releases/download/Dependencies/_thirdparty.zip "%THIRDPARTY_ZIP%"
IF EXIST %BUILD_ZIP% (
echo "%BUILD_ZIP% successfully downloaded"
)
IF EXIST %RESOURCES_ZIP% (
echo "%RESOURCES_ZIP% successfully downloaded"
)
IF EXIST %THIRDPARTY_ZIP% (
echo "%THIRDPARTY_ZIP% successfully downloaded"
)
echo "Uncompress directories."
%UNZIP_EXE% %BUILD_DIR%
%UNZIP_EXE% %RESOURCES_DIR%
%UNZIP_EXE% %THIRDPARTY_DIR%
IF EXIST %BUILD_DIR% (
echo "%BUILD_DIR% successfully uncompressed"
)
IF EXIST %RESOURCES_DIR% (
echo "%RESOURCES_DIR% successfully uncompressed"
)
IF EXIST %THIRDPARTY_DIR% (
echo "%THIRDPARTY_DIR% successfully uncompressed"
)
echo "Copy directories."
xcopy %BUILD_DIR% %DEST_BUILD_DIR%\ /e /h /y /k
xcopy %RESOURCES_DIR% %DEST_RESOURCES_DIR%\ /e /h /y /k
xcopy %THIRDPARTY_DIR% %DEST_THIRDPARTY_DIR%\ /e /h /y /k
echo "Remove zip files."
IF EXIST %BUILD_ZIP% (
echo "Remove %BUILD_ZIP% zip file"
DEL /F %BUILD_ZIP%
)
IF EXIST %RESOURCES_ZIP% (
echo "Remove %RESOURCES_ZIP% zip file"
DEL /F %RESOURCES_ZIP%
)
IF EXIST %THIRDPARTY_ZIP% (
echo "Remove %THIRDPARTY_ZIP% zip file"
DEL /F %THIRDPARTY_ZIP%
)
echo "Remove extracted directories."
IF EXIST %BUILD_DIR% (
echo "Remove %BUILD_DIR% directory"
RMDIR /S /Q %BUILD_DIR%
)
IF EXIST %RESOURCES_DIR% (
echo "Remove %RESOURCES_DIR% directory"
RMDIR /S /Q %RESOURCES_DIR%
)
IF EXIST %THIRDPARTY_DIR% (
echo "Remove %THIRDPARTY_DIR% directory"
RMDIR /S /Q %THIRDPARTY_DIR%
)
echo "ExVR dependencies installation finished."
Rem Toolset dependencies installation
cd %TOOLSET_DIR%
%TOOLSET_SCRIPT%