Build Events Tab
In this page you can specify commands to be executed in current build process. Events can be scheduled to be executed before build or after build.
The information presented in this article can be applied in a similar fashion to Build Events Tab from Patch Project and Updates Configuration Project.
Global builds events are executed for all builds from the list. If you want to have events defined only for a certain build, you must first select the build and then go to “Build Events” tab from the right side pane.
Creating a new event
It is possible to create Pre and Post build events.
This type of events are executed before the actual package is being created. They can be useful to run commands whose results are used in the package building process, like always copy files from a location to ensure that you always have the latest files included in the project before starting the build process.
This type of events are executed after the actual package is being created. They can be useful to run commands that will be performed on the resulted package file, like renaming or copying it in a different location.
Use the “Add->Pre/Post-Build Event->New...” list context menu item in order to create a new event.
Also, you can create new events starting from some predefined templates. Just select one from “Add->Pre/Post-Build Event” context menu list. Available templates are:
- File Copy... - Copies file <source_file> to <destination_file>.
- File Move... - Moves file <source_file> to <destination_file>.
- File Rename... - Ranames file <source_file> to <destination_file>.
- Folder Removal... - Removes folder <folder_path>.
- Run As... - Runs <application.exe> impersonating user <username>.
You need to substitute place holders <source_file> and <destination_file> with actual paths.
You can access the current build output path by using properties like AI_BUILD_OUTPUT_FILE or AI_BUILD_OUTPUT_FOLDER. These properties are available only during build-time. It is highly recommended to include all paths in quotation marks (" ") since some of them can contain spaces of special characters.
Edit an event
Use the “Edit” list context menu item or press the Space key in order to edit an event.
Removing an event
Use the “Delete” list context menu item or press the Delete key in order to remove an event.
Specifying the events execution order
Use the “Move Up” / “Move Down” context menu item while an event is selected.
It is possible to define your own event that will be scheduled post or prior build:
- This article presents an example on how to add a predefined event
- Add a command line batch (.bat) file as a custom event
- Add a vbscript file as a custom event
- Add a custom exe file as a custom event
- Edit Event Dialog
The "Edit Event" dialog in Advanced Installer.
- Add a command-line batch file as a custom event
Batch files are scripts that automate tasks or launch programs. See how you can add a custom event based on a .bat file you previously created.
- Add a VBScript file as a custom event
Add a vbs file as an event example
- Add an executable file as a custom event
The following is a general guide for adding an executable file as a custom event in the Advanced Installer software.
- Powershell build event
How to use a Powershell script as a build event.