Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Legacy: Updating Download Links

Süleyman Yasir KULA edited this page May 15, 2020 · 7 revisions
Click here to show/hide

Use the Patcher update_links command:

  • versionInfoPath: path of the VersionInfo.info file
  • linksPath: path of DownloadLinks.txt
  • silent: (optional)(flag) progress will not be logged to the console

Example: Patcher update_links -versionInfoPath="C:\Users\USERNAME\Desktop\PatchFiles\VersionInfo.info" -linksPath="C:\Users\USERNAME\Desktop\DownloadLinks.txt"

Via Scripting API

Click here to show/hide

Namespace: SimplePatchToolCore

public PatchUpdater( string versionInfoPath, LogEvent logger = null ): creates a new PatchUpdater instance. Path of the VersionInfo.info file should be passed to the versionInfoPath parameter. If a function is provided to logger (which has the signature delegate void LogEvent( string log )), this function will be called for each log. Otherwise, PatchUpdater will work silently. Please note that PatchUpdater works synchronously

bool UpdateDownloadLinks( string downloadLinksPath ): updates the download links inside VersionInfo using DownloadLinks.txt located at downloadLinksPath. Returns false, if downloadLinksPath doesn't point to an existing text file

bool UpdateDownloadLinks( Dictionary<string, string> downloadLinks ): updates the download links inside VersionInfo using downloadLinks dictionary (its key-value pairs should store {File relative path} {File download url}). Currently, this function always returns true

VersionInfo VersionInfo { get; }: returns the VersionInfo that this PatchUpdater is modifying. Feel free to make any changes to this VersionInfo object

void SaveChanges(): saves the changes to VersionInfo.info. Call this function after executing the UpdateDownloadLinks function or changing the properties of VersionInfo

Example code: SimplePatchToolConsoleApp.Program.UpdateLinks

Click here to show/hide

Open Window-Simple Patch Tool window, click the Open Legacy Window button and switch to the UPDATE tab:

unity-update-tab

These parameters correspond to the versionInfoPath and linksPath arguments mentioned in the console app section. If you want, you can copy&paste the download links directly to the specified text field so that you won't have to create a text file for the links (in this case, simply leave Download links holder blank).

Clone this wiki locally