Skip to content

Latest commit

 

History

History
327 lines (247 loc) · 7.59 KB

File metadata and controls

327 lines (247 loc) · 7.59 KB

🎉 ავტომატური გაშვება - Summary

✅ რა გაკეთდა:

შეიქმნა Windows Startup ინტეგრაცია სრულად დამალული რეჟიმით!


📁 ახალი ფაილები:

VBScript Files (დამალული გაშვება):

  1. start_all_hidden.vbs - მთავარი script (Scanner + PHP)
  2. scanner_service.vbs - მხოლოდ Scanner Helper
  3. php_service.vbs - მხოლოდ PHP Server

Batch Files (მართვა):

  1. install_full_startup.bat - დააინსტალირებს startup-ში
  2. uninstall_full_startup.bat - წაშლის startup-დან
  3. install_startup.bat - მხოლოდ Scanner Helper startup
  4. uninstall_startup.bat - მხოლოდ Scanner Helper-ის წაშლა
  5. stop_services.bat - გააჩერებს services-ს
  6. check_services.bat - შეამოწმებს status-ს
  7. test_hidden.bat - ტესტი დამალული რეჟიმის

Documentation:

  1. AUTOSTART_GUIDE.md - სრული გაიდი

🚀 როგორ გამოვიყენო:

1. Build:

cargo build --release

2. Install:

install_full_startup.bat

3. Reboot:

shutdown /r /t 0

4. შემდეგ login-ზე:

  • ✅ ავტომატურად გაეშვება
  • ✅ დამალული (არანაირი ფანჯარა)
  • ✅ მზად არის: http://localhost:8080/index.html

🔧 როგორ მუშაობს:

Windows Login
    ↓
Execute: %APPDATA%\...\Startup\scanner_full_service.vbs
    ↓
VBScript runs:
    ├─→ scanner_helper.exe (hidden, window=0)
    │   └─→ Listens on port 8765
    └─→ php -S localhost:8080 (hidden, window=0)
        └─→ Serves web interface
    ↓
Both services running silently in background
    ↓
User opens browser: http://localhost:8080/index.html
    ↓
Scanner ready to use!

📊 VBScript მაგალითი:

' start_all_hidden.vbs
Set WshShell = CreateObject("WScript.Shell")

' Run scanner_helper.exe hidden
' Window mode: 0 = hidden, 1 = normal
WshShell.Run "scanner_helper.exe", 0, False

' Run PHP server hidden
WshShell.Run "php -S localhost:8080", 0, False

Window mode:

  • 0 = Hidden (არანაირი ფანჯარა)
  • 1 = Normal (ნორმალური ფანჯარა)
  • 2 = Minimized (minimized)
  • 3 = Maximized (maximized)

🛠️ მართვის ბრძანებები:

Install to Startup:

install_full_startup.bat

Uninstall from Startup:

uninstall_full_startup.bat

Start Services Manually:

start_all_hidden.vbs

Stop Services:

stop_services.bat

Check Status:

check_services.bat

Output:

[RUNNING] scanner_helper.exe is running
[RUNNING] php.exe is running

TCP    127.0.0.1:8765    LISTENING
TCP    127.0.0.1:8080    LISTENING

🔍 როგორ ვნახო რომ მუშაობს:

Option 1: Task Manager

Ctrl + Shift + Esc
→ Processes
→ ნახე "scanner_helper.exe" და "php.exe"

Option 2: Check Script

check_services.bat

Option 3: Browser Test

http://localhost:8080/index.html
→ Click "Scan Document"
→ თუ მუშაობს → ყველაფერი კარგია! ✅

📍 ფაილების მდებარეობა:

Before Install (Development):

windowsRust\
├── start_all_hidden.vbs
├── install_full_startup.bat
└── target\release\scanner_helper.exe

After Install (Production):

C:\Users\YourName\AppData\Roaming\Microsoft\Windows\
  Start Menu\Programs\Startup\
    └── scanner_full_service.vbs  ← Copy of start_all_hidden.vbs

⚙️ Configuration:

Change DPI (in Rust code):

// src/main.rs:57
"-DPI", "300"  // 150, 200, 300, 600

Change PHP Port (in VBS):

' start_all_hidden.vbs
WshShell.Run "php -S localhost:9000", 0, False

🐛 Troubleshooting:

Services არ გაეშვა:

1. check_services.bat  ← Check status
2. start_all_hidden.vbs  ← Start manually
3. Check Task Manager for errors

PHP არ მუშაობს:

REM Check PHP in PATH:
php --version

REM If not in PATH, use full path in VBS:
WshShell.Run "C:\php\php.exe -S localhost:8080", 0, False

Port დაკავებულია:

REM Find what's using port:
netstat -ano | findstr ":8080"

REM Kill process:
taskkill /F /PID <PID>

🎯 Use Cases:

1. Home Office:

  • ✅ კომპიუტერის ჩართვისას სკანერი ყოველთვის მზადაა
  • ✅ არ უნდა იფიქრო რომ გაუშვა

2. Office Environment:

  • ✅ სრული დამალული რეჟიმი
  • ✅ მომხმარებელი არც კი იცის რომ background-ში მუშაობს

3. Server/Kiosk Mode:

  • ✅ მუდმივი ხელმისაწვდომობა
  • ✅ არანაირი manual intervention

🔐 უსაფრთხოება:

Localhost Only:

  • ✅ Binds to 127.0.0.1 (local only)
  • ❌ არ არის ხელმისაწვდომი ქსელიდან
  • ✅ უსაფრთხო

Firewall:

თუ Windows Firewall აბლოკავს:

REM Allow scanner_helper.exe:
netsh advfirewall firewall add rule name="Scanner Helper" ^
  dir=in action=allow program="C:\path\to\scanner_helper.exe"

📊 Performance:

Startup Time:

  • VBS script launch: <1s
  • scanner_helper.exe: ~2s
  • PHP server: ~1s
  • Total: ~3-5s after login

Resource Usage:

  • scanner_helper.exe: ~5-10 MB RAM
  • php.exe: ~10-15 MB RAM
  • Total: ~15-25 MB RAM

CPU Usage:

  • Idle: 0%
  • During scan: 5-15%

🎉 შედეგი:

Before (❌):

1. Run scanner_helper.exe manually
2. Run php -S localhost:8080 manually
3. Both windows visible on screen
4. Forget to start after reboot

After (✅):

1. Login to Windows
2. Everything starts automatically
3. Completely hidden (no windows)
4. Always ready to scan!

📝 Checklist:

Installation:

  • Built project (cargo build --release)
  • Tested manually
  • Tested hidden mode (test_hidden.bat)
  • Installed to startup (install_full_startup.bat)
  • Rebooted computer
  • Verified auto-start after login
  • Tested scan functionality

Verification:

  • No windows visible ✅
  • Services running (Task Manager)
  • Ports listening (8765, 8080)
  • Browser opens successfully
  • Scan works correctly

📚 დამატებითი დოკუმენტაცია:

  • AUTOSTART_GUIDE.md - სრული დეტალური გაიდი
  • README.md - მთავარი README
  • FINAL_SOLUTION.md - რეალური სკანერის ინტეგრაცია

✅ ყველაფერი მზადაა!

Build, Install, Reboot - და ავტომატურად იმუშავებს! 🚀

🔒 სრულად დამალული, არანაირი ფანჯარა!