Resources

The Includes dialog allows you to add or remove Indigo Rose, or custom created script files (*.lua) to or from your project. The Lua script within these files will be read and included in your update at build time. This enables any code within them to be called anywhere during your update.

This feature allows you to share generic script files that are used by many projects without having to copy the code into the project each time. This also adds the convenience of maintaining the code in one file if future changes need to be made.

To access the Includes dialog, choose Project > Includes... from the program menu.

Each script file that is provided by Indigo Rose contains a summary of its contents at the top of the file which can be viewed in any text editor, such as Notepad. For example, at the beginning of the Detect_Acrobat.lua script file, you will see the following information:

--[[
**********************************************************************************
Function: ir_GetAcrobatVersion()
Purpose: Detects the existence of Adobe Acrobat Reader / Adobe Acrobat
Arguments: None.
Returns: Version number, 0.0.0.0 if Acrobat / Acrobat Reader does not exist
**********************************************************************************
]]

This script file, like many others contains a function that can be called anywhere in your update. To call it, simply add a line in one of the action scripts that calls the function ir_GetAcrobatVersion(), which in this case will return the version number of Adobe Acrobat.

 

For example, if you wanted to abort the update if the user's version of Acrobat is less than 5.0.0.0, the following script could be added to any action event in your project:

-- Get the version of Acrobat that is installed.
strAcroVer = ir_GetAcrobatVersion();

-- Compare the version number from Acrobat with "5.0.0.0" and check if it is less than 5.0.0.0.
if (String.CompareFileVersions(strAcroVer, "5.0.0.0") == -1) then
    -- Exit the update.   
    Application.Exit(0);
end

 

 


Filename

The full path and filenames of the script files that will be added to your update at build time.

Note: TrueUpdate may automatically include script files needed by its runtime. One example of a script file that will automatically be added to your project is called _TU20_Global_Functions.lua. If this is the case, they should not be modified unless you are sure the project does not require it. Under normal circumstances you should never remove script files you did not add yourself.

Add

Add a new script file to your project. There are a variety of Indigo Rose created script files that are shipped with TrueUpdate. All available script files can be found in the Scripts folder, normally located in C:\Program Files\TrueUpdate 3.0\Includes\Scripts. An example of a file that can be found there is Detect_Acrobat.lua.

Remove

Removes the currently selected script file from your project.

Note: Caution should be taken when removing script files. Only custom script files should be removed from a project.

Edit

Opens the Script File Properties dialog where you can change the location of the selected file, or browse for a different file.

Up ( )

Move the selected script file up one position in the script file list.

Down ( )

Move the selected script file down one position in the script file list.