This commit is contained in:
2025-09-25 22:26:32 +03:00
parent 854b6980bc
commit 02277dd55b
27 changed files with 3636 additions and 1855 deletions

View File

@@ -0,0 +1,273 @@
# Quality Print Service - Complete Installation Guide
## 🎯 Pre-Installation Checklist
### System Requirements Verification:
- [ ] Windows 10 build 1903+ or Windows Server 2016+
- [ ] Administrator access to the system
- [ ] Google Chrome browser installed
- [ ] At least 100 MB free disk space
- [ ] Network/USB printer connected and configured
### Python Requirements:
- [ ] Python 3.7+ installed OR use included portable Python
- [ ] Python accessible via command line (optional)
## 📦 Installation Methods
### Method 1: Complete Automatic Installation (Recommended)
1. **Download and Extract**:
- Extract the complete package to any folder (e.g., Desktop)
- No need to keep the files permanently
2. **Run Installer**:
```
Right-click: install_service_complete.bat
Select: "Run as administrator"
```
3. **Follow Installation Steps**:
```
[1/6] Administrator privileges confirmed ✓
[2/6] Checking Python installation...
[3/6] Creating installation directories...
[4/6] Installing service files...
[5/6] Installing Windows service...
[6/6] Starting service...
```
4. **Install Chrome Extension**:
- Chrome will open the extension folder automatically
- Go to `chrome://extensions/`
- Enable "Developer mode" (top right)
- Click "Load unpacked"
- Select the `chrome_extension` folder
5. **Verify Installation**:
- Visit: `http://localhost:8765/health`
- Expected response: `{"status": "healthy"}`
### Method 2: Manual Installation
1. **Create Directories**:
```cmd
mkdir C:\QualityPrintService
mkdir %USERPROFILE%\PrintService\logs
```
2. **Copy Files**:
```cmd
copy print_service_complete.py C:\QualityPrintService ```
3. **Install Service**:
```cmd
sc create QualityPrintService binPath="python C:\QualityPrintService\print_service_complete.py"
sc start QualityPrintService
```
## 🔧 Post-Installation Configuration
### Service Verification:
```cmd
# Check service status
sc query QualityPrintService
# Check service configuration
sc qc QualityPrintService
# View service logs (if using NSSM)
type "%USERPROFILE%\PrintService\logs\service_output.log"
```
### Network Testing:
```powershell
# Test health endpoint
Invoke-RestMethod -Uri http://localhost:8765/health
# Test printer endpoint
Invoke-RestMethod -Uri http://localhost:8765/printers
# Test from browser
start http://localhost:8765/status
```
### Chrome Extension Setup:
1. Open Chrome browser
2. Navigate to `chrome://extensions/`
3. Enable "Developer mode" toggle (top-right corner)
4. Click "Load unpacked" button
5. Browse and select the `chrome_extension` folder
6. Verify extension appears in the list with green toggle
## 🔍 Installation Verification
### Health Check Procedure:
1. **Service Status**: Verify Windows service is running
```cmd
sc query QualityPrintService | find "RUNNING"
```
2. **Network Connectivity**: Test HTTP endpoints
```cmd
curl http://localhost:8765/health
```
3. **Printer Detection**: Check printer enumeration
```cmd
curl http://localhost:8765/printers
```
4. **Extension Communication**: Test from web page
- Open the Quality app in Chrome
- Go to print module
- Verify "Extension ready" status
### Expected Responses:
**Health Check**:
```json
{
"status": "healthy",
"service": "Windows Print Service",
"version": "1.0.0",
"timestamp": "2025-09-25T10:30:00"
}
```
**Printer List**:
```json
{
"success": true,
"printers": [
{"name": "HP LaserJet", "type": "Local", "status": "Available"}
],
"count": 1
}
```
## 🚨 Troubleshooting Common Issues
### Issue: "Administrator privileges required"
**Solution**:
- Right-click installer file
- Select "Run as administrator"
- Confirm UAC prompt
### Issue: "Python not found"
**Solutions**:
1. Install Python from python.org
2. Use included portable Python
3. Add Python to system PATH
### Issue: "Service failed to start"
**Solutions**:
1. Check Windows Event Viewer:
- Windows Logs → Application
- Filter by source: "Service Control Manager"
2. Verify port 8765 is not in use:
```cmd
netstat -an | find "8765"
```
3. Check service logs:
```cmd
type "%USERPROFILE%\PrintService\logs\print_service_*.log"
```
### Issue: "Chrome extension not working"
**Solutions**:
1. Reload extension in `chrome://extensions/`
2. Check extension permissions
3. Verify service is responding at `localhost:8765`
4. Clear browser cache and cookies
### Issue: "PDF printing fails"
**Solutions**:
1. Install Adobe Reader or SumatraPDF
2. Check printer permissions
3. Verify PDF file accessibility
4. Test with different printer
## 🔄 Maintenance and Updates
### Regular Maintenance:
- **Log Cleanup**: Logs rotate automatically
- **Service Monitoring**: Check service status weekly
- **Chrome Extension**: Update when prompted
### Manual Service Management:
```cmd
# Stop service
sc stop QualityPrintService
# Start service
sc start QualityPrintService
# Restart service
sc stop QualityPrintService && timeout /t 3 && sc start QualityPrintService
# Change startup type
sc config QualityPrintService start= auto
```
### Log File Locations:
- Service logs: `%USERPROFILE%\PrintService\logs\`
- Windows Event Logs: Event Viewer → Windows Logs → Application
- Chrome Extension: Chrome DevTools → Console
## 🔧 Advanced Configuration
### Custom Port Configuration:
Edit `print_service_complete.py`:
```python
server_address = ('localhost', 8765) # Change 8765 to desired port
```
### Custom Install Directory:
Edit `install_service_complete.bat`:
```batch
set INSTALL_DIR=C:\CustomPath\PrintService
```
### Service Recovery Options:
```cmd
sc failure QualityPrintService reset= 86400 actions= restart/5000/restart/10000/restart/30000
```
## 📋 Uninstallation
### Complete Removal:
1. Run `uninstall_service_complete.bat` as Administrator
2. Remove Chrome extension manually
3. Optional: Delete log files
### Manual Removal:
```cmd
# Stop and remove service
sc stop QualityPrintService
sc delete QualityPrintService
# Remove files
rmdir /s /q C:\QualityPrintService
rmdir /s /q "%USERPROFILE%\PrintService"
```
## 📞 Getting Help
### Before Contacting Support:
1. Check this installation guide
2. Review troubleshooting section
3. Check service logs for error messages
4. Test with simple printer (like Microsoft Print to PDF)
### Information to Provide:
- Windows version (run `winver`)
- Python version (run `python --version`)
- Service status (run `sc query QualityPrintService`)
- Recent log entries
- Error messages or screenshots
---
**Installation Guide Version**: 1.0.0
**Last Updated**: September 2025
**Support**: Internal Quality System Team