Skip to content

Repository files navigation

ModUpdater — BepInEx Auto-Update System

Build Notes

You must have Onward 1.7 installed in the steam/common folder with the mod installed. The mod injector looks for the .dlls in there.

Files

File Purpose
Models.cs Data models: RemoteModEntry, LocalModManifest, UpdateResult
SemVer.cs Lightweight Major.Minor.Patch comparison
ModUpdater.cs Core pipeline: fetch → diff → download → extract → callback
MainThreadDispatcher.cs Queues callbacks onto Unity's main thread safely
ModUpdaterPlugin.cs Example BepInEx plugin wiring everything together
example_mod_manifest.json Sample remote JSON to host on GitHub

Setup

  1. Host the JSON manifest — push example_mod_manifest.json (renamed as needed) to a GitHub repo and grab the raw URL.

  2. Host zip files — each mod is a .zip whose contents will be extracted directly into BepInEx/plugins/<ModName>/. Structure the zip however your mod needs (DLLs, assets, configs, subfolders — all preserved).

  3. Add to your project — drop the .cs files into a BepInEx plugin project. Required references: UnityEngine, BepInEx, System.IO.Compression (ships with .NET Framework 4.6+ / .NET Standard 2.0).

  4. Update the URL in ModUpdaterPlugin.cs to point at your manifest.

Public API

// Create the updater
var updater = new ModUpdater(remoteUrl, Paths.PluginPath, OnComplete);

// Kick off (non-blocking, runs on background thread)
updater.StartUpdate();

// Poll from Update() or a UI coroutine
string status = updater.GetCurrentStatus();
// → "Downloading CoolMod (2/5)…"

// Completion callback (fires on main thread)
void OnComplete(UpdateResult result)
{
    // result.Success      — true if zero errors
    // result.UpdatedCount — how many mods were downloaded
    // result.FailedMods   — list of mod names that errored
}

How version comparison works

Versions follow Major.Minor.Patch (e.g. 1.2.3).
A remote mod is downloaded only when its ModNumber is strictly greater than the locally recorded version for the same UUID.

Error handling

  • Individual zip download/extraction failures are logged via Debug.LogError, skipped, and the pipeline continues.
  • After all mods are processed, if any failed, a file mod_update_errors.txt is written into the plugins folder listing every failed mod name.
  • The UpdateResult.Success bool will be false if any mod failed.

Local manifest

A mod_manifest.json file is maintained in BepInEx/plugins/ tracking every installed mod's UUID and version. This is what gets compared against the remote list on each run.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages