Download File action
The Download File action downloads a file from the Internet or simulates downloading from a local file path. This action is typically used to obtain large installation files that are infrequently needed, for example a .Net runtime installer. The download action supports FTP, HTTP, HTTPS, and FILE protocols.
- The result of the download action is available through the LastExitCode variable. Typically, a value of 0 (zero) indicates success, while any other value indicates failure. Note that LastExitCode may indicate success even if the download failed; be sure to check the the LastStatusCode variable as well for HTTP[S] transactions.
- The result of the underlying HTTP[S] transaction (if any) is available through the LastStatusCode variable. This variable is only set if an HTTP[S] transaction was attempted; it is not set for the FTP or FILE protocols, nor is it set if the download was never attempted (for example, because you specified Download if: Local not present and a local file copy was already present).
The following attributes and options are available.
|Action name||Enter the name of the action. This name is only used in InstallMate and is not visible to the user.|
|Display text||Enter the localizable description of the action. This description is displayed in progress messages in the installer while the action is executing.|
|Localized||Check this box to localize the Display text field and use different display texts for different languages.|
Fully qualified URL of the file that must be downloaded. This can take on one of the following forms:
In all cases, server must be a server address that is valid for the protocol (for example, www.installmate.com for HTTP and HTTPS; ftp.tarma.com for FTP); it may furthermore include protocol-specific qualifiers such as www.installmate.com:8080 (a port number for HTTP) or firstname.lastname@example.org (a user name for FTP).
Note that for the FILE protocol the server portion is empty; hence the three consecutive /// characters in that case.
/path/to/file is the fully qualified path to the file on the server.
|Do not log URL||Check this box to prevent the Remote URL from being logged in the installer's log file; clear it to write the URL to the log file when the action is executed. This option is mainly useful if the Remote URL field contains sensitive information such as embedded login information for the server.|
Enter the local path to which the file must be downloaded, for example <PreinstallFolder>\dotnetfx.exe. The path must be fully qualified or the file will end up in an unpredictable location.
|Download if||Select the desired download type from the drop-down list. The following choices are available:
Tip: In addition to the Download if setting, the download action is also affected by the settings of the Overwrite R/O local file and the Reload from server options (see below). To make sure that the file is always downloaded afresh from the remote server, you should set all of the following:
|Reload from server||
Check this box to force a fresh download of the file from the remote server, bypassing the Internet Explorer cache; clear the box to use a cached download copy if it exists.
This option is mostly useful if you know or suspect that the remote file will change frequently or is generated on-the-fly for each new download request. In other situations using the Internet Explorer cache is recommended, particularly if the file to be downloaded is larger than a few MB in size.
Check this box to download and overwrite the local file even if the file at Local path has its Read-only attribute set; clear the box to leave local files that are marked Read-only intact.
Note: This does not override other access permissions that prevent write access to the local file; it only overrides the Read-only file attribute.
|Check digital signature||
Check this box to check the digital signature on the downloaded file; clear it to omit the check.
If you check this option and the downloaded file does not have a signature or the signature is not valid, then the file will be deleted immediately and the LastExitCode variable is set to a suitable (nonzero) value. This is the recommended option for executable files, because it offers some protection against rogue or malformed programs.
Note: Executable files do not automatically contain a digital signature. If you want to use this option for your own executable files (including possibly additional installers), then you must sign those files yourself with a valid code signing certificate. See Digital signatures for more information about the general process, and Digitally Signing the Setup Package for information about signing your own installers.
|Delete at end of session||
Check this box to delete the file automatically at the end of the installer session; clear it to retain the file.
This option is useful if the download file is used only once, as for example third-party installers often are. As an alternative, you can download the file to the <PreinstallFolder> location; all files in this folder are also automatically removed at the end of an installation session.
|Condition||Enter the conditional expression that determines if the action will be executed, or leave empty for unconditional execution.|
|Disabled||Check this box to disable the action. A disabled action is not included in the installer and not checked during the build. You can use this option to remove actions temporarily from your installer without permanently deleting them. Disabled actions are shown with a grayed-out icon.|
|Platforms...||Click this button to open the Select Installation Platforms dialog box that allows you to select the Windows versions on which the action must be executed. This platform selection acts as an additional condition for the action.|