Skip to content

Commit 3421c21

Browse files
committed
Add comprehensive Windows installation and build tools
- install_and_run.bat: One-click installer that handles dependencies and starts app - build_windows_exe.bat: Automated executable builder for Windows - run_datecs_monitor.bat: Smart launcher for both exe and Python versions - Updated README with Quick Start section and new installation options - Complete solution for Windows users without Python knowledge
1 parent 1c5fa59 commit 3421c21

4 files changed

Lines changed: 177 additions & 11 deletions

File tree

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ A Windows system tray application that continuously monitors the connection to D
88

99
Perfect for retail environments using Datecs fiscal printers and cash registers to ensure continuous connectivity monitoring.
1010

11+
## 🚀 Quick Start
12+
13+
**For Windows users (Easiest method):**
14+
1. [Download the latest release](https://github.com/bulgariamitko/datecs-cash-register-monitor/releases)
15+
2. Extract the ZIP file
16+
3. **Double-click `install_and_run.bat`**
17+
4. The app will install dependencies and start in your system tray!
18+
19+
**For executable version:**
20+
1. **Double-click `build_windows_exe.bat`** to create `DatecsCashRegisterMonitor.exe`
21+
2. Run the `.exe` file - no Python installation needed!
22+
1123
## 🏪 Datecs Compatibility
1224

1325
This application is specifically designed for Datecs cash registers and fiscal printers, including:
@@ -68,19 +80,24 @@ This application is specifically designed for Datecs cash registers and fiscal p
6880
python cash_register_monitor/main.py
6981
```
7082

71-
### Option 2: Build Executable
83+
### Option 2: Quick Install & Run (Windows)
7284

73-
1. **Install build dependencies**:
74-
```bash
75-
pip install pyinstaller
76-
```
77-
2. **Run the build script**:
78-
```bash
79-
python build_executable.py
80-
```
81-
3. **Run the executable**:
85+
1. **Download and extract** the repository
86+
2. **Double-click** `install_and_run.bat`
87+
- Automatically installs dependencies
88+
- Starts the monitor in system tray
89+
- No command window stays open
90+
91+
### Option 3: Build Windows Executable
92+
93+
1. **Double-click** `build_windows_exe.bat`
94+
- Automatically installs PyInstaller
95+
- Builds `DatecsCashRegisterMonitor.exe`
96+
- Creates a single-file executable
97+
98+
2. **Run the executable**:
8299
```
83-
dist/CashRegisterMonitor.exe
100+
dist/DatecsCashRegisterMonitor.exe
84101
```
85102

86103
## Usage

build_windows_exe.bat

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
@echo off
2+
echo ========================================
3+
echo Building Datecs Cash Register Monitor
4+
echo Windows Executable
5+
echo ========================================
6+
echo.
7+
8+
:: Check if Python is installed
9+
python --version >nul 2>&1
10+
if errorlevel 1 (
11+
echo ERROR: Python is not installed or not in PATH.
12+
echo Please install Python 3.8+ from https://python.org
13+
pause
14+
exit /b 1
15+
)
16+
17+
:: Navigate to script directory
18+
cd /d "%~dp0"
19+
20+
:: Install PyInstaller if not present
21+
echo Checking for PyInstaller...
22+
pip show pyinstaller >nul 2>&1
23+
if errorlevel 1 (
24+
echo Installing PyInstaller...
25+
pip install pyinstaller
26+
)
27+
28+
:: Clean previous builds
29+
echo Cleaning previous builds...
30+
if exist "build" rmdir /s /q "build"
31+
if exist "dist" rmdir /s /q "dist"
32+
if exist "*.spec" del "*.spec"
33+
34+
echo.
35+
echo Building executable...
36+
echo This may take a few minutes...
37+
38+
:: Build the executable
39+
pyinstaller ^
40+
--onefile ^
41+
--windowed ^
42+
--name=DatecsCashRegisterMonitor ^
43+
--icon=cash_register_monitor/icons/connected.ico ^
44+
--add-data="cash_register_monitor/icons;icons" ^
45+
--hidden-import=pystray._win32 ^
46+
--hidden-import=PIL._tkinter_finder ^
47+
--clean ^
48+
cash_register_monitor/main.py
49+
50+
if errorlevel 1 (
51+
echo.
52+
echo ERROR: Build failed!
53+
pause
54+
exit /b 1
55+
)
56+
57+
echo.
58+
echo ========================================
59+
echo Build completed successfully!
60+
echo ========================================
61+
echo.
62+
echo Executable location: dist\DatecsCashRegisterMonitor.exe
63+
echo File size:
64+
for %%A in ("dist\DatecsCashRegisterMonitor.exe") do echo %%~zA bytes
65+
66+
echo.
67+
echo You can now:
68+
echo 1. Run: dist\DatecsCashRegisterMonitor.exe
69+
echo 2. Copy the exe file anywhere you want
70+
echo 3. Add to Windows startup for automatic monitoring
71+
echo.
72+
pause

install_and_run.bat

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@echo off
2+
echo ========================================
3+
echo Datecs Cash Register Monitor Installer
4+
echo ========================================
5+
echo.
6+
7+
:: Check if Python is installed
8+
python --version >nul 2>&1
9+
if errorlevel 1 (
10+
echo ERROR: Python is not installed or not in PATH.
11+
echo Please install Python 3.8+ from https://python.org
12+
echo Make sure to check "Add Python to PATH" during installation.
13+
pause
14+
exit /b 1
15+
)
16+
17+
echo Python found:
18+
python --version
19+
20+
:: Navigate to script directory
21+
cd /d "%~dp0"
22+
23+
echo.
24+
echo Installing required dependencies...
25+
pip install -r requirements.txt
26+
27+
if errorlevel 1 (
28+
echo.
29+
echo ERROR: Failed to install dependencies.
30+
echo Please check your internet connection and try again.
31+
pause
32+
exit /b 1
33+
)
34+
35+
echo.
36+
echo Dependencies installed successfully!
37+
echo.
38+
echo Starting Datecs Cash Register Monitor...
39+
echo The application will run in the system tray.
40+
echo You can close this window after the app starts.
41+
echo.
42+
43+
:: Start the application in background
44+
start /B pythonw cash_register_monitor/main.py
45+
46+
echo Application started! Check your system tray for the monitor icon.
47+
echo Right-click the tray icon to access settings.
48+
echo.
49+
timeout /t 5 >nul
50+
echo This window will close automatically...
51+
timeout /t 3 >nul
52+
exit

run_datecs_monitor.bat

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@echo off
2+
:: Simple launcher for Datecs Cash Register Monitor
3+
:: This file can be placed anywhere and will run the monitor
4+
5+
cd /d "%~dp0"
6+
7+
:: Try to run the executable first (if built)
8+
if exist "dist\DatecsCashRegisterMonitor.exe" (
9+
echo Starting Datecs Monitor from executable...
10+
start "" "dist\DatecsCashRegisterMonitor.exe"
11+
exit
12+
)
13+
14+
:: If no executable, run from Python source
15+
if exist "cash_register_monitor\main.py" (
16+
echo Starting Datecs Monitor from Python source...
17+
start /B pythonw cash_register_monitor/main.py
18+
echo Monitor started in system tray!
19+
timeout /t 3 >nul
20+
exit
21+
)
22+
23+
echo ERROR: Cannot find Datecs Cash Register Monitor files.
24+
echo Please make sure you're in the correct directory.
25+
pause

0 commit comments

Comments
 (0)