-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2build.bat
More file actions
149 lines (109 loc) · 3.37 KB
/
2build.bat
File metadata and controls
149 lines (109 loc) · 3.37 KB
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
@echo off
cd %~p0
if %errorlevel% neq 0 ( pause; exit /b )
echo | set /p="Working directory is "
cd
echo No need to restore dependencies of the C++ server solution
echo Restoring dependencies of the GUI solution
dotnet restore gui.sln
if %errorlevel% neq 0 ( pause; exit /b )
echo Build the server solution
"C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe"^
server.sln /p:RestorePackages=false /p:Configuration=Release /p:Platform=x64
if %errorlevel% neq 0 ( pause; exit /b )
echo Build the GUI solution
"C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe"^
gui.sln /p:RestorePackages=false /p:Configuration=Release /p:Platform=x64
if %errorlevel% neq 0 ( pause; exit /b )
set staging_dir=%USERPROFILE%\Desktop\BibleditStaging
echo Creating the staging directory at %staging_dir%
if EXIST %staging_dir% (
rmdir /S /Q %staging_dir%
if %errorlevel% neq 0 ( pause; exit /b )
)
mkdir %staging_dir%
if %errorlevel% neq 0 ( pause; exit /b )
echo Copying Bibledit supporting data into staging directory
xcopy server\* %staging_dir% /E /I /Y /Q /EXCLUDE:exclude.txt
if %errorlevel% neq 0 ( pause; exit /b )
echo Getting processor architecture
set arch=%processor_architecture%
echo %arch%
if %arch%==AMD64 (
goto archready
)
if %arch%==ARM64 (
goto archready
)
echo Unsupported architecture %arch%
exit /b 1
:archready
echo Copying kernel binary into staging directory
if %arch%==AMD64 (
echo Copy x64
copy x64\Release\server.exe %staging_dir% /Y
if %errorlevel% neq 0 ( pause; exit /b )
)
if %arch%==ARM64 (
echo Copy arm64
copy ARM64\Release\server.exe %staging_dir% /Y
if %errorlevel% neq 0 ( pause; exit /b )
)
echo Copying GUI binaries into staging directory
if %arch%==AMD64 (
echo Copy x64
xcopy gui\bibledit\bin\Release\* %staging_dir% /E /I /Y /Q
if %errorlevel% neq 0 ( pause; exit /b )
)
if %arch%==ARM64 (
echo Copy arm64
xcopy gui\bibledit\bin\ARM64\Release\* %staging_dir% /E /I /Y /Q
if %errorlevel% neq 0 ( pause; exit /b )
)
echo Copying Microsoft WebView2 binaries
if %arch%==AMD64 (
echo Copy x64
)
if %arch%==ARM64 (
echo Copy arm64
pushd packages
if %errorlevel% neq 0 ( pause; exit /b )
pushd M*
if %errorlevel% neq 0 ( pause; exit /b )
xcopy runtimes\win-arm64\native\* %staging_dir% /E /I /Y /Q
if %errorlevel% neq 0 ( pause; exit /b )
popd
popd
)
echo Cleaning unwanted files from staging directory
if %arch%==AMD64 (
if EXIST %staging_dir%\Debug (
rmdir /S /Q %staging_dir%\Debug
if %errorlevel% neq 0 ( pause; exit /b )
)
if EXIST %staging_dir%\Release (
rmdir /S /Q %staging_dir%\Release
if %errorlevel% neq 0 ( pause; exit /b )
)
if EXIST %staging_dir%\x64 (
rmdir /S /Q %staging_dir%\x64
if %errorlevel% neq 0 ( pause; exit /b )
)
)
echo Setting environment for packager
setlocal
SET PATH=%PATH%;C:\Program Files (x86)\Inno Setup 6
if %errorlevel% neq 0 ( pause; exit /b )
echo Copying the setup script
copy package.iss %staging_dir% /Y
if %errorlevel% neq 0 ( pause; exit /b )
echo Copying the Visual C redistributables
xcopy vc\*.exe %staging_dir% /E /I /Y /Q
if %errorlevel% neq 0 ( pause; exit /b )
echo Creating the Bibledit setup.exe
cd %staging_dir%
if %errorlevel% neq 0 ( pause; exit /b )
ISCC package.iss
if %errorlevel% neq 0 ( pause; exit /b )
echo The builder is ready
pause