-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_win.bat
84 lines (71 loc) · 3.04 KB
/
build_win.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
81
82
83
84
@ echo off
REM HEADER FOR WINDOW SYSTEMS
REM Project: ak-video-analyser Azure Kinect Video Analyser
REM
REM Github repository: https://github.com/juancarlosmiranda/ak_video_analyser
REM Author: Juan Carlos Miranda
REM https://juancarlosmiranda.github.io/
REM https://github.com/juancarlosmiranda
REM
REM change_here the project name
SET PROJECT_NAME=ak_video_analyser
REM change_here the project name
SET PROJECT_NAME_OUT=ak_video_analyser_f
SET WIN_EXE_CONF=win_exe_conf
SET SRC_FOLDER=src
SET CONF_FOLDER=conf
SET DIST_FOLDER=dist
SET GUI_ASSETS=gui_ext
SET ASSETS_FOLDER=assets
SET APPLICATION_PATH=%~dp0
SET CONF_NAME=*.conf
SET PATH_FOLDER_RELATIVE_CONF=%SRC_FOLDER%\%PROJECT_NAME%\%CONF_FOLDER%\
SET PATH_CONF_FILE=%APPLICATION_PATH%%PATH_FOLDER_RELATIVE_CONF%%CONF_NAME%
SET DESTINATION_FOLDER_RELATIVE_CONF=dist\%PROJECT_NAME_OUT%\%CONF_FOLDER%
SET DESTINATION_FOLDER_ABSOLUTE_CONF=%APPLICATION_PATH%%DESTINATION_FOLDER_RELATIVE_CONF%
SET ASSETS_NAME=*.png
SET PATH_FOLDER_RELATIVE_ASSETS=%SRC_FOLDER%\%GUI_ASSETS%\%ASSETS_FOLDER%\
SET PATH_ASSETS_FILE=%APPLICATION_PATH%%PATH_FOLDER_RELATIVE_ASSETS%%ASSETS_NAME%
SET DESTINATION_FOLDER_RELATIVE_ASSETS=dist\%PROJECT_NAME_OUT%\%GUI_ASSETS%\%ASSETS_FOLDER%\
SET DESTINATION_FOLDER_ABSOLUTE_ASSETS=%APPLICATION_PATH%%DESTINATION_FOLDER_RELATIVE_ASSETS%
ECHO ---------------------
ECHO CREATING ENVIRONMENT
ECHO ---------------------
ECHO APPLICATION_PATH=%APPLICATION_PATH%
ECHO PATH_CONF_FILE=%PATH_CONF_FILE%
ECHO DESTINATION_FOLDER_ABSOLUTE_CONF=%DESTINATION_FOLDER_ABSOLUTE_CONF%
ECHO PATH_ASSETS_FILE=%PATH_ASSETS_FILE%
ECHO DESTINATION_FOLDER_ABSOLUTE_ASSETS=%DESTINATION_FOLDER_ABSOLUTE_ASSETS%
REM uncomment the following line if you need to generate again __main__.spec
REM pyi-makespec --paths=%APPLICATION_PATH%src\my_app_name --paths=%APPLICATION_PATH%src\gui_frame_ext --paths=%APPLICATION_PATH%src\helpers %APPLICATION_PATH%src\my_app_name\__main__.py
REM pyinstaller win_exe_conf/__main__.spec ./src/packaging_tutorial/__main__.py -y
pyinstaller %WIN_EXE_CONF%/__main__.spec ./%SRC_FOLDER%/%PROJECT_NAME%/__main__.py -y
ECHO ---------------------
ECHO COPYING CONFIGURATION FILES/
ECHO ---------------------
ECHO Creating %DESTINATION_FOLDER_ABSOLUTE_CONF%
ECHO Copying_from %PATH_CONF_FILE%
ECHO __to %DESTINATION_FOLDER_ABSOLUTE_CONF%
REM copy .conf files to executable
MKDIR %DESTINATION_FOLDER_ABSOLUTE_CONF%
COPY %PATH_CONF_FILE% %DESTINATION_FOLDER_ABSOLUTE_CONF%
ECHO ---------------------
ECHO COPYING ASSETS/
ECHO ---------------------
ECHO Creating %DESTINATION_FOLDER_ABSOLUTE_ASSETS%
ECHO Copying_from %PATH_ASSETS_FILE%
ECHO __to %DESTINATION_FOLDER_ABSOLUTE_ASSETS%
REM copy icons files
MKDIR %DESTINATION_FOLDER_ABSOLUTE_ASSETS%
COPY %PATH_ASSETS_FILE% %DESTINATION_FOLDER_ABSOLUTE_ASSETS%
ECHO ---------------------
ECHO CREATING ZIP FILE/
ECHO ---------------------
cd %DIST_FOLDER%
del %PROJECT_NAME_OUT%.zip
"C:\Program Files\7-Zip\7z.exe" a -tzip %PROJECT_NAME_OUT%
cd ..
ECHO ---------------------
ECHO BUILDER FINISHED/
ECHO ---------------------
ECHO USE TO INSTALL %DIST_FOLDER%/%PROJECT_NAME_OUT%.zip