Use templates with Inno Setup Compiler Scripts

Inno Setup is a free installer for Windows programs, produced by Jordan Russell. It rivals many commercial installers. It uses scripts to control the installation. The script lines often apply to files on your computer, that are added to the installation file. We used to use Inno Setup compiler to make the installation files for our file listing program, DDFileCatcher, before we moved over to msi installation files.

Why use templates in Inno Setup Scripts?

Templates can be used in Inno Setup or any other script to reduce errors and to save repetition. For example, in the [Files] section of Inno Setup, a line to add a file looks like this:

Source: "C:\ruby\rake\ddfilecatcher3\ddfc300.exe"; DestDir: "{app}"; Flags: ignoreversion

Every file to be added will have the same format. A template for that line would be:

Source: "{{{filepath}}}"; DestDir: "{app}"; Flags: ignoreversion

In DDFileCatcher, simply drag and drop all the files for the Inno Setup files section onto DDFileCatcher, load the template above, and output the formatted file list to the Clipboard for pasting into your script. Each file's filepath will replace the {{{filepath}}} text in the template.

Several other lines from the Inno Setup script can be replaced by installer templates, such as [Run] section:

Filename: "{app}\{{{filename}}}"; Description: "Launch Program Name"; Flags: nowait postinstall skipifsilent

and [Icons] section:

Name: "{group}\Your Group Name"; Filename: "{app}\{{{filename}}}"

Using the Template Manager in DDFileCatcher, you can make a library of Inno Setup templates, which are saved in a file for use when needed. A template file can be made for each application or situation where custom templates for outputting file lists are useful.

Try using templates for Inno Setup Compiler Scripts yourself

You can download and try DDFileCatcher free for 30 days, and make as many scripts as you like, and for other file-listing tasks you have. Please download and install DDFileCatcher, and then download this file (a simple text file) containing the three Inno Setup line templates described above. Launch DDFileCatcher, and use the "Command files | Open a Template" menu to open the Inno Setup template file and use it on file lists. Play around with it to add your own custom templates.

Templates for inno setup compiler appliciation
  • Useful custom templates for all file listing tasks
  • Choose from over 700 file properties to include in the templates
  • Use templates for script files needing hard-coded filepaths
  • Save time, increase consistency
  • Use a custom template for snippets of code or file information you regulary pass to others
  • DDFileCatcher has lots of other features too!
Download | Features | Buy Now | Support | Screenshots | Revision history | Site index
DDFileCatcher Robinmatch Limited 2003-2013