Introduction

One of the powerful features of Setup Factory is its scripting engine. This document will introduce you to the new scripting environment and language.

Setup Factory scripting is very simple, with only a handful of concepts to learn. Here is what it looks like:

a = 5;
if a < 10 then
     Dialog.Message("Guess what?", "a is less than 10");
end

(Note: this script is only a demonstration. Don’t worry if you don’t understand it yet.)

The example above assigns a value to a variable, tests the contents of that variable, and if the value turns out to be less than 10, uses a Setup Factory action called “Dialog.Message” to display a message to the user.

New programmers and experienced coders alike will find that Setup Factory is a powerful, flexible yet simple scripting environment to work in.

A Quick Example of Scripting in Setup Factory

Here is a short tutorial showing you how to enter a script into Setup Factory and preview the results:

1.       Start a new project.

2.       In your project's On Startup event, type in the following text:
Dialog.Message("Title", "Hello World");


It should look like this when you’re done:



 

6.       Click OK to close the action editor.

7.       Choose Publish > Build from the menu.

8.       Once your project has finished building, run the created file (typically setup.exe).

The On Startup event is triggered as soon as the installation is loaded, and the script you entered will be performed. You should see the following dialog appear:



Congratulations! You have just made your first script. Though this is a simple example, it shows you just how easy it is to make something happen in your Setup Factory Application. You can use the above method to try out any script you want in Setup Factory .