Skip to content

API and customizations

Emanuele Manzione edited this page Apr 11, 2020 · 24 revisions

Use your own downloader

You can implement your own downloader for your Launcher, if needed. Just implement IDownloader interface in your own class as following:

public sealed class MyDownloader : MHLab.Patch.Core.Client.IO.IDownloader
{
    public event DownloadProgressHandler ProgressChanged;
    public event EventHandler DownloadComplete;

    public void Download(string url, string destinationFolder)
    {
        throw new NotImplementedException();
    }
}

then inject it into the Updater/Repairer/PatcherUpdater:

// This is taken from Launcher.cs, Initialize method.
_updater = new Updater(_context);
_updater.Downloader.DownloadComplete += DownloadComplete;
_updater.Downloader.ProgressChanged += DownloadProgressChanged;

Use your own logger

Checking if an update is available

Clone this wiki locally