GXM Packager

Create GXM executable files for guideXOS with ease

What is GXM Packager?

GXM Packager is a tool for creating GXM (guideX Module) executable files for guideXOS. It packages binary code or GUI scripts into the proper GXM format with headers that guideXOS can load and execute.

✨ Two Versions Available:

GUI Version - Windows Forms application with built-in script editor
Console Version - Command-line tool for automation and CI/CD


What's New 🔥

Recent updates have significantly enhanced the GXM Packager GUI experience:

✅ New Features
  • OpenFileDialog Integration - Browse and select input files with native Windows dialogs
  • SaveFileDialog Integration - Save GXM packages with automatic file extension handling
  • Built-in Script Editor - Full-featured editor with syntax-friendly dark theme
  • Template System - Quick insert templates for Window, Button, Label, TextBox, and more
  • Keyboard Shortcuts - Ctrl+N/O/S for New/Open/Save operations
  • Unsaved Changes Protection - Prompts before losing work
  • Status Bar - Real-time line, column, and character count display
  • Edit Existing Scripts - "Edit" button to modify selected script files
  • Create New Script Button - Dedicated button for quick script creation workflow
  • Auto-fill Outputs - Automatically suggests output filenames based on input
  • Complete Template - One-click insertion of full app template with window properties
  • Help System - Built-in command reference with all GUI script commands
💡 Enhanced Window Properties Support

Scripts now support advanced window properties:

  • RESIZABLE|true/false - Control window resizing
  • TASKBAR|true/false - Show/hide in taskbar
  • MAXIMIZE|true/false - Enable maximize button
  • MINIMIZE|true/false - Enable minimize button
  • TOMBSTONE|true/false - Enable tombstone feature
  • STARTMENU|true/false - Show in start menu

GUI Version

Main Interface

  • File Selection with Dialogs
    • Input File Browse - Opens OpenFileDialog with filters for Binary Files, Text Files, and All Files
    • Output File Browse - Opens SaveFileDialog with automatic .gxm extension and proper filters
    • Script File Browse - Opens OpenFileDialog for selecting existing GUI script files
  • Visual Options - Set entry point, version, and script options with GUI controls
  • Real-time Log - Color-coded terminal output showing packaging progress
  • Input Validation - Prevents common mistakes and errors
  • Help System - Built-in command reference and documentation

Dialog Features

Input File Dialog:
📂 Filter Options:
  • All Files (*.*) - Default
  • Binary Files (*.bin;*.exe)
  • Text Files (*.txt)

Output File Dialog:
💾 Automatic Features:
  • Default extension: .gxm
  • Filter: GXM Files (*.gxm) | All Files (*.*)
  • Overwrite protection built-in

Script File Dialog:
📝 Script Selection:
  • Filter: Text Files (*.txt) | All Files (*.*)
  • Direct load into textbox field
  • Can open in editor with "Edit" button

Screenshot

┌──────────────────────────────────────────────────────────┐
│                      GXM Packager GUI v1.0                       │
│        Package binary files and GUI scripts into GXM            │
├─────────────────────────────────────────────────────────────────│
│ Input File:  [_____________________________] [Browse...]        │
│ Output GXM:  [_____________________________] [Browse...]        │
├────────────────────────────────────────────────────────────│
│ ┌── Options ───────────────────────────────────────────┐ │
│ │   Entry Point: [0x0   ]  Version: [1    ]                │ │
│ │   ☑ Include GUI Script: [__________] [Browse] [Edit]  │ │
│ │                                                           │ │
│ │   [📝 Create New Script]                                 │ │
│ └─────────────────────────────────────────────────────────────────────│ │
├───────────│
│ Log:                                                            │
│ ┌──────────────│
│ │ Starting GXM packaging...                                   │ │
│ │ =====================================                       │ │
│ │ Successfully packaged!                                      │ │
│ └───────────│
│ [Help] [Clear]                              [Package GXM]       │
└──────────────────────────────────────────────────────────│

Built-in Script Editor 📝

The GUI version includes a powerful full-featured script editor for creating and editing GXM GUI scripts:

Editor Features

  • Dark Theme - Easy on the eyes with Consolas monospace font and syntax-friendly colors
  • Template Insertion - Quick insert via Insert menu dropdown with 10+ templates
  • Complete Template - One-click insertion of full application template with all window properties
  • Auto-save Protection - Prompts before losing unsaved work (shows * in title)
  • Status Bar - Real-time display of line, column, and character count
  • File Operations - New, Open, Save, Save As with full support for .txt files
  • Keyboard Shortcuts
    • Ctrl+N - New file
    • Ctrl+O - Open file
    • Ctrl+S - Save file
    • Ctrl+Shift+S - Save As
  • Integrated Help - Complete command reference accessible from toolbar Help button
  • Auto-fill Workflow - Saved scripts automatically populate input/output fields in main window

Available Templates

  • Window
  • Window Properties (all 6 properties)
  • Label
  • TextBox
  • Button
  • List
  • Dropdown
  • OnClick Event
  • OnTextChange Event
  • Complete Template (full app)

Editor Interface

