-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuilt_pyinstaller.bat
More file actions
34 lines (27 loc) · 1003 Bytes
/
built_pyinstaller.bat
File metadata and controls
34 lines (27 loc) · 1003 Bytes
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
@echo off
:: Activate virtual environment
call ./.venv/Scripts/activate.bat
:: Update requirements.txt (optional)
pip3 freeze > requirements.txt
:: Build with Pyinstaller
pyinstaller --onefile --windowed --icon=./icons/keyboard.ico free_snap_tap.py %*
:: --- Rename and move executable ---
:: Define source (dist) and destination (current dir)
set src=dist\free_snap_tap.exe
set dest=.
:: Get current date and time in YYMMDD-HHMM format
for /f "tokens=2 delims==" %%a in ('wmic os get localdatetime /value') do set datetime=%%a
set filedate=%datetime:~2,6%-%datetime:~8,4%
set filedate=%filedate: =0%
:: Define new filename (with date/time suffix)
set newname=free_snap_tap_pyinst_%filedate%.exe
:: Check if source file exists
if exist %src% (
:: Move and rename the file
copy /y %src% %dest%\free_snap_tap_pyinst_.exe
move /y %src% %dest%\%newname%
echo Moved and renamed: %newname%
) else (
echo ERROR: Source file not found: %src%
)
pause