-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBuildInstaller.bat
More file actions
76 lines (67 loc) · 3.27 KB
/
Copy pathBuildInstaller.bat
File metadata and controls
76 lines (67 loc) · 3.27 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
@echo off
set MAKENSIS_PATH=
call :clean_all
call :check_prerequisites_and_initialize_variables || (call :clean_all & goto :display_failure_message)
dotnet.exe build -c Release -p:Platform=x86 . || (call :clean_all & goto :display_failure_message)
dotnet.exe build -c Release -p:Platform=x64 . || (call :clean_all & goto :display_failure_message)
if not exist Installer\src\tmp (
mkdir Installer\src\tmp || (call :clean_all & goto :display_failure_message)
)
if not exist Installer\bin\tmp (
mkdir Installer\bin\tmp || (call :clean_all & goto :display_failure_message)
)
copy Installer\src\* Installer\src\tmp || (call :clean_all & goto :display_failure_message)
python.exe Installer\tools\scripts\insert_file_commands_into_nsi_script.py Installer\included_files Installer\src\scrupdate_installer.nsi || (call :clean_all & goto :display_failure_message)
python.exe Installer\tools\scripts\insert_file_commands_into_nsi_script.py Installer\included_files Installer\src\scrupdate_system_auto_installer.nsi || (call :clean_all & goto :display_failure_message)
python.exe Installer\tools\scripts\insert_file_commands_into_nsi_script.py Installer\included_files Installer\src\scrupdate_user_auto_installer.nsi || (call :clean_all & goto :display_failure_message)
%MAKENSIS_PATH% Installer\src\scrupdate_system_auto_installer.nsi || (call :clean_all & goto :display_failure_message)
%MAKENSIS_PATH% Installer\src\scrupdate_user_auto_installer.nsi || (call :clean_all & goto :display_failure_message)
%MAKENSIS_PATH% Installer\src\scrupdate_installer.nsi || (call :clean_all & goto :display_failure_message)
move /Y Installer\src\tmp\* Installer\src || (call :clean_all & goto :display_failure_message)
call :clean_temporary_files
goto :display_success_message
:check_prerequisites_and_initialize_variables
where dotnet > nul 2>&1 || (echo ERROR: '.NET SDK' Was Not Found! & exit /b -1)
where python > nul 2>&1 || (echo ERROR: 'Python' Was Not Found! & exit /b -1)
if exist "C:\Program Files (x86)\NSIS\Bin\makensis.exe" (
set MAKENSIS_PATH="C:\Program Files (x86)\NSIS\Bin\makensis.exe"
) else (
if exist "C:\Program Files\NSIS\Bin\makensis.exe" (
set MAKENSIS_PATH="C:\Program Files\NSIS\Bin\makensis.exe"
) else (
echo ERROR: 'NSIS' Was Not Found! & exit /b -1
)
)
exit /b 0
:clean_temporary_files
if exist Scrupdate\obj (
rmdir /S /Q Scrupdate\obj
)
if exist Scrupdate\bin (
rmdir /S /Q Scrupdate\bin
)
if exist Installer\src\tmp (
rmdir /S /Q Installer\src\tmp
)
if exist Installer\bin\tmp (
rmdir /S /Q Installer\bin\tmp
)
exit /b 0
:clean_all
call :clean_temporary_files
if exist Installer\bin (
rmdir /S /Q Installer\bin
)
exit /b 0
:display_failure_message
echo ---------------------------------------------------------------------------------------------------------------
echo Build Was Failed!
echo ---------------------------------------------------------------------------------------------------------------
pause
exit /b 0
:display_success_message
echo ---------------------------------------------------------------------------------------------------------------
echo Build Was Succeeded! [Check output in the 'Installer\bin' directory]
echo ---------------------------------------------------------------------------------------------------------------
pause
exit /b 0