The Actual Updater package contains only two files: Updater.exe and Config.exe .
Updater.exe is the main updater file that will be used for checking for updates:
Updater.exe uses file "Updater.ini" (or "Uninstall.ini" in case you use Actual Installer to distribute your program) that contains basic information of your program: Name, GUID, URL of Update Information File, etc..
These two files must be located in your app's main folder:
To create file "Updater.ini" and copy these two files into your app's folder use "Actual Updater Configuration Tool" (Config.exe, see shortcut on Desktop):
Enter your Product Name, GUID, select the main executable file (or any other file from the main folder of your application), choose where to get Product Version number (by default (if you know GUID), from Registry), and specify the URL of Update Information File (see below). After that, click "Generate Updater.ini".
What is GUID?
Product GUID is a reference number used as an identifier of your product.
Most installers generate a unique product GUID for every application and write it to Registry during installation. Here is how to get it from some installers:
- Actual Installer: see the section "General - Parameters"
- Inno Setup: open script file and look for "AppId="
- NSIS: open script file and look for "!define MUI_PRODUCT"
If you don't know the GUID of your product, then enter the Product Name in that field and choose "Main Executable File" in "Extract Version Number from" section.
Update Information File - is a plain text file (e.g. update.txt) that contains the information about new version: new version number and link to download this version:
You can create this file manually or by using "Actual Updater Configuration Tool". This file should be uploaded to your web server, so Updater.exe can access it, like this:
Every time when you release a new version of your program, you should also update this file on your server.
When a user launches the Updater.exe (as "Check for Updates" shortcut from "Start Menu \ You App" or from your app menu "Help \ Check for Updates"), Updater.exe does the following:
1. Reads the program info from Updater.ini and extracts the currently installed version of program (from Regsitry or Main Executable);
2. Downloads the Update Information File (update.txt) from specified URL;
3. Compares new version number and currently installed version number of the program;
4. Prompts to download if it is newer or exits.
Updater.exe supports the following command line parameters (switches):
/S - checks for updates in the silent mode. Message only appears if an update is available. No other messages (including connection error);
/A - automatically checks for updates on updater start. This parameter is recommended to use when calling Updater.exe from your program (e.g. from menu "Help \ Check for Updates").
Example: Updater.exe /A
/Q - quiet mode (super silent), no messages, only exit codes;
The following switches are supported only by the Pro edition:
/O - Opens the Options dialog. If specifid "/O i", where i - is a number, then also sets the item of the option "Automatically Check for Updates": i = 0 sets "at System startup", i=1 - Every Day, i=2 - Every Week, i=3 - Every Month
/CHECKAUTORUN - Checks if the option "Automatically Check for Updates at System startup" is enabled (return code is 10) or disabled (return code is 11). Cannot be used with switch /S
/AUTORUNON i - Turns on the option "Automatically Check for Updates" - for i = 0 uses "at System startup", i=1 - Every Day, i=2 - Every Week, i=3 - Every Month
/AUTORUNOFF i - Turns off the option "Automatically Check for Updates" - for i = 0 uses "at System startup", i=1 - Every Day, i=2 - Every Week, i=3 - Every Month
/AUTORUNAPPOFF - Turns off the option "Automatically Check for Updates at Main Executable Launch"
You may add the feature to check for updates into your app's start section (use the /S switch), or add the menu "Check for Updates" into the app's menu Help (use the /A switch).
Here are some code examples on how to launch Updater.exe with switch "/A":
#include "Shlwapi.h" ShellExecute(NULL, NULL, "Updater.exe", "/A", NULL, SW_SHOWNORMAL);
//don't forget to include ShellAPI into USES section ShellExecute(0, 'open', 'Updater.exe', '/A', nil, SW_SHOWNORMAL);
Dim pHelp As New ProcessStartInfo pHelp.FileName = "Updater.exe" pHelp.Arguments = "/A" pHelp.UseShellExecute = True pHelp.WindowStyle = ProcessWindowStyle.Normal Dim proc As Process = Process.Start(pHelp)
string arg = @"/A"; string command = "Updater.exe"; ProcessStartInfo start = new ProcessStartInfo(command, arg); start.UseShellExecute = false; start.CreateNoWindow = true; // Important if you want to keep shell window hidden Process.Start(start).WaitForExit(); //important to add WaitForExit()
Updater.exe returns the following exit codes:
0 - No updates available;
1 - Configuration file not found;
2 - Unable to read product details;
3 - Unable to connect to the update site;
4 - Incorrect update information file;
5 - Update available.
The Advanced features are available in the Actual Updater Pro edition. More information.