Skip to content

IEngine Interface

High level abstraction over the «see T:WixToolset.Mba.Core.IBootstrapperEngine» interface.

MethodDescription
Apply(hwndParent)Install the packages.
CloseSplashScreen()Close the splash screen if it is still open. Does nothing if the splash screen is not or never was opened.
CompareVersions()
ContainsVariable(name)Checks if a variable exists in the engine.
Detect()Determine if all installation conditions are fulfilled.
Detect(hwndParent)Determine if all installation conditions are fulfilled.
Elevate(hwndParent)Elevate the install.
EscapeString(input)Escapes the input string.
EvaluateCondition(condition)Evaluates the condition string.
FormatString(format)Formats the input string.
GetRelatedBundleVariable(bundleId, name)Gets persisted variables from a related bundle.
GetVariableNumeric(name)Gets numeric variables for the engine.
GetVariableSecureString(name)Gets string variables for the engine using SecureStrings.
GetVariableString(name)Gets string variables for the engine.
GetVariableVersion(name)Gets «see T:System.Version» variables for the engine.
LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments)Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.
LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, waitForInputIdleTimeout)Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.
Log(level, message)Logs the message .
Plan(action)Determine the installation sequencing and costing.
Quit(exitCode)Shuts down the engine.
SendEmbeddedError(errorCode, message, uiHint)Sends error message when embedded.
SendEmbeddedProgress(progressPercentage, overallPercentage)Sends progress percentages when embedded.
SetDownloadSource(packageOrContainerId, payloadId, url, user, password)Set the new download URL for a package or container.
SetLocalSource(packageOrContainerId, payloadId, path)Set the local source for a package or container.
SetUpdate(localSource, downloadSource, size, hashType, hash)Set the update information for a bundle.
SetUpdateSource(url)Sets the URL to the update feed.
SetVariableNumeric(name, value)Sets numeric variables for the engine.
SetVariableString(name, value, formatted)Sets string variables for the engine using SecureStrings.
SetVariableString(name, value, formatted)Sets string variables for the engine.
SetVariableVersion(name, value)Sets version variables for the engine.
PropertyDescription
PackageCountGets the number of packages in the bundle.
WixToolset.Mba.Core.dll version 4.0.5+b9b2f1b4c69a1b509d487dc950b30b4ec9b0d040

Install the packages.

public void Apply(
IntPtr hwndParent
)
ParameterTypeDescription
hwndParentIntPtrThe parent window for the installation user interface.

Close the splash screen if it is still open. Does nothing if the splash screen is not or never was opened.

public void CloseSplashScreen()
public int CompareVersions()

int 0 if equal, 1 if version1 {’>’} version2, -1 if version1 {’<’} version2

Checks if a variable exists in the engine.

public bool ContainsVariable(
string name
)
ParameterTypeDescription
namestringThe name of the variable.

bool Whether the variable exists.

Determine if all installation conditions are fulfilled.

public void Detect()

Determine if all installation conditions are fulfilled.

public void Detect(
IntPtr hwndParent
)
ParameterTypeDescription
hwndParentIntPtrThe parent window for the installation user interface.

Elevate the install.

public bool Elevate(
IntPtr hwndParent
)
ParameterTypeDescription
hwndParentIntPtrThe parent window of the elevation dialog.

bool true if elevation succeeded; otherwise, false if the user cancelled.

ExceptionDescription
T:System.ComponentModel.Win32ExceptionA Win32 error occurred.

Escapes the input string.

public string EscapeString(
string input
)
ParameterTypeDescription
inputstringThe string to escape.

string The escaped string.

ExceptionDescription
T:System.ComponentModel.Win32ExceptionA Win32 error occurred.

Evaluates the condition string.

public bool EvaluateCondition(
string condition
)
ParameterTypeDescription
conditionstringThe string representing the condition to evaluate.

bool Whether the condition evaluated to true or false.

Formats the input string.

public string FormatString(
string format
)
ParameterTypeDescription
formatstringThe string to format.

string The formatted string.

ExceptionDescription
T:System.ComponentModel.Win32ExceptionA Win32 error occurred.

GetRelatedBundleVariable(bundleId, name) Method

Section titled “GetRelatedBundleVariable(bundleId, name) Method”

Gets persisted variables from a related bundle.

public string GetRelatedBundleVariable(
string bundleId,
string name
)
ParameterTypeDescription
bundleIdstringThe BundleId of the related bundle.
namestringThe name of the variable.

Gets numeric variables for the engine.

public System.Int64 GetVariableNumeric(
string name
)
ParameterTypeDescription
namestringThe name of the variable.

Gets string variables for the engine using SecureStrings.

public System.Security.SecureString GetVariableSecureString(
string name
)
ParameterTypeDescription
namestringThe name of the variable.

Gets string variables for the engine.

public string GetVariableString(
string name
)
ParameterTypeDescription
namestringThe name of the variable.

Gets «see T:System.Version» variables for the engine.

public string GetVariableVersion(
string name
)
ParameterTypeDescription
namestringThe name of the variable.

LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments) Method

Section titled “LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments) Method”

Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.

