From 62352fabd541aaa9d0a2c957c4bdd4b9c682df9c Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 11 Dec 2019 19:34:47 +1100 Subject: Import files from BootstrapperCore repo. --- src/WixToolset.Mba.Core/IEngine.cs | 176 +++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 src/WixToolset.Mba.Core/IEngine.cs (limited to 'src/WixToolset.Mba.Core/IEngine.cs') diff --git a/src/WixToolset.Mba.Core/IEngine.cs b/src/WixToolset.Mba.Core/IEngine.cs new file mode 100644 index 00000000..46b8158a --- /dev/null +++ b/src/WixToolset.Mba.Core/IEngine.cs @@ -0,0 +1,176 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BootstrapperCore +{ + using System; + using System.ComponentModel; + using System.Security; + + public interface IEngine + { + /// + /// Gets or sets numeric variables for the engine. + /// + IVariables NumericVariables { get; } + + /// + /// Gets the number of packages in the bundle. + /// + int PackageCount { get; } + + /// + /// Gets or sets string variables for the engine using SecureStrings. + /// + IVariables SecureStringVariables { get; } + + /// + /// Gets or sets string variables for the engine. + /// + IVariables StringVariables { get; } + + /// + /// Gets or sets variables for the engine. + /// + /// The class can keep track of when the build and revision fields are undefined, but the engine can't. + /// Therefore, the build and revision fields must be defined when setting a variable. + /// Use the NormalizeVersion method to make sure the engine can accept the Version. + /// + /// To keep track of versions without build or revision fields, use StringVariables instead. + /// + /// The given was invalid. + IVariables VersionVariables { get; } + + /// + /// Install the packages. + /// + /// The parent window for the installation user interface. + void Apply(IntPtr hwndParent); + + /// + /// Close the splash screen if it is still open. Does nothing if the splash screen is not or + /// never was opened. + /// + void CloseSplashScreen(); + + /// + /// Determine if all installation conditions are fulfilled. + /// + void Detect(); + + /// + /// Determine if all installation conditions are fulfilled. + /// + /// The parent window for the installation user interface. + void Detect(IntPtr hwndParent); + + /// + /// Elevate the install. + /// + /// The parent window of the elevation dialog. + /// true if elevation succeeded; otherwise, false if the user cancelled. + /// A Win32 error occurred. + bool Elevate(IntPtr hwndParent); + + /// + /// Escapes the input string. + /// + /// The string to escape. + /// The escaped string. + /// A Win32 error occurred. + string EscapeString(string input); + + /// + /// Evaluates the string. + /// + /// The string representing the condition to evaluate. + /// Whether the condition evaluated to true or false. + bool EvaluateCondition(string condition); + + /// + /// Formats the input string. + /// + /// The string to format. + /// The formatted string. + /// A Win32 error occurred. + string FormatString(string format); + + /// + /// Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt. + /// + /// The parent window of the elevation dialog (if the engine hasn't elevated yet). + /// Id of the ApprovedExeForElevation element specified when the bundle was authored. + /// Optional arguments. + void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments); + + /// + /// Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt. + /// + /// The parent window of the elevation dialog (if the engine hasn't elevated yet). + /// Id of the ApprovedExeForElevation element specified when the bundle was authored. + /// Optional arguments. + /// Timeout in milliseconds. When set to something other than zero, the engine will call WaitForInputIdle for the new process with this timeout before calling OnLaunchApprovedExeComplete. + void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments, int waitForInputIdleTimeout); + + /// + /// Logs the . + /// + /// The logging level. + /// The message to log. + void Log(LogLevel level, string message); + + /// + /// Determine the installation sequencing and costing. + /// + /// The action to perform when planning. + void Plan(LaunchAction action); + + /// + /// Set the update information for a bundle. + /// + /// Optional local source path for the update. Default is "update\[OriginalNameOfBundle].exe". + /// Optional download source for the update. + /// Size of the expected update. + /// Type of the hash expected on the update. + /// Optional hash expected for the update. + void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, byte[] hash); + + /// + /// Set the local source for a package or container. + /// + /// The id that uniquely identifies the package or container. + /// The id that uniquely identifies the payload. + /// The new source path. + void SetLocalSource(string packageOrContainerId, string payloadId, string path); + + /// + /// Set the new download URL for a package or container. + /// + /// The id that uniquely identifies the package or container. + /// The id that uniquely identifies the payload. + /// The new url. + /// The user name for proxy authentication. + /// The password for proxy authentication. + void SetDownloadSource(string packageOrContainerId, string payloadId, string url, string user, string password); + + /// + /// Sends error message when embedded. + /// + /// Error code. + /// Error message. + /// UI buttons to show on error dialog. + int SendEmbeddedError(int errorCode, string message, int uiHint); + + /// + /// Sends progress percentages when embedded. + /// + /// Percentage completed thus far. + /// Overall percentage completed. + int SendEmbeddedProgress(int progressPercentage, int overallPercentage); + + /// + /// Shuts down the engine. + /// + /// Exit code indicating reason for shut down. + void Quit(int exitCode); + } +} -- cgit v1.2.3-55-g6feb