-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmake.bat
More file actions
87 lines (60 loc) · 2 KB
/
make.bat
File metadata and controls
87 lines (60 loc) · 2 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
@echo off
rem Copyright (C) 2008-2025 ClearCode Inc.
setlocal enabledelayedexpansion
:PREPARE_CONFIG_BAT
IF EXIST config.bat GOTO PREPARE_CONFIG_NSH
copy config.bat.sample config.bat
:PREPARE_CONFIG_NSH
IF EXIST config.nsh GOTO PREPARE_RESOURCES
copy config.nsh.sample config.nsh
:PREPARE_RESOURCES
IF EXIST resources GOTO CONFIG
mkdir "resources"
xcopy _resources\*.sample resources\ /i /s
ren resources\*.sample *.
:CONFIG
call config.bat
del fainstall.exe
del fainstall.ini
:NSIS
IF NOT EXIST "%NSIS_PATH%" GOTO ENDBATCH
cd nsis
IF NOT EXIST helper.exe (
"%NSIS_PATH%\makensis.exe" helper.nsi
)
start /WAIT helper.exe
"%NSIS_PATH%\makensis.exe" fainstall.nsi
cd ..
:CHECK_RESULT
IF EXIST fainstall.exe GOTO SIGN_TO_INSALLER
echo "Failed to build fainstall.exe!"
exit /b 1
:SIGN_TO_INSALLER
IF NOT EXIST "%SIGN_PFX%" GOTO CREATE_PACKAGE_SOURCES
"%SIGNTOOL_PATH%\signtool.exe" sign /f "%SIGN_PFX%" /p "%SIGN_PASSWORD%" /t "%SIGN_TIMESTAMP%" /d "%SIGN_DESC%" /du "%SIGN_DESC_URL%" fainstall.exe
:CREATE_PACKAGE_SOURCES
for /f %%s in ('type product.txt') do set INSTALLER_NAME=%%s
del "%INSTALLER_NAME%.exe"
rmdir "%INSTALLER_NAME%-source" /s /q
mkdir "%INSTALLER_NAME%-source"
move fainstall.exe "%INSTALLER_NAME%-source\"
move fainstall.ini "%INSTALLER_NAME%-source\"
xcopy resources "%INSTALLER_NAME%-source\resources" /i /s
for /d %%D in (resources-*) do (
if exist "%%D\" (
echo Copying %%D to "%INSTALLER_NAME%-source\%%D"
xcopy "%%D" "%INSTALLER_NAME%-source\%%D" /i /s
)
)
endlocal
copy 7z\pack.list "%INSTALLER_NAME%-source\"
copy /b 7z\7zS.sfx.with-manifest + 7z\FxMetaInstaller.tag "%INSTALLER_NAME%-source\fainstall.sfx"
copy 7z\7zr.exe "%INSTALLER_NAME%-source\"
copy 7z\pack.bat "%INSTALLER_NAME%-source\%INSTALLER_NAME%.bat"
rem copy 7z\pack.sh "%INSTALLER_NAME%-source\%INSTALLER_NAME%.sh"
cd "%INSTALLER_NAME%-source\"
rem call "%INSTALLER_NAME%.bat
cd ..
:ENDBATCH
echo "Success"
exit /b 0