Build Actions
The Build Actions dialog box is one of the pages that appears when you
click Advanced... on the Build Configuration attributes pane
(both MSI
and Tarma).
It allows you to specify external actions that are performed during each project
build.
External build actions
External build actions are specified as command lines, much as you would enter
commands in a command prompt window. At build time, Tarma ExpertInstall writes
the build action commands to a temporary batch file, starts a command processor
to execute the batch file, waits until the command processor has finished
executing the batch file, then resumes the build process.
Some hints and tips:
- The build actions' commands are written to separate batch files for each
stage of the build process. The batch files are written to your TEMP folder
and are retained until the next project build. You can use this feature
for diagnostic purposes (the contents of each batch file are also copied
to the build log).
- The batch files are executed with the current directory set to the project
folder, so any file names that you specify should either be fully qualified,
or relative to the project folder.
- Tarma ExpertInstall uses the COMSPEC environment variable to determine which
command processor to use. Therefore, if you have installed an alternate
command processor such as JP Software's 4NT, you can take advantage of
their extended command syntax in the build actions if the COMSPEC environment
variable is set to point to the alternate command processor.
- Command line redirection works as expected. In particular, you can use
> and >> to capture output from your commands, if desired.
- You can use product variables as part of the command lines. Product variables
that contain system information lookup (using the syntax <@...>,
<%...>, or <#...>; see Product
Variables for details) are resolved on the system on which Tarma ExpertInstall
runs. See Build-time
variables for a list of product variables that are useful at build
time.
- Be sure to quote any file names that include spaces. This also applies
to build-time variables such as <BuildTarget>,
which might expand to include spaces. If necessary, inspect the build
log or the batch files that Tarma ExpertInstall generates if you encounter
any problems in this respect.
- During the build process, Tarma ExpertInstall opens the build log file with
read-only sharing. Therefore, your custom actions cannot write to the
build log file and can only read it if they open it with read-only access.
Attempts to open the log file with both read and write access (even if
only to read it) will fail.
Local and global actions
The Build Actions dialog box contains two sets of build actions: local
and global.
- Local actions are specific to a particular build configuration
and are only executed if that configuration is checked or built.
- Global actions are associated with the project as a whole. They
are executed at the beginning or end of the entire build process.
The order in which build actions are performed during a project build is as
follows:
Global: Before any configuration
Config 1: a. Before preflight
b. (preflight check)
c. Before each build
d. (target build)
e. After each build
...repeat a-e for each target of this configuration...
Config 2: a. Before preflight
b. (preflight check)
c. Before each build
d. (target build)
e. After each build
...repeat a-e for each target of this configuration...
...repeat per-configuration actions for any further configurations...
Global: After all configurations
Dialog fields and options
All actions should be entered as command lines, similar to the command lines
that you would use in a command prompt window. See External build actions
above for details.
Before each preflight check
(Local action) Enter the actions that you want performed before each preflight
check of this configuration.
Before each build
(Local action) Enter the actions that you want performed before each target
build of this configuration.
After each successful build
(Local action) Enter the actions that you want performed after each successful
target build of this configuration.
Before any configuration is checked or built
(Global action) Enter the actions that you want performed at the very start
of the build process.
After all configurations are checked or built
(Global action) Enter the actions that you want performed at the very end of
the build process.