diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2019-12-21 11:23:03 +1100 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2019-12-22 13:19:29 +1000 |
| commit | f3c383c2412e376353d64a8b744184fa1cee1c6e (patch) | |
| tree | 4e092e2ce0e968e84df0e9c2ce41c13d4715bf4f /src/WixToolset.Mba.Core/IBootstrapperEngine.cs | |
| parent | 46d46435592ba779d6c8d017859c27d90b092aa6 (diff) | |
| download | wix-f3c383c2412e376353d64a8b744184fa1cee1c6e.tar.gz wix-f3c383c2412e376353d64a8b744184fa1cee1c6e.tar.bz2 wix-f3c383c2412e376353d64a8b744184fa1cee1c6e.zip | |
Move IBootstrapperApplication and IBootstrapperEngine into balutil.
Diffstat (limited to 'src/WixToolset.Mba.Core/IBootstrapperEngine.cs')
| -rw-r--r-- | src/WixToolset.Mba.Core/IBootstrapperEngine.cs | 279 |
1 files changed, 279 insertions, 0 deletions
diff --git a/src/WixToolset.Mba.Core/IBootstrapperEngine.cs b/src/WixToolset.Mba.Core/IBootstrapperEngine.cs new file mode 100644 index 00000000..d070998e --- /dev/null +++ b/src/WixToolset.Mba.Core/IBootstrapperEngine.cs | |||
| @@ -0,0 +1,279 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Mba.Core | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.CodeDom.Compiler; | ||
| 7 | using System.Runtime.InteropServices; | ||
| 8 | using System.Text; | ||
| 9 | |||
| 10 | /// <summary> | ||
| 11 | /// Allows calls into the bootstrapper engine. | ||
| 12 | /// </summary> | ||
| 13 | [ComImport] | ||
| 14 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] | ||
| 15 | [Guid("6480D616-27A0-44D7-905B-81512C29C2FB")] | ||
| 16 | [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")] | ||
| 17 | public interface IBootstrapperEngine | ||
| 18 | { | ||
| 19 | void GetPackageCount( | ||
| 20 | [MarshalAs(UnmanagedType.U4)] out int pcPackages | ||
| 21 | ); | ||
| 22 | |||
| 23 | [PreserveSig] | ||
| 24 | int GetVariableNumeric( | ||
| 25 | [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, | ||
| 26 | out long pllValue | ||
| 27 | ); | ||
| 28 | |||
| 29 | [PreserveSig] | ||
| 30 | int GetVariableString( | ||
| 31 | [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, | ||
| 32 | IntPtr wzValue, | ||
| 33 | [MarshalAs(UnmanagedType.U4)] ref int pcchValue | ||
| 34 | ); | ||
| 35 | |||
| 36 | [PreserveSig] | ||
| 37 | int GetVariableVersion( | ||
| 38 | [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, | ||
| 39 | [MarshalAs(UnmanagedType.U8)] out long pqwValue | ||
| 40 | ); | ||
| 41 | |||
| 42 | [PreserveSig] | ||
| 43 | int FormatString( | ||
| 44 | [MarshalAs(UnmanagedType.LPWStr)] string wzIn, | ||
| 45 | [MarshalAs(UnmanagedType.LPWStr), Out] StringBuilder wzOut, | ||
| 46 | [MarshalAs(UnmanagedType.U4)] ref int pcchOut | ||
| 47 | ); | ||
| 48 | |||
| 49 | [PreserveSig] | ||
| 50 | int EscapeString( | ||
| 51 | [MarshalAs(UnmanagedType.LPWStr)] string wzIn, | ||
| 52 | [MarshalAs(UnmanagedType.LPWStr), Out] StringBuilder wzOut, | ||
| 53 | [MarshalAs(UnmanagedType.U4)] ref int pcchOut | ||
| 54 | ); | ||
| 55 | |||
| 56 | void EvaluateCondition( | ||
| 57 | [MarshalAs(UnmanagedType.LPWStr)] string wzCondition, | ||
| 58 | [MarshalAs(UnmanagedType.Bool)] out bool pf | ||
| 59 | ); | ||
| 60 | |||
| 61 | void Log( | ||
| 62 | [MarshalAs(UnmanagedType.U4)] LogLevel level, | ||
| 63 | [MarshalAs(UnmanagedType.LPWStr)] string wzMessage | ||
| 64 | ); | ||
| 65 | |||
| 66 | void SendEmbeddedError( | ||
| 67 | [MarshalAs(UnmanagedType.U4)] int dwErrorCode, | ||
| 68 | [MarshalAs(UnmanagedType.LPWStr)] string wzMessage, | ||
| 69 | [MarshalAs(UnmanagedType.U4)] int dwUIHint, | ||
| 70 | [MarshalAs(UnmanagedType.I4)] out int pnResult | ||
| 71 | ); | ||
| 72 | |||
| 73 | void SendEmbeddedProgress( | ||
| 74 | [MarshalAs(UnmanagedType.U4)] int dwProgressPercentage, | ||
| 75 | [MarshalAs(UnmanagedType.U4)] int dwOverallProgressPercentage, | ||
| 76 | [MarshalAs(UnmanagedType.I4)] out int pnResult | ||
| 77 | ); | ||
| 78 | |||
| 79 | void SetUpdate( | ||
| 80 | [MarshalAs(UnmanagedType.LPWStr)] string wzLocalSource, | ||
| 81 | [MarshalAs(UnmanagedType.LPWStr)] string wzDownloadSource, | ||
| 82 | [MarshalAs(UnmanagedType.U8)] long qwValue, | ||
| 83 | [MarshalAs(UnmanagedType.U4)] UpdateHashType hashType, | ||
| 84 | [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=4)] byte[] rgbHash, | ||
| 85 | [MarshalAs(UnmanagedType.U4)] int cbHash | ||
| 86 | ); | ||
| 87 | |||
| 88 | void SetLocalSource( | ||
| 89 | [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId, | ||
| 90 | [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId, | ||
| 91 | [MarshalAs(UnmanagedType.LPWStr)] string wzPath | ||
| 92 | ); | ||
| 93 | |||
| 94 | void SetDownloadSource( | ||
| 95 | [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId, | ||
| 96 | [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId, | ||
| 97 | [MarshalAs(UnmanagedType.LPWStr)] string wzUrl, | ||
| 98 | [MarshalAs(UnmanagedType.LPWStr)] string wzUser, | ||
| 99 | [MarshalAs(UnmanagedType.LPWStr)] string wzPassword | ||
| 100 | ); | ||
| 101 | |||
| 102 | void SetVariableNumeric( | ||
| 103 | [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, | ||
| 104 | long llValue | ||
| 105 | ); | ||
| 106 | |||
| 107 | void SetVariableString( | ||
| 108 | [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, | ||
| 109 | IntPtr wzValue | ||
| 110 | ); | ||
| 111 | |||
| 112 | void SetVariableVersion( | ||
| 113 | [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, | ||
| 114 | [MarshalAs(UnmanagedType.U8)] long qwValue | ||
| 115 | ); | ||
| 116 | |||
| 117 | void CloseSplashScreen(); | ||
| 118 | |||
| 119 | void Detect( | ||
| 120 | IntPtr hwndParent | ||
| 121 | ); | ||
| 122 | |||
| 123 | void Plan( | ||
| 124 | [MarshalAs(UnmanagedType.U4)] LaunchAction action | ||
| 125 | ); | ||
| 126 | |||
| 127 | [PreserveSig] | ||
| 128 | int Elevate( | ||
| 129 | IntPtr hwndParent | ||
| 130 | ); | ||
| 131 | |||
| 132 | void Apply( | ||
| 133 | IntPtr hwndParent | ||
| 134 | ); | ||
| 135 | |||
| 136 | void Quit( | ||
| 137 | [MarshalAs(UnmanagedType.U4)] int dwExitCode | ||
| 138 | ); | ||
| 139 | |||
| 140 | void LaunchApprovedExe( | ||
| 141 | IntPtr hwndParent, | ||
| 142 | [MarshalAs(UnmanagedType.LPWStr)] string wzApprovedExeForElevationId, | ||
| 143 | [MarshalAs(UnmanagedType.LPWStr)] string wzArguments, | ||
| 144 | [MarshalAs(UnmanagedType.U4)] int dwWaitForInputIdleTimeout | ||
| 145 | ); | ||
| 146 | } | ||
| 147 | |||
| 148 | /// <summary> | ||
| 149 | /// The installation action for the bundle or current package. | ||
| 150 | /// </summary> | ||
| 151 | public enum ActionState | ||
| 152 | { | ||
| 153 | None, | ||
| 154 | Uninstall, | ||
| 155 | Install, | ||
| 156 | AdminInstall, | ||
| 157 | Modify, | ||
| 158 | Repair, | ||
| 159 | MinorUpgrade, | ||
| 160 | MajorUpgrade, | ||
| 161 | Patch, | ||
| 162 | } | ||
| 163 | |||
| 164 | /// <summary> | ||
| 165 | /// The action for the BA to perform. | ||
| 166 | /// </summary> | ||
| 167 | public enum LaunchAction | ||
| 168 | { | ||
| 169 | Unknown, | ||
| 170 | Help, | ||
| 171 | Layout, | ||
| 172 | Uninstall, | ||
| 173 | Cache, | ||
| 174 | Install, | ||
| 175 | Modify, | ||
| 176 | Repair, | ||
| 177 | UpdateReplace, | ||
| 178 | UpdateReplaceEmbedded, | ||
| 179 | } | ||
| 180 | |||
| 181 | /// <summary> | ||
| 182 | /// The message log level. | ||
| 183 | /// </summary> | ||
| 184 | public enum LogLevel | ||
| 185 | { | ||
| 186 | /// <summary> | ||
| 187 | /// No logging level (generic). | ||
| 188 | /// </summary> | ||
| 189 | None, | ||
| 190 | |||
| 191 | /// <summary> | ||
| 192 | /// User messages. | ||
| 193 | /// </summary> | ||
| 194 | Standard, | ||
| 195 | |||
| 196 | /// <summary> | ||
| 197 | /// Verbose messages. | ||
| 198 | /// </summary> | ||
| 199 | Verbose, | ||
| 200 | |||
| 201 | /// <summary> | ||
| 202 | /// Messages for debugging. | ||
| 203 | /// </summary> | ||
| 204 | Debug, | ||
| 205 | |||
| 206 | /// <summary> | ||
| 207 | /// Error messages. | ||
| 208 | /// </summary> | ||
| 209 | Error, | ||
| 210 | } | ||
| 211 | |||
| 212 | /// <summary> | ||
| 213 | /// Type of hash used for update bundle. | ||
| 214 | /// </summary> | ||
| 215 | public enum UpdateHashType | ||
| 216 | { | ||
| 217 | /// <summary> | ||
| 218 | /// No hash provided. | ||
| 219 | /// </summary> | ||
| 220 | None, | ||
| 221 | |||
| 222 | /// <summary> | ||
| 223 | /// SHA-1 based hash provided. | ||
| 224 | /// </summary> | ||
| 225 | Sha1, | ||
| 226 | } | ||
| 227 | |||
| 228 | /// <summary> | ||
| 229 | /// Describes the state of an installation package. | ||
| 230 | /// </summary> | ||
| 231 | public enum PackageState | ||
| 232 | { | ||
| 233 | Unknown, | ||
| 234 | Obsolete, | ||
| 235 | Absent, | ||
| 236 | Cached, | ||
| 237 | Present, | ||
| 238 | Superseded, | ||
| 239 | } | ||
| 240 | |||
| 241 | /// <summary> | ||
| 242 | /// Indicates the state desired for an installation package. | ||
| 243 | /// </summary> | ||
| 244 | public enum RequestState | ||
| 245 | { | ||
| 246 | None, | ||
| 247 | ForceAbsent, | ||
| 248 | Absent, | ||
| 249 | Cache, | ||
| 250 | Present, | ||
| 251 | Repair, | ||
| 252 | } | ||
| 253 | |||
| 254 | /// <summary> | ||
| 255 | /// Indicates the state of a feature. | ||
| 256 | /// </summary> | ||
| 257 | public enum FeatureState | ||
| 258 | { | ||
| 259 | Unknown, | ||
| 260 | Absent, | ||
| 261 | Advertised, | ||
| 262 | Local, | ||
| 263 | Source, | ||
| 264 | } | ||
| 265 | |||
| 266 | /// <summary> | ||
| 267 | /// Indicates the action for a feature. | ||
| 268 | /// </summary> | ||
| 269 | public enum FeatureAction | ||
| 270 | { | ||
| 271 | None, | ||
| 272 | AddLocal, | ||
| 273 | AddSource, | ||
| 274 | AddDefault, | ||
| 275 | Reinstall, | ||
| 276 | Advertise, | ||
| 277 | Remove, | ||
| 278 | } | ||
| 279 | } | ||
