Does files I am optionally downloading with Inno Setup 6.1.1 have to be in the [Files] section?

Viewed 151

The sample provided for Inno Setup 6.1.1 beta (CodeDownloadFiles.iss) has this in the [Files] section:

; These files will be downloaded
Source: "{tmp}\innosetup-latest.exe"; DestDir: "{app}"; Flags: external
Source: "{tmp}\ISCrypt.dll"; DestDir: "{app}"; Flags: external

At the moment I do not have such entries in my script. This is because we conditionally decide if we need to download the relevant files at install time (as discussed here in other SO questions).

Is there a ramification that I need to be aware of since I don't add the tries to the [Files] section?

Note, the files we optionally download are:

  • Microsoft .NET Framework
  • Visual Studio Runtimes 32 bit
  • Visual Studio Runtimes 64 bit
  • Localized CHM help file

For the first 3 I would not expect to try and uninstall them if the user uninstalled my app. As for the CHM file, it does not create an entry in the Add / Remove anyway and we manually try to delete it at uninstall time:

; The user might have downloaded offline help documentation
Type: files; Name: "{app}\MeetSchedAssist.chm"

So, does it matter that I don't have the files I am optionally downloading in the [Files] section?

1 Answers

You use the [Files] section for files that you want to either:

  1. pack into the installer, and copy to the target machine (the most common case);
  2. pack into the installer, but use only for the installer support (like DLLs, sub-installers, etc.) – using Flags: dontcopy;
  3. copy to the target machine from external sources – using the Flags: external.

Your first three files seems to be sub-installers that you want to download (external source), but execute only (installer support, not copy to the target machine). So they do not fall into any the above three categories.

Your help file falls into category 3. As you download it only conditionally, you need to handle the conditionality in the [Files] section too (in addition to the download). Typically you do that using the Tasks or Components parameters.

Related