Skip to content

nwn900/MO2-DownloadManager-Fix

Repository files navigation

MO2 Download Manager Fix

A Mod Organizer 2 plugin that fixes the get pending: invalid download index 0 error during mod downloads.

Supports: MO2 2.4.4, 2.5.0, 2.5.2


What This Fixes

MO2 has a bug in its DownloadManager where pending-download index state can become invalid, causing errors or crashes when downloading mods. The error looks like:

get pending: invalid download index 0

The root cause is in MO2's compiled C++ core — it cannot be fixed by a normal MO2 Python plugin alone. This plugin applies a version-specific binary patch to ModOrganizer.exe that hardens the pending-index handling.

How It Works

  1. Version detection — The plugin detects your MO2 version and checks the SHA256 hash of your ModOrganizer.exe against known stock and patched values.
  2. Diagnosis — MO2's Problems UI (bell icon) shows whether the fix is available, installed, or if your binary is unrecognized.
  3. Safe patching — When you apply the fix, the plugin:
    • Creates a full backup of your original ModOrganizer.exe
    • Launches an external helper script that waits for MO2 to fully exit
    • Applies a block-compressed binary diff to produce the patched executable
    • Verifies the SHA256 hash matches the expected patched value
    • Replaces the file atomically
  4. Full revert — Restore your original binary from backup at any time.

Safety

  • Never modifies files while MO2 is running — the helper waits for MO2 to exit
  • Full SHA256 verification before and after every write
  • Atomic file replacement — written to temp file first, then renamed
  • Refuses unknown hashes by default — won't touch custom builds
  • Never touches user data — profiles, mods, downloads, settings are all protected
  • Full revert from automatic backup

Installation

  1. Close Mod Organizer 2
  2. Download the latest release from the Releases page
  3. Extract mo2_downloadmanager_fix.zip into MO2's plugins/ directory
  4. The result should be: MO2/plugins/mo2_downloadmanager_fix/
  5. Restart MO2

Usage

Check Status

Open MO2 and look at the Problems UI (bell icon in the toolbar):

  • "DownloadManager fix not installed" — your MO2 is supported and the fix is ready to apply
  • No problem shown — the fix is already installed
  • "Unsupported MO2 version" — your MO2 version doesn't have a payload

Apply the Fix

  1. Open Tools → Backport Manager
  2. Go to the Apply tab
  3. Check "DownloadManager pending-index fix"
  4. Click Apply Selected
  5. Confirm the replacement
  6. Close MO2 — the helper will detect MO2 has exited and apply the patch
  7. Restart MO2
  8. The bell icon should no longer show a problem

Revert

  1. Open Tools → Backport Manager
  2. Go to the Revert tab
  3. Click Revert Latest Overlay
  4. Confirm and close MO2
  5. Restart MO2

How It's Packaged

The plugin ships as a self-contained Python package with its own bundled Python interpreter — no external dependencies required.

mo2_downloadmanager_fix/
├── plugin.py                 MO2 plugin entry point
├── tool_ui.py                Backport Manager dialog (PyQt6/PyQt5)
├── manifest.py               Payload manifest loading & validation
├── audit.py                  Version/hash detection & state classification
├── diagnose.py               Problem reports for MO2's Problems UI
├── operations.py             Apply/revert request creation
├── paths.py                  Path resolution & safety checks
├── logging.py                Structured logging
├── __init__.py               Package entry point
├── payloads/
│   ├── 2.4.4/
│   │   ├── manifest.json     File hashes & metadata
│   │   └── diff.bin          Block-compressed binary diff
│   ├── 2.5.0/
│   │   ├── manifest.json
│   │   └── diff.bin
│   └── 2.5.2/
│       ├── manifest.json
│       └── diff.bin
├── helper/
│   └── mo2_backport_helper.py   External patching script
├── py/
│   └── (Python 3.12.9 embeddable — official signed from python.org)
├── docs/
│   ├── SAFETY.md
│   └── TROUBLESHOOTING.md
└── payloads/
    └── run_helper.cmd           Launcher for the helper script

Requirements

  • Windows 64-bit
  • Mod Organizer 2 version 2.4.4, 2.5.0, or 2.5.2
  • No external dependencies — bundled Python interpreter included

Troubleshooting

See docs/TROUBLESHOOTING.md for common issues.

Safety Documentation

See docs/SAFETY.md for the complete safety rules and guarantees.

Building from Source

Python Plugin

No build required. The plugin runs as-is in MO2's Python plugin system.

Generating Diffs

Binary diffs are generated by comparing stock and patched ModOrganizer.exe builds using generate_diffs_v2.py in the project repository root.

License

This project is distributed as a community fix for Mod Organizer 2. The patched binaries contain derivative works of MO2 and are distributed under GPLv3.

Credits

Based on the DownloadManager backport work by nwn900. Bundles Python 3.12.9 embeddable distribution under the PSF license.

About

Mod Organizer 2 plugin that fixes the 'get pending: invalid download index 0' DownloadManager error for MO2 2.4.4, 2.5.0, and 2.5.2

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors