File Structure

Let's start by looking at the structure of a typical script file. We use sections to group commands and settings inside script files.

The easiest way to see how they are applied is to edit a few scripts and look at the source code to learn more about them. A typical script is composed of at least these 3 important sections

In addition to the script files, there is a master project file called Script.project, which has two optional sections

Here is a small example of how it should look:

[Main]
Title=Add my Program
Description=This script will add my program
Level=5

[Variables]
%myTitle%="This is a title for the program"

[Process]
echo,%myTitle%
....
....

We can additionally use more sections to add variables from the script interface or even specify more sections with commands to be processed.

The [Main] section

Inside this main section you can store the definitions that identify your script and allow it to be properly categorized inside the project. This section works like a normal INI section where you write all your data in the form of Key=Value (e.g. Color=Blue)

List of available keys

While some of the keys can be manipulated using the WinBuilder GUI, All of these keys can be edited easily using WinBuilder's internal source code editor. And while these keys are optional, it is recommended to place at least a few keys to better describe your script to others (i.e. Title and Description ).

Added in 2009 (WB78?)

In the log it is easy to be seen when the script has been changed in core areas.
    () > script does not have the stamp
    (+) > script is still original
    (?) > script has been changed.
Since this is a tool exclusive for 'project-owners' to certify their scripts, the keywords below are generated by a separate, console program to 'certify' the script before upload. In addition to the certify.exe program a personal key file <name>.wbc is also required. It writes something like this into the [Main] section:
[Main]
...
CertifiedBy=xxx
Certification=cd55abf6082298a0044f110479f98b7e
In addition to the information shown above, WinBuilder will show who issues the certification, or give a warning if there is no certification information in the script.

The [Variables] section

This section is described in more detail on a separate page .

The [Process] section

All commands you write in this section will be executed by the program. From this section you can also call other sections from the same script or other scripts if necessary using the run command .

The result of each operation is written on the log window - which you can later view or save to an html page.

The [Interface] section

While this is important to scripts it is described in more detail on a separate page .

The [OnProcessEntry] section

This section is an optional section exclusive in script.project. If it is present, during build this section is processed before the first [Process] line of every processed script.

The [OnProcessExit] section

This section is an optional special section exclusive in script.project. If it is present, during build this section is processed after the last [Process] line of every processed script. For example, this will cause a specific section of the project.script file to be run when the build process exits.

[OnProcessExit]
Run,%ProjectDir%\script.project,Process-log