-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_console.bat
80 lines (61 loc) · 2.35 KB
/
build_console.bat
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
@echo off
rem -- Settings ----------------------------
rem pyinstaller flag to add a console window
set console=1
rem pause when done
rem (note: errors will always pause)
set dopause=0
rem ----------------------------------------
set starttime=%TIME%
rem test to make sure we have the "where" command
where/?>nul 2>&1
if %errorlevel% NEQ 0 set errormessage="where" command not available.& goto error
rem set pyinstaller flag to determine if a console window will be added
set parameter=w
if %console% NEQ 0 set suffix=C& set parameter=c
rem make sure the working folder is the one containing this file.
cd /D "%~dp0"
rem run this to fill the pycmd environment variable
call findpython.bat 1
if %errorlevel% NEQ 0 goto error
rem make sure we can find pyinstaller
where/q pyinstaller
if %errorlevel% NEQ 0 set errormessage=Could not find pyinstaller.& goto error
%pycmd% makeVersion.py
if %errorlevel% NEQ 0 set errormessage=Could not create version information file.&goto error
rem run pyinstaller
echo starting pyinstaller...
pyinstaller --onefile --noupx -%parameter% -i icons\icon.ico -n NESBuilder%suffix%.exe ^
--add-binary "main.lua;include" ^
--add-binary "icons\__init__.py;icons" ^
--add-binary "icons\folder32.png;icons" ^
--add-binary "icons\folderplus32.png;icons" ^
--add-binary "icons\gear32.png;icons" ^
--add-binary "icons\note32.png;icons" ^
--add-binary "icons\clock32.png;icons" ^
--add-binary "icons\project.png;icons" ^
--add-binary "icons\icon.ico;icons" ^
--add-binary "include\Tserial.lua;include" ^
--add-binary "include\util.lua;include" ^
--add-binary "include\style.qss;include" ^
--add-binary "cursors\pencil.cur;cursors" ^
--add-binary "cursors\crosshair.cur;cursors" ^
--add-binary "cursors\LinkSelect.cur;cursors" ^
--hidden-import "lupa._lupa" ^
--hidden-import PyQt5.QtPrintSupport ^
--version-file "version.py" ^
NESBuilder.py
if %errorlevel% NEQ 0 goto error
echo start time: %starttime%
echo end time: %TIME%
goto success
:error
echo.
echo.ERROR: %errormessage%
echo.
pause
goto theend
:success
echo Done.
if %dopause% NEQ 0 pause
:theend