-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.cmd
86 lines (60 loc) · 2.29 KB
/
Build.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
@echo off
echo "Pack %AppName%"
echo ' '
set Self=%~n0
set SelfDir=%~dp0
set AppName=%1
IF "x%AppName%" == "x" (
call :CreateConfig
exit /b
)
call Config.cmd %Self%_%AppName%
del %SrcDir%\%AppName%.exe
mkdir %SrcDir%\Install
cd %SrcDir%\Install
rem copy install script to the src folder
copy %SelfDir%\Copy.bat %SrcDir%
rem echo creating SXF archive into %SrcDir%
%SelfDir%\Bin\7zr.exe a Installer.7z "%SrcDir%\*"
rem to avoid problems with whitespace symbols in the path
for %%f in ("%DestDir%") do set DestDir8=%%~sf
rem echo %DestDir8%
echo %CD%
echo Writing Installer config
echo ;!@Install@!UTF-8!> 7zConfig
echo Title="%AppName%">> 7zConfig
echo BeginPrompt="%BeginPrompt%" >> 7zConfig
echo RunProgram="Copy.bat %DestDir8%" >> 7zConfig
echo ;!@InstallEnd@!>> 7zConfig
copy /b %SelfDir%\Bin\7zS.sfx + 7zConfig + Installer.7z %AppName%.exe
del %SrcDir%\Copy.bat
move %SrcDir%\Install\%AppName%.exe %SrcDir%\
cd %SelfDir%
rmdir %SrcDir%\Install /S /Q
echo ' '
echo ' '
echo ' '
echo ' '
echo ' Installer successfully generated: '
echo %SrcDir%\%AppName%.exe
pause
exit /b
:CreateConfig
rem echo Creating new build configuration
set /p AppName= Enter Application name:
echo "%AppName%"
set ScriptName=Build_%AppName%
echo ' '
echo Starting installer configuration for %AppName%
rem Create run script
echo %SelfDir%\Build.cmd %AppName% > %SelfDir%\Build_%AppName%.cmd
rem echo %ScriptName%
copy %SelfDir%\BuildBase.config %SelfDir%\%ScriptName%.config
call Config.cmd %ScriptName%
echo ' '
echo ' '
echo Application installer script generated successfully.
echo Use "%SelfDir%\%ScriptName%.cmd" to start installer script.
pause
exit /b
goto :EOF