┌─ GXM Script Editor ──────────────────────────────────────────────┐
│ ┌─ Toolbar ────────────────────────────────────────────────────│ │
│ │ [New] [Open] [Save] [Save As] | [Insert ▼]        [Help] │ │
│ └───────────────────────────────────────────────────│ │
├───────────│
│ ┌─ Editor (Dark Theme, Consolas Font) ───────────────────────────┐ │
│ │                                                                │ │
│ │  WINDOW|My Application|400|300                                 │ │
│ │  RESIZABLE|true                                                │ │
│ │  TASKBAR|true                                                  │ │
│ │  MAXIMIZE|true                                                 │ │
│ │  LABEL|Hello World!|20|50                                      │ │
│ │  BUTTON|1|Click Me|20|100|120|30                               │ │
│ │  ONCLICK|1|NOTIFY|Hello!                                       │ │
│ │                                                                │ │
│ │  (Supports tab indentation, multi-line editing)                │ │
│ │                                                                │ │
│ └───────────────────────────────────────────────────│ │
├───────────│
│ ┌─ Status Bar ───────────────│
│ │ Line 7, Col 23                              267 characters   │ │
│ └───────────│
│ [Help] [Templates... ]                                          [OK]   │
└───────────│

Opening the Editor

There are three ways to open the script editor:

  • "Create New Script" Button - Opens editor with blank template, auto-populates fields after save
  • "Edit" Button - Opens editor with currently selected script file loaded
  • Template Workflow - Click Insert menu to add common elements, save when done

Complete Template Example

The "Complete Template" option inserts a fully-functional app template:

WINDOW|My Application|400|300
RESIZABLE|true
TASKBAR|true
MAXIMIZE|true
MINIMIZE|true
TOMBSTONE|true
STARTMENU|true
LABEL|Welcome to my app!|20|40
BUTTON|1|Click Me|20|100|120|30
BUTTON|2|Show Info|160|100|120|30
BUTTON|3|Close|300|100|120|30
ONCLICK|1|NOTIFY|Button 1 clicked!
ONCLICK|2|NOTIFY|Information message
ONCLICK|3|CLOSE|
💡 Pro Tip:

Use Complete Template as a starting point, then customize window properties and add more controls as needed!


Console Version

Usage

GXMPackager <input.bin> <output.gxm> [options]

Options:
  --entry <offset>    Entry point RVA (default: 0)
  --version <number>  Version number (default: 1)
  --script <file>     Add GUI script from file

Examples:
  GXMPackager app.bin app.gxm
  GXMPackager app.bin app.gxm --entry 0x1000 --version 2
  GXMPackager gui.txt demo.gxm --script gui.txt

When to Use Console Version

  • Build Automation - Integrate into build scripts
  • CI/CD Pipelines - Automated packaging in continuous integration
  • Batch Processing - Package multiple files with scripts
  • Linux/macOS - Cross-platform support (GUI is Windows-only)

Key Features

Two Packaging Modes

GUI Script Apps

Package text-based GUI scripts (50-500 bytes)
✅ No compilation needed
✅ Perfect for prototypes
✅ Instant packaging
✅ Built-in editor with templates

Binary Apps

Package native compiled executables
✅ Full C# applications
✅ NativeAOT compilation
✅ Production apps (50KB-500KB)

GXM Format Support

  • Proper Headers - Magic signature, version, entry point, size
  • GUI Script Marker - Automatic insertion of script marker when enabled
  • Validation - Ensures format compliance before packaging
  • Debugging Info - Detailed log output for troubleshooting

Quick Start

Create Your First GXM App (GUI Version)

1. Launch GXMPackager.GUI.exe
2. Click "📝 Create New Script"
3. Click "Insert" → "Complete Template"
4. Edit window title, button text as desired
5. Press Ctrl+S, save as "myapp.txt"
6. Click "OK"
7. Click "Package GXM"
8. Done! You have myapp.gxm ready to run in guideXOS!

Time: 30 seconds

Using OpenDialog and SaveDialog

# Browse for input file:
1. Click "Browse..." next to Input File
2. OpenFileDialog appears with filters
3. Select your binary or script file
4. Path automatically fills the textbox

# Choose output location:
1. Click "Browse..." next to Output GXM
2. SaveFileDialog appears
3. Navigate to desired folder
4. Enter filename (e.g., "myapp")
5. Extension .gxm is added automatically
6. Click Save

# No more manual path entry needed! 🎉

Create Your First GXM App (Console Version)

# 1. Create a simple GUI script with window properties
echo "WINDOW|Hello|300|200" > hello.txt
echo "RESIZABLE|true" >> hello.txt
echo "TASKBAR|true" >> hello.txt
echo "LABEL|Hello World!|20|50" >> hello.txt
echo "BUTTON|1|OK|20|100|100|30" >> hello.txt
echo "ONCLICK|1|CLOSE|" >> hello.txt

# 2. Package it
GXMPackager hello.txt hello.gxm --script hello.txt

# 3. Copy to guideXOS
copy hello.gxm guideXOS\Ramdisk\Programs\

# 4. Rebuild guideXOS and test!

Testing in guideXOS

# In guideXOS console:
cd Programs
hello

# Or use launch command:
launch hello

Building from Source

Prerequisites

  • .NET 9.0 SDK or later
  • Windows (for GUI version), any OS (for console version)
  • Visual Studio 2022 or VS Code (optional)

Build Console Version

cd GXM.Apps/GXMPackager
dotnet build -c Release

# Output:
# bin/Release/net9.0/GXMPackager.dll
# bin/Release/net9.0/GXMPackager.exe (Windows)

Build GUI Version

cd GXM.Apps/GXMPackager.GUI
dotnet build -c Release

# Output:
# bin/Release/net9.0-windows/GXMPackager.GUI.exe

Build Both at Once

cd GXM.Apps
dotnet build GXM.Apps.sln -c Release
💡 Pro Tip:

Run build-all.ps1 to build and create sample GXM files in one step!


📚 Full Documentation:

Complete guides, examples, and troubleshooting available in the GXM.Apps/ directory in the source repository.