MinUpdater Documentation

A simple and easy updater for your applications.




Introduction

Welcome to MinUpdater documentation! Here you'll find out how easy and fast is using MinUpdater to distribute updates for your software. MinUpdater works with every programming language able to connect to the internet (ofc). Let's get started!


How MinUpdater works

MinUpdater works with two little php scripts. upd.php: that outputs the latest version available, so you can compare it with the local one and upd.php: that is called when there's a new version of your software available to get the URL of the latest version, so the user (or the software, according if you are using a Manual or Automatic updater) can download it.

API Reference for upd.php

upd.php returns the latest version of your software (remote version). You can use it to compare the local version of your software, with the remote one. If the local and the remote versions are the same, the software is updated. If the local version is less than the remote one, there's a new update available and, in that case, you'll call upd.php

Input Name (GET)

Input Description

id The ID of your updater.
You can find it in the Manage page.

Output

Conditions

The latest version of your software Everything is working fine.
error: get Can't find "id" parameter with GET.
error: id Invalid Updater ID.

// Current software version variable int currentVersion = 100 // Grab the latest version from MinUpdater int latestVersion = read_http("https://mu.nyodev.xyz/upd.php?id=12"); // Compare the latest version with the current one if (currentVersion == latestVersion) show_message("Software is up to date!"); else if (currentVersion < latestVersion) show_message("There's a new version of this software available!");



API Reference for upd.php

upd.php should be called when there's a new version of your software available (you can check for that using upd.php, as we've already seen). This script will act according to your settings. If in your manage page you have set "Redirect to Download URL", when you open upd.php in your browser, you'll be redirected to the URL set in "Download URL". This is useful if you want your users to download the newer version and install it manually (by copying and replacing the files). Instead, If in your manage page you have set "Print Download URL", upd.php will simply print the URL inside "Download URL". This is useful if you want to make an automatic update system, so your software will grab the download URL, download it by its own and replace the files automatically.

Input Name (GET)

Input Description

id The ID of your updater.
You can find it in the Manage page.

Output

Conditions

Redirect to "Download URL" If "Action" set to "Redirect to Download URL"
Output "Download URL" If "Action" set to "Print the Download URL"
error: get Can't find "id" parameter with GET.
error: id Invalid Updater ID.
error: internal Internal MinUpdater DB/Script Error.

if (newUpdateAvailable()) { // There is a new update available! // Open MinUpdater's upd.php in browser, so the download of the new version .zip will start open_webpage("https://mu.nyodev.xyz/upd.php?id=12"); // Once the user has downloaded the new version .zip, // he will have to extract and replace all the files manually. } else { // No updates available. }

if (newUpdateAvailable()) { // There is a new update available! // Get new version .zip download URL string downloadURL = read_http("https://mu.nyodev.xyz/upd.php?id=12"); // Download new version .zip download_file(downloadURL, "update.zip"); // Extract the new version .zip zip_extract("update.zip","/"); // Software now updated! Restart application application_restart(); } else { // No updates available. }

You can find your upd.php and upd.php links by clicking the API URLs button in your Manage page.


Create your first updater

In order to use MinUpdater, you need an account. You can register one for free by clicking here. Once you have registered and logged into your account, you'll be redirected to the Manage page. From here you can manage all your updaters. To make an updater, simply click the "Add a new updater button". A new window will pop-up and you have to fill every field with the right informations.

Name

Description

Example

Name A name to distinguish this updater from the others My Application Updater
Version The current version of your software (numbers only) 122 (stands for 1.2.2)
Download URL The direct URL to download the current version of your software http://dropbox.com/update122.zip?dl=1
Action Action to perform when upd.php is called. See upd.php's API reference for more info. Redirect to Download URL
Once you've filled every field, click on "Create updater" to create your updater. Easy!



Add updater code in your software

Now that we have all the Web part, we need to write the updater code inside your application. This part might change based on the programming language that you are using or how your project works. I'll provide some example code in C# to use or adapt for your project.

First of all, we need to check for available updates. You can do that at the startup of your software, by clicking a button, or every X minutes. You'll need an integer variable to store the current version number. Then, we'll get the latest version number from MinUpdater by reading the content of upd.php. Lastly, we'll compare the current version with the remote one, provided by MinUpdater. If the numbers are the same, the software is up to date. If the local version is less than the remote one, there's a new update available.
If there's a new version available, we'll call upd.php. If you want to make a manual updater (so the user have to download the new version.zip and replace the files manually), we have to set "Action" to "Redirect to Download URL", so when the user visits upd.php, the download of the new version will start. Then, inside your application, we'll open a webpage to your upd.php. If you want to make an Automatic updater (so the software will download and extract automatically the new files), we have to set "Action" on "Output Download URL", so the software can grab the new version .zip URL from upd.php, download the .zip and extract it.

void updateSoftware() { currentVersion = YOUR_CURRENT_VERSION_HERE_INT; try { // Get upd.php content WebClient wc = new WebClient(); string s = wc.DownloadString("https://mu.nyodev.xyz/upd.php?id=YOUR_UPDATER_ID_HERE"); // Convert string into int to compare local and remove version var latestVersion = Int32.Parse(s); // Compare local and remote version if (latestVersion > currentVersion) { // New update available DialogResult d = MessageBox.Show("New update available. Download it now?", "Update", MessageBoxButtons.YesNo); if (d == DialogResult.Yes) { // User wants to download the latest version, open it in browser Process.Start("https://mu.nyodev.xyz/upd.php?id=YOUR_UPDATER_ID_HERE"); Environment.Exit(0); } } else { // Software is up to date } } catch { // 4xx / 5xx error } }




How to push new updates

Once you have all the code set up, releasing new updates for your users is very easy.
  1. First of all, compile your update (and zip it if necessary). Don't forget to increment the local version variable, otherwise the update system will not work as expected.
  2. Upload your new version .zip on a file hosting service (such as Dropbox or Copy).
  3. Get a direct link to download your zip file.
  4. Then, connect to MinUpdater website and login into your account.
  5. Find your updater on the Manage page.
  6. Change the Version Number and Download URL.
  7. Click on Update.
  8. Done! Now everyone can download your new update!



And now?

That's how MinUpdater works! Remember that you can create how many Updaters you want! If you have any problem, simply contact me and I'll do my best to help you! Thank you for using MinUpdater!