Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 2.84 KB

File metadata and controls

81 lines (56 loc) · 2.84 KB

Project [Variables] Section

This section contains GLOBAL variables and macros the scripts in the project need to reference. The variables are loaded into memory when a build is started or a script is run manually and are available to all scripts in the project.

This documentation refers to the Variables section located within the script.project file. For documentation relating to the Variables section of individual scripts refer to Script Variables.

Syntax

Global variables and macros are defined using the .INI style Key=Value format. Variables must be enclosed in % percent signs.

Variables

%myGlobalVar%="C:\Temp"

API Variables

The following variables may be used within the script.project Variables section to define a custom "Macro Library" that will be available to the entire project.

Variable Description
%API% The full path to a script file containing a "Macro Library".
%APIVAR% The name of the section within the script defined by %API% that contains the Macro Definitions to be loaded into the GLOBAL project scope.

Macros

myMacro=Run,%PluginFile%,DoSomething

Note that the macro name is not enclosed in % signs.

Remarks

Note: With Winbuilder it was necessary to load a "Macro Library" by placing the AddVariables,%API%,ApiVar,GLOBAL command in the process section of script.project. In PEBakery this is not required. Macros defined in the %API% file's %APIVAR% section will automatically be loaded in to the GLOBAL scope.

Related

Project Main, Project Process, Script Interface, Script Main, Script Process, Script Variables, Macros

Examples

Example 1

[Main]
Title=myProject
Description=Example Project
Author=Homes32
Version=1

[Variables]
%RegSystem%=%TargetDir%\Windows\System32\config\System
%RegSoftware%=%TargetDir%\Windows\System32\config\Software
%RegDefault%=%TargetDir%\Windows\System32\config\Default
%RegComponents%=%TargetDir%\Windows\System32\config\Components
%AutoRunFile%=%TargetDir%\Windows\System32\autorun.cfg
%BootSRC%=D:\PEBakery\Mount\Win10PESE\Source\BootWimSrc
%InstallSRC%=D:\PEBakery\Mount\Win10PESE\Source\InstallWimSrc
%Source_Win%=D:\PEBakery\Mount\Win10PESE\Source\InstallWimSrc\Windows
%Target_Win%=%TargetDir%\Windows
%Source_Sys%=D:\PEBakery\Mount\Win10PESE\Source\InstallWimSrc\Windows\System32

Example 2

In this example we define a .script file called myMacroLibrary.script as our projects "API" script and load all macros into the Global scope of the project.

[Main]
Title=myProject
Description=Example Project
Author=Homes32
Version=1

[Variables]
%API%=%ProjectDir%\Build\myMacroLibrary.script
%APIVAR%=MacroDef