Autoupdate installers in unattended mode
asked 14 Sep '11, 09:57
Autoupdate installer can be executed in unattended mode as regular InstallBuilder installers does but depending on additional command line flags, it behavior varies:
In this mode, the autoupdate is executed as a checker. It will return a '0' exit code if it finds a new update and a positive integer otherwise. The snippet below shows how to use it from an InstallBuilder installer which bundled the autoupdate:
You can find additional information about how to unpack files in this article
The default unattendedmodebehavior is "check" so it can be omitted. If instead of only check for updates you want to download and install the update, the unattendedmodebehavior has to be set to "download".
As we already mentioned, a '0' return code means "An update is available" and "No update available" otherwise but in some scenarios we need more information. To provide this information, the Autoupdate uses the below summarized return codes:
Return codes 0, 1, 2 and 5 are common for both modes while 3-4 are exclusive to 'download' mode.
When launching the Autoupdate from a Windows cmd, as it is compiled as a GUI application, it will launch it in background, reporting 0 as the exit code if the file can be executed. To force the cmd to wait for the process to finalize and retrieve the correct code returned by the Autoupdate it should be launched as:
This is not necessary if the Autoupdate is launched from a BitRock installer using a action.
If no errors occurs in the process this will download and install the update. However, if the update is a big file you may want to show some feedback. To achieve it you can add
answered 14 Sep '11, 10:07