File: make_installers.cmd

package info (click to toggle)
megacmd 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 32,540 kB
  • sloc: cpp: 324,524; ansic: 34,527; python: 4,622; java: 3,972; sh: 2,886; objc: 2,459; makefile: 197; xml: 113
file content (55 lines) | stat: -rw-r--r-- 1,782 bytes parent folder | download | duplicates (2)
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
IF "%1%" EQU "-help" (
	goto Usage
)

SET SUFFIX_DEF=
if not "%MEGA_VERSION_SUFFIX%" == "" (
	SET SUFFIX_DEF=/DVERSION_SUFFIX=%MEGA_VERSION_SUFFIX%
)

SET MEGA_SIGN=%1

:: DOUBLE CHECK SIGN
IF "%MEGA_SIGN%" EQU "sign" (
	echo "Info: Signed installer(s) will be generated. Checking if sources are signed"
	
	"C:\Program Files (x86)\Windows Kits\10\bin\%MEGA_WIN_KITVER%\x64\signtool.exe" verify /pa built64/*.exe || exit 1 /b
	"C:\Program Files (x86)\Windows Kits\10\bin\%MEGA_WIN_KITVER%\x64\signtool.exe" verify /pa built64/*.dll || exit 1 /b
	IF NOT "%MEGA_SKIP_32_BIT_BUILD%" == "true" (
		"C:\Program Files (x86)\Windows Kits\10\bin\%MEGA_WIN_KITVER%\x64\signtool.exe" verify /pa built32/*.exe || exit 1 /b
		"C:\Program Files (x86)\Windows Kits\10\bin\%MEGA_WIN_KITVER%\x64\signtool.exe" verify /pa built32/*.dll || exit 1 /b
	)
) ELSE (
	IF "%MEGA_SIGN%" EQU "nosign" (
		echo "Info: Unsigned installer(s) will be generated"
	) ELSE (
		echo "Please add a correct sign argument: sign or nosign"
		goto Usage
	)
)

erase MEGAcmdSetup64.exe 2>nul
erase MEGAcmdSetup64_unsigned.exe 2>nul
"C:\Program Files (x86)\NSIS\makensis.exe" /DWINKITVER=%MEGA_WIN_KITVER% /DBUILD_X64_VERSION %SUFFIX_DEF% installer_win.nsi || exit 1 /b
IF "%MEGA_SIGN%" EQU "nosign" (
ren MEGAcmdSetup64.exe MEGAcmdSetup64_unsigned.exe
)

IF "%MEGA_SKIP_32_BIT_BUILD%" == "true" (
	GOTO :EOF
)

erase MEGAcmdSetup32.exe >nul
erase MEGAcmdSetup32_unsigned.exe >nul
"C:\Program Files (x86)\NSIS\makensis.exe" /DWINKITVER=%MEGA_WIN_KITVER%  %SUFFIX_DEF% installer_win.nsi || exit 1 /b
IF "%MEGA_SIGN%" EQU "nosign" (
ren MEGAcmdSetup32.exe MEGAcmdSetup32_unsigned.exe
)


exit /B

:Usage
echo "Usage: %~0 [-help] [sign|nosign]"
echo Script for making the installer, expecting files in built folders"
exit 2 /b