-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.bat
More file actions
54 lines (47 loc) · 1.19 KB
/
Copy pathcompile.bat
File metadata and controls
54 lines (47 loc) · 1.19 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
@echo off
title Compile Resolution Switcher
echo ========================================
echo Compiling Resolution Switcher
echo ========================================
echo.
:: Find any .ico file
set ICON_FILE=
for %%f in (*.ico) do (
set ICON_FILE=%%f
goto :found
)
:found
if defined ICON_FILE (
echo [OK] Icon found: %ICON_FILE%
set ICON_PARAM=--icon="%ICON_FILE%"
) else (
echo [WARNING] No .ico file found!
set ICON_PARAM=
)
:: Install pyinstaller if needed
pip show pyinstaller >nul 2>&1
if errorlevel 1 (
echo Installing PyInstaller...
pip install pyinstaller
echo.
)
:: Clean previous builds
if exist "dist" rmdir /s /q dist
if exist "build" rmdir /s /q build
if exist "*.spec" del /q *.spec
:: Compile
echo Compiling...
pyinstaller --onefile --name "ResolutionSwitcher" %ICON_PARAM% --uac-admin resolution_switcher.py
if errorlevel 1 (
echo.
echo [ERROR] Compilation failed!
pause
exit /b 1
)
echo.
echo ========================================
echo [SUCCESS] Compilation completed!
echo ========================================
echo Executable created: dist\ResolutionSwitcher.exe
echo.
pause