diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-12-19 19:15:11 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-12-19 21:48:05 -0600 |
| commit | 80df808461fca91b53e232b5b504a5c868029697 (patch) | |
| tree | 0dc9efa22de03db0022f2a0e48b3fcd5874a10d2 /src/WixToolset.Mba.Core/Engine.cs | |
| parent | ca5d60d267051b4b75e22763ad8eda06f0501451 (diff) | |
| download | wix-80df808461fca91b53e232b5b504a5c868029697.tar.gz wix-80df808461fca91b53e232b5b504a5c868029697.tar.bz2 wix-80df808461fca91b53e232b5b504a5c868029697.zip | |
Enable XML doc.
Diffstat (limited to 'src/WixToolset.Mba.Core/Engine.cs')
| -rw-r--r-- | src/WixToolset.Mba.Core/Engine.cs | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/WixToolset.Mba.Core/Engine.cs b/src/WixToolset.Mba.Core/Engine.cs index c6570f9d..d5c43a53 100644 --- a/src/WixToolset.Mba.Core/Engine.cs +++ b/src/WixToolset.Mba.Core/Engine.cs | |||
| @@ -9,7 +9,7 @@ namespace WixToolset.Mba.Core | |||
| 9 | using System.Text; | 9 | using System.Text; |
| 10 | 10 | ||
| 11 | /// <summary> | 11 | /// <summary> |
| 12 | /// Container class for the <see cref="IBootstrapperEngine"/> interface. | 12 | /// Default implementation of <see cref="IEngine"/>. |
| 13 | /// </summary> | 13 | /// </summary> |
| 14 | public sealed class Engine : IEngine | 14 | public sealed class Engine : IEngine |
| 15 | { | 15 | { |
| @@ -28,6 +28,7 @@ namespace WixToolset.Mba.Core | |||
| 28 | this.engine = engine; | 28 | this.engine = engine; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | /// <inheritdoc/> | ||
| 31 | public int PackageCount | 32 | public int PackageCount |
| 32 | { | 33 | { |
| 33 | get | 34 | get |
| @@ -39,22 +40,26 @@ namespace WixToolset.Mba.Core | |||
| 39 | } | 40 | } |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 43 | /// <inheritdoc/> | ||
| 42 | public void Apply(IntPtr hwndParent) | 44 | public void Apply(IntPtr hwndParent) |
| 43 | { | 45 | { |
| 44 | this.engine.Apply(hwndParent); | 46 | this.engine.Apply(hwndParent); |
| 45 | } | 47 | } |
| 46 | 48 | ||
| 49 | /// <inheritdoc/> | ||
| 47 | public void CloseSplashScreen() | 50 | public void CloseSplashScreen() |
| 48 | { | 51 | { |
| 49 | this.engine.CloseSplashScreen(); | 52 | this.engine.CloseSplashScreen(); |
| 50 | } | 53 | } |
| 51 | 54 | ||
| 55 | /// <inheritdoc/> | ||
| 52 | public int CompareVersions(string version1, string version2) | 56 | public int CompareVersions(string version1, string version2) |
| 53 | { | 57 | { |
| 54 | this.engine.CompareVersions(version1, version2, out var result); | 58 | this.engine.CompareVersions(version1, version2, out var result); |
| 55 | return result; | 59 | return result; |
| 56 | } | 60 | } |
| 57 | 61 | ||
| 62 | /// <inheritdoc/> | ||
| 58 | public bool ContainsVariable(string name) | 63 | public bool ContainsVariable(string name) |
| 59 | { | 64 | { |
| 60 | int capacity = 0; | 65 | int capacity = 0; |
| @@ -62,16 +67,19 @@ namespace WixToolset.Mba.Core | |||
| 62 | return NativeMethods.E_NOTFOUND != ret; | 67 | return NativeMethods.E_NOTFOUND != ret; |
| 63 | } | 68 | } |
| 64 | 69 | ||
| 70 | /// <inheritdoc/> | ||
| 65 | public void Detect() | 71 | public void Detect() |
| 66 | { | 72 | { |
| 67 | this.Detect(IntPtr.Zero); | 73 | this.Detect(IntPtr.Zero); |
| 68 | } | 74 | } |
| 69 | 75 | ||
| 76 | /// <inheritdoc/> | ||
| 70 | public void Detect(IntPtr hwndParent) | 77 | public void Detect(IntPtr hwndParent) |
| 71 | { | 78 | { |
| 72 | this.engine.Detect(hwndParent); | 79 | this.engine.Detect(hwndParent); |
| 73 | } | 80 | } |
| 74 | 81 | ||
| 82 | /// <inheritdoc/> | ||
| 75 | public bool Elevate(IntPtr hwndParent) | 83 | public bool Elevate(IntPtr hwndParent) |
| 76 | { | 84 | { |
| 77 | int ret = this.engine.Elevate(hwndParent); | 85 | int ret = this.engine.Elevate(hwndParent); |
| @@ -90,6 +98,7 @@ namespace WixToolset.Mba.Core | |||
| 90 | } | 98 | } |
| 91 | } | 99 | } |
| 92 | 100 | ||
| 101 | /// <inheritdoc/> | ||
| 93 | public string EscapeString(string input) | 102 | public string EscapeString(string input) |
| 94 | { | 103 | { |
| 95 | int capacity = InitialBufferSize; | 104 | int capacity = InitialBufferSize; |
| @@ -111,6 +120,7 @@ namespace WixToolset.Mba.Core | |||
| 111 | return sb.ToString(); | 120 | return sb.ToString(); |
| 112 | } | 121 | } |
| 113 | 122 | ||
| 123 | /// <inheritdoc/> | ||
| 114 | public bool EvaluateCondition(string condition) | 124 | public bool EvaluateCondition(string condition) |
| 115 | { | 125 | { |
| 116 | bool value; | 126 | bool value; |
| @@ -119,6 +129,7 @@ namespace WixToolset.Mba.Core | |||
| 119 | return value; | 129 | return value; |
| 120 | } | 130 | } |
| 121 | 131 | ||
| 132 | /// <inheritdoc/> | ||
| 122 | public string FormatString(string format) | 133 | public string FormatString(string format) |
| 123 | { | 134 | { |
| 124 | int capacity = InitialBufferSize; | 135 | int capacity = InitialBufferSize; |
| @@ -140,6 +151,7 @@ namespace WixToolset.Mba.Core | |||
| 140 | return sb.ToString(); | 151 | return sb.ToString(); |
| 141 | } | 152 | } |
| 142 | 153 | ||
| 154 | /// <inheritdoc/> | ||
| 143 | public long GetVariableNumeric(string name) | 155 | public long GetVariableNumeric(string name) |
| 144 | { | 156 | { |
| 145 | int ret = this.engine.GetVariableNumeric(name, out long value); | 157 | int ret = this.engine.GetVariableNumeric(name, out long value); |
| @@ -151,6 +163,7 @@ namespace WixToolset.Mba.Core | |||
| 151 | return value; | 163 | return value; |
| 152 | } | 164 | } |
| 153 | 165 | ||
| 166 | /// <inheritdoc/> | ||
| 154 | public SecureString GetVariableSecureString(string name) | 167 | public SecureString GetVariableSecureString(string name) |
| 155 | { | 168 | { |
| 156 | var pUniString = this.getStringVariable(name, out var length); | 169 | var pUniString = this.getStringVariable(name, out var length); |
| @@ -167,6 +180,7 @@ namespace WixToolset.Mba.Core | |||
| 167 | } | 180 | } |
| 168 | } | 181 | } |
| 169 | 182 | ||
| 183 | /// <inheritdoc/> | ||
| 170 | public string GetVariableString(string name) | 184 | public string GetVariableString(string name) |
| 171 | { | 185 | { |
| 172 | int length; | 186 | int length; |
| @@ -184,6 +198,7 @@ namespace WixToolset.Mba.Core | |||
| 184 | } | 198 | } |
| 185 | } | 199 | } |
| 186 | 200 | ||
| 201 | /// <inheritdoc/> | ||
| 187 | public string GetVariableVersion(string name) | 202 | public string GetVariableVersion(string name) |
| 188 | { | 203 | { |
| 189 | int length; | 204 | int length; |
| @@ -201,46 +216,55 @@ namespace WixToolset.Mba.Core | |||
| 201 | } | 216 | } |
| 202 | } | 217 | } |
| 203 | 218 | ||
| 219 | /// <inheritdoc/> | ||
| 204 | public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments) | 220 | public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments) |
| 205 | { | 221 | { |
| 206 | this.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, 0); | 222 | this.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, 0); |
| 207 | } | 223 | } |
| 208 | 224 | ||
| 225 | /// <inheritdoc/> | ||
| 209 | public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments, int waitForInputIdleTimeout) | 226 | public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments, int waitForInputIdleTimeout) |
| 210 | { | 227 | { |
| 211 | this.engine.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, waitForInputIdleTimeout); | 228 | this.engine.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, waitForInputIdleTimeout); |
| 212 | } | 229 | } |
| 230 | /// <inheritdoc/> | ||
| 213 | 231 | ||
| 214 | public void Log(LogLevel level, string message) | 232 | public void Log(LogLevel level, string message) |
| 215 | { | 233 | { |
| 216 | this.engine.Log(level, message); | 234 | this.engine.Log(level, message); |
| 217 | } | 235 | } |
| 218 | 236 | ||
| 237 | /// <inheritdoc/> | ||
| 219 | public void Plan(LaunchAction action) | 238 | public void Plan(LaunchAction action) |
| 220 | { | 239 | { |
| 221 | this.engine.Plan(action); | 240 | this.engine.Plan(action); |
| 222 | } | 241 | } |
| 223 | 242 | ||
| 243 | /// <inheritdoc/> | ||
| 224 | public void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, byte[] hash) | 244 | public void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, byte[] hash) |
| 225 | { | 245 | { |
| 226 | this.engine.SetUpdate(localSource, downloadSource, size, hashType, hash, null == hash ? 0 : hash.Length); | 246 | this.engine.SetUpdate(localSource, downloadSource, size, hashType, hash, null == hash ? 0 : hash.Length); |
| 227 | } | 247 | } |
| 228 | 248 | ||
| 249 | /// <inheritdoc/> | ||
| 229 | public void SetLocalSource(string packageOrContainerId, string payloadId, string path) | 250 | public void SetLocalSource(string packageOrContainerId, string payloadId, string path) |
| 230 | { | 251 | { |
| 231 | this.engine.SetLocalSource(packageOrContainerId, payloadId, path); | 252 | this.engine.SetLocalSource(packageOrContainerId, payloadId, path); |
| 232 | } | 253 | } |
| 233 | 254 | ||
| 255 | /// <inheritdoc/> | ||
| 234 | public void SetDownloadSource(string packageOrContainerId, string payloadId, string url, string user, string password) | 256 | public void SetDownloadSource(string packageOrContainerId, string payloadId, string url, string user, string password) |
| 235 | { | 257 | { |
| 236 | this.engine.SetDownloadSource(packageOrContainerId, payloadId, url, user, password); | 258 | this.engine.SetDownloadSource(packageOrContainerId, payloadId, url, user, password); |
| 237 | } | 259 | } |
| 238 | 260 | ||
| 261 | /// <inheritdoc/> | ||
| 239 | public void SetVariableNumeric(string name, long value) | 262 | public void SetVariableNumeric(string name, long value) |
| 240 | { | 263 | { |
| 241 | this.engine.SetVariableNumeric(name, value); | 264 | this.engine.SetVariableNumeric(name, value); |
| 242 | } | 265 | } |
| 243 | 266 | ||
| 267 | /// <inheritdoc/> | ||
| 244 | public void SetVariableString(string name, SecureString value, bool formatted) | 268 | public void SetVariableString(string name, SecureString value, bool formatted) |
| 245 | { | 269 | { |
| 246 | IntPtr pValue = Marshal.SecureStringToCoTaskMemUnicode(value); | 270 | IntPtr pValue = Marshal.SecureStringToCoTaskMemUnicode(value); |
| @@ -254,6 +278,7 @@ namespace WixToolset.Mba.Core | |||
| 254 | } | 278 | } |
| 255 | } | 279 | } |
| 256 | 280 | ||
| 281 | /// <inheritdoc/> | ||
| 257 | public void SetVariableString(string name, string value, bool formatted) | 282 | public void SetVariableString(string name, string value, bool formatted) |
| 258 | { | 283 | { |
| 259 | IntPtr pValue = Marshal.StringToCoTaskMemUni(value); | 284 | IntPtr pValue = Marshal.StringToCoTaskMemUni(value); |
| @@ -267,6 +292,7 @@ namespace WixToolset.Mba.Core | |||
| 267 | } | 292 | } |
| 268 | } | 293 | } |
| 269 | 294 | ||
| 295 | /// <inheritdoc/> | ||
| 270 | public void SetVariableVersion(string name, string value) | 296 | public void SetVariableVersion(string name, string value) |
| 271 | { | 297 | { |
| 272 | IntPtr pValue = Marshal.StringToCoTaskMemUni(value); | 298 | IntPtr pValue = Marshal.StringToCoTaskMemUni(value); |
| @@ -280,6 +306,7 @@ namespace WixToolset.Mba.Core | |||
| 280 | } | 306 | } |
| 281 | } | 307 | } |
| 282 | 308 | ||
| 309 | /// <inheritdoc/> | ||
| 283 | public int SendEmbeddedError(int errorCode, string message, int uiHint) | 310 | public int SendEmbeddedError(int errorCode, string message, int uiHint) |
| 284 | { | 311 | { |
| 285 | int result = 0; | 312 | int result = 0; |
| @@ -287,6 +314,7 @@ namespace WixToolset.Mba.Core | |||
| 287 | return result; | 314 | return result; |
| 288 | } | 315 | } |
| 289 | 316 | ||
| 317 | /// <inheritdoc/> | ||
| 290 | public int SendEmbeddedProgress(int progressPercentage, int overallPercentage) | 318 | public int SendEmbeddedProgress(int progressPercentage, int overallPercentage) |
| 291 | { | 319 | { |
| 292 | int result = 0; | 320 | int result = 0; |
| @@ -294,6 +322,7 @@ namespace WixToolset.Mba.Core | |||
| 294 | return result; | 322 | return result; |
| 295 | } | 323 | } |
| 296 | 324 | ||
| 325 | /// <inheritdoc/> | ||
| 297 | public void Quit(int exitCode) | 326 | public void Quit(int exitCode) |
| 298 | { | 327 | { |
| 299 | this.engine.Quit(exitCode); | 328 | this.engine.Quit(exitCode); |
| @@ -423,6 +452,11 @@ namespace WixToolset.Mba.Core | |||
| 423 | return value; | 452 | return value; |
| 424 | } | 453 | } |
| 425 | 454 | ||
| 455 | /// <summary> | ||
| 456 | /// Utility method for converting a <see cref="Version"/> into a <see cref="long"/>. | ||
| 457 | /// </summary> | ||
| 458 | /// <param name="version"></param> | ||
| 459 | /// <returns></returns> | ||
| 426 | public static long VersionToLong(Version version) | 460 | public static long VersionToLong(Version version) |
| 427 | { | 461 | { |
| 428 | // In Windows, each version component has a max value of 65535, | 462 | // In Windows, each version component has a max value of 65535, |
| @@ -435,6 +469,11 @@ namespace WixToolset.Mba.Core | |||
| 435 | return major | minor | build | revision; | 469 | return major | minor | build | revision; |
| 436 | } | 470 | } |
| 437 | 471 | ||
| 472 | /// <summary> | ||
| 473 | /// Utility method for converting a <see cref="long"/> into a <see cref="Version"/>. | ||
| 474 | /// </summary> | ||
| 475 | /// <param name="version"></param> | ||
| 476 | /// <returns></returns> | ||
| 438 | public static Version LongToVersion(long version) | 477 | public static Version LongToVersion(long version) |
| 439 | { | 478 | { |
| 440 | int major = (int)((version & ((long)0xffff << 48)) >> 48); | 479 | int major = (int)((version & ((long)0xffff << 48)) >> 48); |
| @@ -446,7 +485,7 @@ namespace WixToolset.Mba.Core | |||
| 446 | } | 485 | } |
| 447 | 486 | ||
| 448 | /// <summary> | 487 | /// <summary> |
| 449 | /// Verifies that VersionVariables can pass on the given Version to the engine. | 488 | /// Verifies that Version can be represented in a <see cref="long"/>. |
| 450 | /// If the Build or Revision fields are undefined, they are set to zero. | 489 | /// If the Build or Revision fields are undefined, they are set to zero. |
| 451 | /// </summary> | 490 | /// </summary> |
| 452 | public static Version NormalizeVersion(Version version) | 491 | public static Version NormalizeVersion(Version version) |
