|
| 1 | +# Setup Scripts Documentation |
| 2 | + |
| 3 | +## Automated Setup Scripts |
| 4 | + |
| 5 | +The repository includes automated setup scripts for easy installation on different platforms. |
| 6 | + |
| 7 | +### Windows Scripts |
| 8 | + |
| 9 | +#### `setup_windows.bat` |
| 10 | +**Purpose:** Automated setup for Windows systems |
| 11 | +**Usage:** Double-click or run `setup_windows.bat` in Command Prompt |
| 12 | + |
| 13 | +**What it does:** |
| 14 | +1. Checks if Python is installed and accessible |
| 15 | +2. Creates virtual environment (`.venv`) if not exists |
| 16 | +3. Activates virtual environment |
| 17 | +4. Upgrades pip to latest version |
| 18 | +5. Installs all dependencies from `requirements.txt` |
| 19 | +6. Displays usage instructions |
| 20 | + |
| 21 | +**Error handling:** |
| 22 | +- Verifies Python installation |
| 23 | +- Checks virtual environment creation |
| 24 | +- Validates dependency installation |
| 25 | +- Provides helpful error messages |
| 26 | + |
| 27 | +#### `run_windows.bat` |
| 28 | +**Purpose:** Quick launcher for the application |
| 29 | +**Usage:** Double-click or run `run_windows.bat` |
| 30 | + |
| 31 | +**What it does:** |
| 32 | +1. Checks if virtual environment exists |
| 33 | +2. Activates virtual environment |
| 34 | +3. Launches PyQt6 GUI application |
| 35 | +4. Keeps window open if errors occur |
| 36 | + |
| 37 | +### macOS/Linux Scripts |
| 38 | + |
| 39 | +#### `setup_macos.sh` |
| 40 | +**Purpose:** Automated setup for macOS and Linux systems |
| 41 | +**Usage:** `chmod +x setup_macos.sh && ./setup_macos.sh` |
| 42 | + |
| 43 | +**What it does:** |
| 44 | +1. Checks if Python 3 is installed |
| 45 | +2. Creates virtual environment using `python3 -m venv` |
| 46 | +3. Activates virtual environment |
| 47 | +4. Upgrades pip to latest version |
| 48 | +5. Installs all dependencies from `requirements.txt` |
| 49 | +6. Provides usage instructions including Makefile options |
| 50 | + |
| 51 | +**Error handling:** |
| 52 | +- Exits on any error (`set -e`) |
| 53 | +- Verifies Python 3 availability |
| 54 | +- Checks requirements.txt existence |
| 55 | +- Clear error messages with installation hints |
| 56 | + |
| 57 | +#### `run_macos.sh` |
| 58 | +**Purpose:** Quick launcher for the application |
| 59 | +**Usage:** `./run_macos.sh` |
| 60 | + |
| 61 | +**What it does:** |
| 62 | +1. Checks if virtual environment exists |
| 63 | +2. Activates virtual environment |
| 64 | +3. Launches PyQt6 GUI application |
| 65 | + |
| 66 | +## Usage Examples |
| 67 | + |
| 68 | +### First-time Setup |
| 69 | + |
| 70 | +**Windows:** |
| 71 | +```cmd |
| 72 | +# Download/clone repository |
| 73 | +cd ffmpeg-gui-pyqt6 |
| 74 | +
|
| 75 | +# Run setup (creates venv and installs dependencies) |
| 76 | +setup_windows.bat |
| 77 | +
|
| 78 | +# Run application |
| 79 | +run_windows.bat |
| 80 | +``` |
| 81 | + |
| 82 | +**macOS/Linux:** |
| 83 | +```bash |
| 84 | +# Download/clone repository |
| 85 | +cd ffmpeg-gui-pyqt6 |
| 86 | + |
| 87 | +# Make scripts executable and run setup |
| 88 | +chmod +x setup_macos.sh run_macos.sh |
| 89 | +./setup_macos.sh |
| 90 | + |
| 91 | +# Run application |
| 92 | +./run_macos.sh |
| 93 | +``` |
| 94 | + |
| 95 | +### Daily Usage |
| 96 | + |
| 97 | +After initial setup, just use the run scripts: |
| 98 | + |
| 99 | +**Windows:** Double-click `run_windows.bat` |
| 100 | +**macOS/Linux:** `./run_macos.sh` |
| 101 | + |
| 102 | +## Troubleshooting |
| 103 | + |
| 104 | +### Windows Issues |
| 105 | + |
| 106 | +**"Python is not recognized"** |
| 107 | +- Install Python from [python.org](https://www.python.org/downloads/) |
| 108 | +- **IMPORTANT:** Check "Add Python to PATH" during installation |
| 109 | +- Restart Command Prompt after installation |
| 110 | + |
| 111 | +**"Access is denied" on .bat files** |
| 112 | +- Right-click → "Run as administrator" |
| 113 | +- Or adjust execution policies in PowerShell |
| 114 | + |
| 115 | +**Antivirus blocks scripts** |
| 116 | +- Add repository folder to antivirus exceptions |
| 117 | +- Some antivirus software blocks .bat files by default |
| 118 | + |
| 119 | +### macOS/Linux Issues |
| 120 | + |
| 121 | +**"Permission denied"** |
| 122 | +- Make scripts executable: `chmod +x *.sh` |
| 123 | +- Check file permissions: `ls -la *.sh` |
| 124 | + |
| 125 | +**"python3: command not found"** |
| 126 | +- Install Python 3: `brew install python` (macOS) or `sudo apt install python3` (Linux) |
| 127 | +- Use full path: `/usr/bin/python3` instead of `python3` |
| 128 | + |
| 129 | +**Virtual environment creation fails** |
| 130 | +- Install venv module: `sudo apt install python3-venv` (Linux) |
| 131 | +- Use alternative: `python3 -m pip install virtualenv` |
| 132 | + |
| 133 | +## Manual Alternative |
| 134 | + |
| 135 | +If scripts don't work, you can always use manual installation: |
| 136 | + |
| 137 | +```bash |
| 138 | +# Create virtual environment |
| 139 | +python -m venv .venv # Windows |
| 140 | +python3 -m venv .venv # macOS/Linux |
| 141 | + |
| 142 | +# Activate virtual environment |
| 143 | +.venv\Scripts\activate.bat # Windows |
| 144 | +source .venv/bin/activate # macOS/Linux |
| 145 | + |
| 146 | +# Install dependencies |
| 147 | +pip install -r requirements.txt |
| 148 | + |
| 149 | +# Run application |
| 150 | +python GUI_pyqt6_WINFF.py |
| 151 | +``` |
| 152 | + |
| 153 | +## Integration with Build System |
| 154 | + |
| 155 | +The scripts complement the existing build system: |
| 156 | + |
| 157 | +**Development workflow:** |
| 158 | +1. `setup_windows.bat` or `./setup_macos.sh` - Initial setup |
| 159 | +2. `run_windows.bat` or `./run_macos.sh` - Daily usage |
| 160 | +3. `make build-macos` or build process - Create executables |
| 161 | + |
| 162 | +**Alternative Makefile usage (macOS/Linux):** |
| 163 | +```bash |
| 164 | +make venv install # Equivalent to setup script |
| 165 | +make run-pyqt # Equivalent to run script |
| 166 | +make build-macos # Additional build functionality |
| 167 | +``` |
0 commit comments