diff --git a/Install_README.md b/Install_README.md new file mode 100644 index 0000000..19ede04 --- /dev/null +++ b/Install_README.md @@ -0,0 +1,77 @@ +# RHCI Foundation Instructor Toolkit - Installation Guide + +A GUI application for managing RHCI Foundation tasks and configurations. + +## Building the Application + +### Prerequisites +- Python 3.x +- pip (Python package manager) + +### Required Python Packages +```bash +pip install pyinstaller PyQt5 pyyaml +``` + +### Build Steps +1. Clone or download this repository +2. Navigate to the project directory +3. Run PyInstaller with the provided spec file: +```bash +pyinstaller menu.spec +``` + +## Installation + +### Required Files +After building, you'll need the following files in your target directory: +- `RHCI_Toolkit` (the binary from the `dist` directory) +- `config.yml` (your configuration file) +- `logo.png` (your logo image) +- `smallicon.png` (your application icon) + +### Installation Steps +1. Copy the `RHCI_Toolkit` binary from the `dist` directory to your target location +2. Copy your `config.yml`, `logo.png`, and `smallicon.png` files to the same directory as the binary +3. Make the binary executable: +```bash +chmod +x RHCI_Toolkit +``` + +## Running the Application + +### Standard Run +To run the application with the default config.yml in the same directory: +```bash +./RHCI_Toolkit +``` + +### Custom Config +To run the application with a different config file: +```bash +./RHCI_Toolkit /path/to/custom/config.yml +``` + +## Configuration +The application uses an external `config.yml` file for configuration. You can modify this file without rebuilding the application. The config file should be in the same directory as the executable. + +### Config File Structure +```yaml +icon: smallicon.png +logo: logo.png +logo_size: 320x240 +menu_title: RHCI Foundation Instructor Toolkit +num_columns: 2 + +menu_items: + - name: Menu Name + column: 1 + button_info: "Menu description" + items: + - name: Command Name + command: "command to execute" + button_info: "Command description" +``` + +## Support +For issues or questions, please contact the development team. \ No newline at end of file diff --git a/menu.py b/menu.py index 04abf30..4d78c2a 100644 --- a/menu.py +++ b/menu.py @@ -732,6 +732,16 @@ def clear_output(self): # Allow passing config file as argument if len(sys.argv) > 1: config_file = sys.argv[1] + else: + # If no config file specified, look in the same directory as the executable + if getattr(sys, 'frozen', False): + # If the application is run as a bundle + application_path = os.path.dirname(sys.executable) + else: + # If the application is run from a Python interpreter + application_path = os.path.dirname(os.path.abspath(__file__)) + + config_file = os.path.join(application_path, "config.yml") app = QApplication(sys.argv) window = MenuApplication(config_file) diff --git a/menu.spec b/menu.spec new file mode 100644 index 0000000..2334597 --- /dev/null +++ b/menu.spec @@ -0,0 +1,44 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + +a = Analysis( + ['menu.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=['PyQt5.QtCore', 'PyQt5.QtGui', 'PyQt5.QtWidgets'], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) + +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='RHCI_Toolkit', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon='smallicon.png' +) \ No newline at end of file