This sections contains commands that will be executed at the beginning of a build before any other processing occurs.
Commands placed in this section will be executed whenever one of the following events occurs:
- The
Buildbutton is pressed, starting a project build. - When a Codebox is executed
- When the
Runbutton on an individual script is pressed - When a control on the script's Graphical User Interface triggers a code section to run
This documentation refers to the Process section located within the script.project file. For documentation relating to the Process section of individual scripts refer to Script Process.
Because this section is processed every time a project build is started or a script in the project is executed manually, usage of this section should be limited to functions that are Global in nature and are essential to the project. Failure to do so may result in performance penalties and slower build times.
Project Main, Project Variables, Script Interface, Script Main, Script Process, Script Variables
In this example we use the script.project process section to define a cleanup function using System,ONBUILDEXIT, to ensure any hives or mounted WIM images are cleaned up, even if a script fails and the build halts.
[Main]
Title=myProject
Description=Example Project
Author=Homes32
Version=1
[Variables]
[Process]
System,ONBUILDEXIT,Exec,%ProjectDir%\script.project,myProject-ONBUILDEXIT
[myProject-ONBUILDEXIT]
// Make sure all registry hives are unloaded.
RegHiveUnload,%RegSystem%
RegHiveUnload,Tmp_Software
RegHiveUnload,%RegDefault%
RegHiveUnload,%RegComponents%