forked from LuframeCode/dosoft
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.cmd
More file actions
66 lines (60 loc) · 1.59 KB
/
build.cmd
File metadata and controls
66 lines (60 loc) · 1.59 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
@echo off
:: ============================================================
:: DOSOFT - Script de compilation PyInstaller
:: Prerequis : pip install pyinstaller
:: ============================================================
setlocal enabledelayedexpansion
set APP_NAME=Dosoft
set MAIN_FILE=main.py
set ICON_FILE=logo.ico
set OUT_DIR=dist
echo.
echo ============================
echo Compilation PyInstaller - DOSOFT
echo ============================
echo.
if exist "%OUT_DIR%" (
echo [*] Nettoyage du dossier dist...
rmdir /s /q "%OUT_DIR%"
)
if exist "build" (
rmdir /s /q "build"
)
if exist "%APP_NAME%.spec" (
del "%APP_NAME%.spec"
)
:: --- Compilation PyInstaller ---
echo [*] Lancement de PyInstaller...
python -m PyInstaller ^
--onefile ^
--noconsole ^
--uac-admin ^
--icon="%ICON_FILE%" ^
--name="%APP_NAME%" ^
--distpath="%OUT_DIR%" ^
--add-data="skin;skin" ^
--add-data="sounds;sounds" ^
--add-data="resources\\i18n;resources\\i18n" ^
--add-data="resources\\keyboards;resources\\keyboards" ^
--add-data="logo.ico;." ^
--hidden-import=customtkinter ^
--hidden-import=PIL ^
--hidden-import=pygame ^
--hidden-import=win32api ^
--hidden-import=win32con ^
--hidden-import=win32gui ^
--hidden-import=win32process ^
--hidden-import=keyboard ^
--collect-all=customtkinter ^
"%MAIN_FILE%"
if %ERRORLEVEL% NEQ 0 (
echo.
echo [ERREUR] La compilation a echoue. Verifiez les logs ci-dessus.
pause
exit /b 1
)
echo.
echo [OK] Compilation reussie !
echo [OK] Executable : %OUT_DIR%\%APP_NAME%.exe
echo.
pause