File: Setup-qt6.bat

package info (click to toggle)
kshutdown 6.0-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,992 kB
  • sloc: cpp: 8,349; sh: 477; makefile: 5
file content (104 lines) | stat: -rw-r--r-- 2,052 bytes parent folder | download
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

set KS_QT_DIR=C:\Qt\6.5.1
set KS_QT_BIN=%KS_QT_DIR%\mingw_64\bin

echo INFO: Using Qt: %KS_QT_BIN%
echo HINT: You can change it in Setup-qt6.bat

set KS_APP_VERSION=%1
set KS_COMMAND=%2

rem HACK: wineconsole crash: if not defined KS_APP_VERSION (
if "%KS_APP_VERSION%" == "" (
	echo Error: Missing application version option
	echo Usage: ./Setup-wine.sh
	pause
	exit /B 1
)

if "%KS_COMMAND%" == "" (
	echo Error: Missing command option
	echo Usage: ./Setup-wine.sh
	pause
	exit /B 1
)

if "%KS_COMMAND%" == "setup" (
	goto nsis
)

pushd .
call "%KS_QT_BIN%\qtenv2.bat"
popd

if "%KS_COMMAND%" == "test" (
	pushd src
	qmake -config release
rem TODO: set QT_WIN_DEBUG_CONSOLE=attach
	mingw32-make.exe -j2 && release\kshutdown.exe
	pause
	popd
	goto quit
)

rem pause

rem TEST:
rem cd ..
rem goto nsis
rem goto skip_portable
rem goto zip

rem ==== portable version ====

pushd src
qmake "DEFINES += KS_PORTABLE" -config release
mingw32-make.exe clean
mingw32-make.exe -j2
pause
if not %errorlevel% == 0 goto quit
mkdir ..\kshutdown-portable
copy release\kshutdown.exe ..\kshutdown-portable
popd

rem TEST:
rem cd ..
rem goto zip

:skip_portable

rem ==== normal version ====

pushd src
qmake -config release
mingw32-make.exe clean
mingw32-make.exe -j2
pause
if not %errorlevel% == 0 goto quit
popd

rem ==== portable version package ====

:zip
copy LICENSE kshutdown-portable\LICENSE.txt
copy README.html kshutdown-portable
pushd kshutdown-portable
%KS_QT_BIN%\windeployqt.exe -no-opengl-sw -no-network -no-svg kshutdown.exe
rmdir /Q /S "iconengines"
rmdir /Q /S "imageformats"
popd

rem ==== installer package ====

:nsis
if exist "%ProgramFiles(x86)%\NSIS\makensis.exe" (
	"%ProgramFiles(x86)%\NSIS\makensis.exe" /DAPP_VERSION=%KS_APP_VERSION% kshutdown.nsi
) else (
	"%ProgramFiles%\NSIS\makensis.exe" /DAPP_VERSION=%KS_APP_VERSION% kshutdown.nsi
)
pause
if not %errorlevel% == 0 goto quit
kshutdown-%KS_APP_VERSION%-win32.exe

:quit
echo DONE