Skip to main content

IPreprocessHelper Interface

Interface provided to help preprocessor extensions.

Methods

MethodDescription
AddVariable(context, name, value)Add a variable.
AddVariable(context, name, value, showWarning)Add a variable.
EvaluateFunction(context, function)Evaluate a function.
EvaluateFunction(context, prefix, function, args)Evaluate a function.
GetVariableValue(context, variable, allowMissingPrefix)Get the value of a variable expression like var.name.
GetVariableValue(context, prefix, name)Get the value of a variable.
PreprocessPragma(context, pragmaName, args, parent)Evaluate a Pragma.
PreprocessString(context, value)Replaces parameters in the source text.
RemoveVariable(context, name)Remove a variable.

WixToolset.Extensibility.dll version 5.0.2+aa65968c419420d32e3e1b647aea0082f5ca5b78

AddVariable(context, name, value) Method

Add a variable.

Declaration

public void AddVariable(
WixToolset.Extensibility.Data.IPreprocessContext context,
string name,
string value
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
namestringThe variable name.
valuestringThe variable value.

AddVariable(context, name, value, showWarning) Method

Add a variable.

Declaration

public void AddVariable(
WixToolset.Extensibility.Data.IPreprocessContext context,
string name,
string value,
bool showWarning
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
namestringThe variable name.
valuestringThe variable value.
showWarningboolSet to true to show variable overwrite warning.

EvaluateFunction(context, function) Method

Evaluate a function.

Declaration

public string EvaluateFunction(
WixToolset.Extensibility.Data.IPreprocessContext context,
string function
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
functionstringThe function expression including the prefix and name.

Return value

string The function value.

EvaluateFunction(context, prefix, function, args) Method

Evaluate a function.

Declaration

public string EvaluateFunction(
WixToolset.Extensibility.Data.IPreprocessContext context,
string prefix,
string function,
System.String[] args
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
prefixstringThe function prefix.
functionstringThe function name.
argsSystem.String[]The arguments for the function.

Return value

string The function value or null if the function is not defined.

GetVariableValue(context, variable, allowMissingPrefix) Method

Get the value of a variable expression like var.name.

Declaration

public string GetVariableValue(
WixToolset.Extensibility.Data.IPreprocessContext context,
string variable,
bool allowMissingPrefix
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
variablestringThe variable expression including the optional prefix and name.
allowMissingPrefixbooltrue to allow the variable prefix to be missing.

Return value

string The variable value.

GetVariableValue(context, prefix, name) Method

Get the value of a variable.

Declaration

public string GetVariableValue(
WixToolset.Extensibility.Data.IPreprocessContext context,
string prefix,
string name
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
prefixstringThe variable prefix.
namestringThe variable name.

Return value

string The variable value or null if the variable is not set.

PreprocessPragma(context, pragmaName, args, parent) Method

Evaluate a Pragma.

Declaration

public void PreprocessPragma(
WixToolset.Extensibility.Data.IPreprocessContext context,
string pragmaName,
string args,
System.Xml.Linq.XContainer parent
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
pragmaNamestringThe pragma's full name ({'<'}prefix{'>'}.{'<'}pragma{'>'}).
argsstringThe arguments to the pragma.
parentSystem.Xml.Linq.XContainerThe parent element of the pragma.

PreprocessString(context, value) Method

Replaces parameters in the source text.

Declaration

public string PreprocessString(
WixToolset.Extensibility.Data.IPreprocessContext context,
string value
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
valuestringText that may contain parameters to replace.

Return value

string Text after parameters have been replaced.

RemoveVariable(context, name) Method

Remove a variable.

Declaration

public void RemoveVariable(
WixToolset.Extensibility.Data.IPreprocessContext context,
string name
)

Parameters

ParameterTypeDescription
contextWixToolset.Extensibility.Data.IPreprocessContextThe preprocess context.
namestringThe variable name.