public void LaunchApprovedExe(
IntPtr hwndParent,
string approvedExeForElevationId,
string arguments
)
ParameterTypeDescription
hwndParentIntPtrThe parent window of the elevation dialog (if the engine hasn’t elevated yet).
approvedExeForElevationIdstringId of the ApprovedExeForElevation element specified when the bundle was authored.
argumentsstringOptional arguments.

LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, waitForInputIdleTimeout) Method

Section titled “LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, waitForInputIdleTimeout) Method”

Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.

public void LaunchApprovedExe(
IntPtr hwndParent,
string approvedExeForElevationId,
string arguments,
int waitForInputIdleTimeout
)
ParameterTypeDescription
hwndParentIntPtrThe parent window of the elevation dialog (if the engine hasn’t elevated yet).
approvedExeForElevationIdstringId of the ApprovedExeForElevation element specified when the bundle was authored.
argumentsstringOptional arguments.
waitForInputIdleTimeoutintTimeout in milliseconds. When set to something other than zero, the engine will call WaitForInputIdle for the new process with this timeout before calling OnLaunchApprovedExeComplete.

Logs the message .

public void Log(
LogLevel level,
string message
)
ParameterTypeDescription
levelLogLevelThe logging level.
messagestringThe message to log.

Determine the installation sequencing and costing.

public void Plan(
LaunchAction action
)
ParameterTypeDescription
actionLaunchActionThe action to perform when planning.

Shuts down the engine.

public void Quit(
int exitCode
)
ParameterTypeDescription
exitCodeintExit code indicating reason for shut down.

SendEmbeddedError(errorCode, message, uiHint) Method

Section titled “SendEmbeddedError(errorCode, message, uiHint) Method”

Sends error message when embedded.

public int SendEmbeddedError(
int errorCode,
string message,
int uiHint
)
ParameterTypeDescription
errorCodeintError code.
messagestringError message.
uiHintintUI buttons to show on error dialog.

SendEmbeddedProgress(progressPercentage, overallPercentage) Method

Section titled “SendEmbeddedProgress(progressPercentage, overallPercentage) Method”

Sends progress percentages when embedded.

public int SendEmbeddedProgress(
int progressPercentage,
int overallPercentage
)
ParameterTypeDescription
progressPercentageintPercentage completed thus far.
overallPercentageintOverall percentage completed.

SetDownloadSource(packageOrContainerId, payloadId, url, user, password) Method

Section titled “SetDownloadSource(packageOrContainerId, payloadId, url, user, password) Method”

Set the new download URL for a package or container.

public void SetDownloadSource(
string packageOrContainerId,
string payloadId,
string url,
string user,
string password
)
ParameterTypeDescription
packageOrContainerIdstringThe id that uniquely identifies the package or container.
payloadIdstringThe id that uniquely identifies the payload.
urlstringThe new url.
userstringThe user name for proxy authentication.
passwordstringThe password for proxy authentication.

SetLocalSource(packageOrContainerId, payloadId, path) Method

Section titled “SetLocalSource(packageOrContainerId, payloadId, path) Method”

Set the local source for a package or container.

public void SetLocalSource(
string packageOrContainerId,
string payloadId,
string path
)
ParameterTypeDescription
packageOrContainerIdstringThe id that uniquely identifies the package or container.
payloadIdstringThe id that uniquely identifies the payload.
pathstringThe new source path.

SetUpdate(localSource, downloadSource, size, hashType, hash) Method

Section titled “SetUpdate(localSource, downloadSource, size, hashType, hash) Method”

Set the update information for a bundle.

public void SetUpdate(
string localSource,
string downloadSource,
System.Int64 size,
UpdateHashType hashType,
string hash
)
ParameterTypeDescription
localSourcestringOptional local source path for the update. Default is “update[OriginalNameOfBundle].exe”.
downloadSourcestringOptional download source for the update.
sizeSystem.Int64Size of the expected update.
hashTypeUpdateHashTypeType of the hash expected on the update.
hashstringOptional hash expected for the update.

Sets the URL to the update feed.

public void SetUpdateSource(
string url
)
ParameterTypeDescription
urlstringURL of the update feed.

Sets numeric variables for the engine.

public void SetVariableNumeric(
string name,
System.Int64 value
)
ParameterTypeDescription
namestringThe name of the variable.
valueSystem.Int64The value to set.

SetVariableString(name, value, formatted) Method

Section titled “SetVariableString(name, value, formatted) Method”

Sets string variables for the engine using SecureStrings.

public void SetVariableString(
string name,
System.Security.SecureString value,
bool formatted
)
ParameterTypeDescription
namestringThe name of the variable.
valueSystem.Security.SecureStringThe value to set.
formattedboolFalse if the value is a literal string.

SetVariableString(name, value, formatted) Method

Section titled “SetVariableString(name, value, formatted) Method”

Sets string variables for the engine.

public void SetVariableString(
string name,
string value,
bool formatted
)
ParameterTypeDescription
namestringThe name of the variable.
valuestringThe value to set.
formattedboolFalse if the value is a literal string.

Sets version variables for the engine.

public void SetVariableVersion(
string name,
string value
)
ParameterTypeDescription
namestringThe name of the variable.
valuestringThe value to set.

Gets the number of packages in the bundle.

public int PackageCount { get; set; }