From 80df808461fca91b53e232b5b504a5c868029697 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 19 Dec 2020 19:15:11 -0600 Subject: Enable XML doc. --- src/CSharp.Build.props | 2 + src/Directory.Build.targets | 8 + .../BaseBootstrapperApplicationFactory.cs | 27 + src/WixToolset.Mba.Core/BootstrapperApplication.cs | 424 ++++------- .../BootstrapperApplicationData.cs | 38 + src/WixToolset.Mba.Core/BootstrapperCommand.cs | 30 + src/WixToolset.Mba.Core/BundleInfo.cs | 21 + src/WixToolset.Mba.Core/Engine.cs | 43 +- src/WixToolset.Mba.Core/EventArgs.cs | 54 +- .../IBootstrapperApplication.cs | 808 ++++++++++++++++++++- .../IBootstrapperApplicationData.cs | 10 + .../IBootstrapperApplicationFactory.cs | 31 +- src/WixToolset.Mba.Core/IBootstrapperCommand.cs | 3 + src/WixToolset.Mba.Core/IBootstrapperEngine.cs | 303 ++++++++ src/WixToolset.Mba.Core/IBundleInfo.cs | 23 + .../IDefaultBootstrapperApplication.cs | 278 +++++++ src/WixToolset.Mba.Core/IEngine.cs | 3 + src/WixToolset.Mba.Core/IPackageInfo.cs | 66 ++ src/WixToolset.Mba.Core/PackageInfo.cs | 107 +++ src/WixToolset.Mba.Core/VerUtil.cs | 19 + src/WixToolset.Mba.Core/VerUtilVersion.cs | 36 + .../VerUtilVersionReleaseLabel.cs | 14 + src/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj | 6 +- src/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec | 2 + .../BaseBootstrapperApplicationFactoryFixture.cs | 19 + 25 files changed, 2045 insertions(+), 330 deletions(-) diff --git a/src/CSharp.Build.props b/src/CSharp.Build.props index b12f4c6e..81d24ad1 100644 --- a/src/CSharp.Build.props +++ b/src/CSharp.Build.props @@ -5,7 +5,9 @@ --> + true true $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) + false diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index dac7452a..cb988931 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -9,6 +9,11 @@ See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284 --> + + false + $(OutputPath)\$(AssemblyName).xml + + true $(SolutionPath) @@ -45,4 +50,7 @@ + + + diff --git a/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs b/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs index 264733ac..ad8a5dc0 100644 --- a/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs +++ b/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs @@ -5,8 +5,16 @@ namespace WixToolset.Mba.Core using System; using System.Runtime.InteropServices; + /// + /// Default implementation of . + /// public abstract class BaseBootstrapperApplicationFactory : IBootstrapperApplicationFactory { + /// + /// Default implementation of + /// + /// + /// public void Create(IntPtr pArgs, IntPtr pResults) { InitializeFromCreateArgs(pArgs, out var engine, out var bootstrapperCommand); @@ -15,8 +23,21 @@ namespace WixToolset.Mba.Core StoreBAInCreateResults(pResults, ba); } + /// + /// Called by to get the . + /// + /// The bundle engine. + /// Command information passed from the engine for the BA to perform. + /// The for the bundle. protected abstract IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand); + /// + /// Initializes the native part of . + /// Most users should inherit from instead of calling this method. + /// + /// The args struct given by the engine when initially creating the BA. + /// The bundle engine interface. + /// The context of the current run of the bundle. public static void InitializeFromCreateArgs(IntPtr pArgs, out IEngine engine, out IBootstrapperCommand bootstrapperCommand) { Command pCommand = new Command @@ -28,6 +49,12 @@ namespace WixToolset.Mba.Core bootstrapperCommand = pCommand.GetBootstrapperCommand(); } + /// + /// Registers the BA with the engine using the default mapping between the message based interface and the COM interface. + /// Most users should inherit from instead of calling this method. + /// + /// The results struct given by the engine when initially creating the BA + /// The . public static void StoreBAInCreateResults(IntPtr pResults, IBootstrapperApplication ba) { BalUtil.StoreBAInCreateResults(pResults, ba); diff --git a/src/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/WixToolset.Mba.Core/BootstrapperApplication.cs index 2d527427..759e76b1 100644 --- a/src/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/WixToolset.Mba.Core/BootstrapperApplication.cs @@ -34,347 +34,202 @@ namespace WixToolset.Mba.Core this.asyncExecution = true; } - /// - /// Fired when the engine is starting up the bootstrapper application. - /// + /// public event EventHandler Startup; - /// - /// Fired when the engine is shutting down the bootstrapper application. - /// + /// public event EventHandler Shutdown; - /// - /// Fired when the system is shutting down or user is logging off. - /// - /// - /// To prevent shutting down or logging off, set to - /// true; otherwise, set it to false. - /// By default setup will prevent shutting down or logging off between - /// and . - /// Derivatives can change this behavior by overriding - /// or handling . - /// If contains - /// the bootstrapper cannot prevent the shutdown and only has a few seconds to save state or perform any other - /// critical operations before being closed by the operating system. - /// This event may be fired on a different thread. - /// + /// public event EventHandler SystemShutdown; - /// - /// Fired when the overall detection phase has begun. - /// + /// public event EventHandler DetectBegin; - /// - /// Fired when a forward compatible bundle is detected. - /// + /// public event EventHandler DetectForwardCompatibleBundle; - /// - /// Fired when the update detection phase has begun. - /// + /// public event EventHandler DetectUpdateBegin; - /// - /// Fired when the update detection has found a potential update candidate. - /// + /// public event EventHandler DetectUpdate; - /// - /// Fired when the update detection phase has completed. - /// + /// public event EventHandler DetectUpdateComplete; - /// - /// Fired when a related bundle has been detected for a bundle. - /// + /// public event EventHandler DetectRelatedBundle; - /// - /// Fired when the detection for a specific package has begun. - /// + /// public event EventHandler DetectPackageBegin; - /// - /// Fired when a package was not detected but a package using the same provider key was. - /// + /// public event EventHandler DetectCompatibleMsiPackage; - - /// - /// Fired when a related MSI package has been detected for a package. - /// + + /// public event EventHandler DetectRelatedMsiPackage; - /// - /// Fired when an MSP package detects a target MSI has been detected. - /// + /// public event EventHandler DetectTargetMsiPackage; - /// - /// Fired when a feature in an MSI package has been detected. - /// + /// public event EventHandler DetectMsiFeature; - /// - /// Fired when the detection for a specific package has completed. - /// + /// public event EventHandler DetectPackageComplete; - /// - /// Fired when the detection phase has completed. - /// + /// public event EventHandler DetectComplete; - /// - /// Fired when the engine has begun planning the installation. - /// + /// public event EventHandler PlanBegin; - /// - /// Fired when the engine has begun planning for a related bundle. - /// + /// public event EventHandler PlanRelatedBundle; - /// - /// Fired when the engine has begun planning the installation of a specific package. - /// + /// public event EventHandler PlanPackageBegin; - /// - /// Fired when the engine plans a new, compatible package using the same provider key. - /// + /// public event EventHandler PlanCompatibleMsiPackageBegin; - /// - /// Fired when the engine has completed planning the installation of a specific package. - /// + /// public event EventHandler PlanCompatibleMsiPackageComplete; - /// - /// Fired when the engine is about to plan the target MSI of a MSP package. - /// + /// public event EventHandler PlanTargetMsiPackage; - /// - /// Fired when the engine is about to plan a feature in an MSI package. - /// + /// public event EventHandler PlanMsiFeature; - /// - /// Fired when the engine is planning an MSI or MSP package. - /// + /// public event EventHandler PlanMsiPackage; - /// - /// Fired when the engine has completed planning the installation of a specific package. - /// + /// public event EventHandler PlanPackageComplete; - /// - /// Fired when the engine has completed planning the installation. - /// + /// public event EventHandler PlanComplete; - /// - /// Fired when the engine has begun installing the bundle. - /// + /// public event EventHandler ApplyBegin; - /// - /// Fired when the engine is about to start the elevated process. - /// + /// public event EventHandler ElevateBegin; - /// - /// Fired when the engine has completed starting the elevated process. - /// + /// public event EventHandler ElevateComplete; - /// - /// Fired when the engine has changed progress for the bundle installation. - /// + /// public event EventHandler Progress; - /// - /// Fired when the engine has encountered an error. - /// + /// public event EventHandler Error; - /// - /// Fired when the engine has begun registering the location and visibility of the bundle. - /// + /// public event EventHandler RegisterBegin; - /// - /// Fired when the engine has completed registering the location and visibility of the bundle. - /// + /// public event EventHandler RegisterComplete; - /// - /// Fired when the engine has begun removing the registration for the location and visibility of the bundle. - /// + /// public event EventHandler UnregisterBegin; - /// - /// Fired when the engine has completed removing the registration for the location and visibility of the bundle. - /// + /// public event EventHandler UnregisterComplete; - /// - /// Fired when the engine has begun caching the installation sources. - /// + /// public event EventHandler CacheBegin; - /// - /// Fired when the engine has begun caching a specific package. - /// + /// public event EventHandler CachePackageBegin; - /// - /// Fired when the engine has begun acquiring the installation sources. - /// + /// public event EventHandler CacheAcquireBegin; - /// - /// Fired when the engine has progress acquiring the installation sources. - /// + /// public event EventHandler CacheAcquireProgress; - /// - /// Fired by the engine to allow the BA to change the source - /// using or . - /// + /// public event EventHandler ResolveSource; - /// - /// Fired when the engine has completed the acquisition of the installation sources. - /// + /// public event EventHandler CacheAcquireComplete; - /// - /// Fired when the engine begins the verification of the acquired installation sources. - /// + /// public event EventHandler CacheVerifyBegin; - /// - /// Fired when the engine complete the verification of the acquired installation sources. - /// + /// public event EventHandler CacheVerifyComplete; - /// - /// Fired when the engine has completed caching a specific package. - /// + /// public event EventHandler CachePackageComplete; - /// - /// Fired after the engine has cached the installation sources. - /// + /// public event EventHandler CacheComplete; - /// - /// Fired when the engine has begun installing packages. - /// + /// public event EventHandler ExecuteBegin; - /// - /// Fired when the engine has begun installing a specific package. - /// + /// public event EventHandler ExecutePackageBegin; - /// - /// Fired when the engine executes one or more patches targeting a product. - /// + /// public event EventHandler ExecutePatchTarget; - /// - /// Fired when Windows Installer sends an installation message. - /// + /// public event EventHandler ExecuteMsiMessage; - /// - /// Fired when Windows Installer sends a files in use installation message. - /// + /// public event EventHandler ExecuteFilesInUse; - /// - /// Fired when the engine has completed installing a specific package. - /// + /// public event EventHandler ExecutePackageComplete; - /// - /// Fired when the engine has completed installing packages. - /// + /// public event EventHandler ExecuteComplete; - /// - /// Fired when the engine has completed installing the bundle. - /// + /// public event EventHandler ApplyComplete; - /// - /// Fired by the engine while executing on payload. - /// + /// public event EventHandler ExecuteProgress; - /// - /// Fired when the engine is about to launch the preapproved executable. - /// + /// public event EventHandler LaunchApprovedExeBegin; - /// - /// Fired when the engine has completed launching the preapproved executable. - /// + /// public event EventHandler LaunchApprovedExeComplete; - /// - /// Fired when the engine is about to begin an MSI transaction. - /// + /// public event EventHandler BeginMsiTransactionBegin; - /// - /// Fired when the engine has completed beginning an MSI transaction. - /// + /// public event EventHandler BeginMsiTransactionComplete; - /// - /// Fired when the engine is about to commit an MSI transaction. - /// + /// public event EventHandler CommitMsiTransactionBegin; - /// - /// Fired when the engine has completed comitting an MSI transaction. - /// + /// public event EventHandler CommitMsiTransactionComplete; - /// - /// Fired when the engine is about to rollback an MSI transaction. - /// + /// public event EventHandler RollbackMsiTransactionBegin; - /// - /// Fired when the engine has completed rolling back an MSI transaction. - /// + /// public event EventHandler RollbackMsiTransactionComplete; - /// - /// Fired when the engine is about to pause Windows automatic updates. - /// + /// public event EventHandler PauseAutomaticUpdatesBegin; - /// - /// Fired when the engine has completed pausing Windows automatic updates. - /// + /// public event EventHandler PauseAutomaticUpdatesComplete; - /// - /// Fired when the engine is about to take a system restore point. - /// + /// public event EventHandler SystemRestorePointBegin; - /// - /// Fired when the engine has completed taking a system restore point. - /// + /// public event EventHandler SystemRestorePointComplete; /// @@ -383,7 +238,7 @@ namespace WixToolset.Mba.Core protected abstract void Run(); /// - /// Called by the engine on startup of the bootstrapper application. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnStartup(StartupEventArgs args) @@ -410,7 +265,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine to uninitialize the BA. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnShutdown(ShutdownEventArgs args) @@ -423,21 +278,9 @@ namespace WixToolset.Mba.Core } /// - /// Called when the system is shutting down or the user is logging off. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. - /// - /// To prevent shutting down or logging off, set to - /// true; otherwise, set it to false. - /// By default setup will prevent shutting down or logging off between - /// and . - /// Derivatives can change this behavior by overriding - /// or handling . - /// If contains - /// the bootstrapper cannot prevent the shutdown and only has a few seconds to save state or perform any other - /// critical operations before being closed by the operating system. - /// This method may be called on a different thread. - /// protected virtual void OnSystemShutdown(SystemShutdownEventArgs args) { EventHandler handler = this.SystemShutdown; @@ -454,7 +297,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the overall detection phase has begun. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectBegin(DetectBeginEventArgs args) @@ -467,7 +310,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the update detection phase has begun. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectForwardCompatibleBundle(DetectForwardCompatibleBundleEventArgs args) @@ -480,7 +323,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the update detection phase has begun. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args) @@ -493,7 +336,7 @@ namespace WixToolset.Mba.Core } /// - /// Fired when the update detection has found a potential update candidate. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectUpdate(DetectUpdateEventArgs args) @@ -506,7 +349,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the update detection phase has completed. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectUpdateComplete(DetectUpdateCompleteEventArgs args) @@ -519,7 +362,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when a related bundle has been detected for a bundle. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectRelatedBundle(DetectRelatedBundleEventArgs args) @@ -532,7 +375,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the detection for a specific package has begun. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectPackageBegin(DetectPackageBeginEventArgs args) @@ -545,7 +388,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when a package was not detected but a package using the same provider key was. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectCompatibleMsiPackage(DetectCompatibleMsiPackageEventArgs args) @@ -558,7 +401,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when a related MSI package has been detected for a package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectRelatedMsiPackage(DetectRelatedMsiPackageEventArgs args) @@ -571,7 +414,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when an MSP package detects a target MSI has been detected. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectTargetMsiPackage(DetectTargetMsiPackageEventArgs args) @@ -584,7 +427,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when an MSI feature has been detected for a package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectMsiFeature(DetectMsiFeatureEventArgs args) @@ -597,7 +440,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the detection for a specific package has completed. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectPackageComplete(DetectPackageCompleteEventArgs args) @@ -610,7 +453,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the detection phase has completed. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnDetectComplete(DetectCompleteEventArgs args) @@ -623,7 +466,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has begun planning the installation. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanBegin(PlanBeginEventArgs args) @@ -636,7 +479,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has begun planning for a prior bundle. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanRelatedBundle(PlanRelatedBundleEventArgs args) @@ -649,7 +492,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has begun planning the installation of a specific package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanPackageBegin(PlanPackageBeginEventArgs args) @@ -662,7 +505,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine plans a new, compatible package using the same provider key. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanCompatibleMsiPackageBegin(PlanCompatibleMsiPackageBeginEventArgs args) @@ -675,7 +518,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has completed planning the installation of a specific package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanCompatibleMsiPackageComplete(PlanCompatibleMsiPackageCompleteEventArgs args) @@ -688,7 +531,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine is about to plan the target MSI of a MSP package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanTargetMsiPackage(PlanTargetMsiPackageEventArgs args) @@ -701,7 +544,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine is about to plan an MSI feature of a specific package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanMsiFeature(PlanMsiFeatureEventArgs args) @@ -714,7 +557,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine is planning an MSI or MSP package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanMsiPackage(PlanMsiPackageEventArgs args) @@ -727,7 +570,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when then engine has completed planning the installation of a specific package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanPackageComplete(PlanPackageCompleteEventArgs args) @@ -740,7 +583,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has completed planning the installation. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPlanComplete(PlanCompleteEventArgs args) @@ -753,7 +596,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has begun installing the bundle. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnApplyBegin(ApplyBeginEventArgs args) @@ -766,7 +609,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine is about to start the elevated process. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnElevateBegin(ElevateBeginEventArgs args) @@ -779,7 +622,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has completed starting the elevated process. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnElevateComplete(ElevateCompleteEventArgs args) @@ -792,7 +635,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has changed progress for the bundle installation. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnProgress(ProgressEventArgs args) @@ -805,7 +648,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has encountered an error. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnError(ErrorEventArgs args) @@ -818,7 +661,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has begun registering the location and visibility of the bundle. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnRegisterBegin(RegisterBeginEventArgs args) @@ -831,7 +674,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has completed registering the location and visilibity of the bundle. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnRegisterComplete(RegisterCompleteEventArgs args) @@ -844,7 +687,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has begun removing the registration for the location and visibility of the bundle. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnUnregisterBegin(UnregisterBeginEventArgs args) @@ -857,7 +700,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has completed removing the registration for the location and visibility of the bundle. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnUnregisterComplete(UnregisterCompleteEventArgs args) @@ -870,7 +713,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine begins to cache the installation sources. + /// Called by the engine, raises the event. /// /// protected virtual void OnCacheBegin(CacheBeginEventArgs args) @@ -883,7 +726,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine when it begins to cache a specific package. + /// Called by the engine, raises the event. /// /// protected virtual void OnCachePackageBegin(CachePackageBeginEventArgs args) @@ -896,7 +739,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine begins to cache the container or payload. + /// Called by the engine, raises the event. /// /// protected virtual void OnCacheAcquireBegin(CacheAcquireBeginEventArgs args) @@ -909,7 +752,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has progressed on caching the container or payload. + /// Called by the engine, raises the event. /// /// protected virtual void OnCacheAcquireProgress(CacheAcquireProgressEventArgs args) @@ -922,8 +765,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine to allow the BA to change the source - /// using or . + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnResolveSource(ResolveSourceEventArgs args) @@ -936,7 +778,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine completes caching of the container or payload. + /// Called by the engine, raises the event. /// /// protected virtual void OnCacheAcquireComplete(CacheAcquireCompleteEventArgs args) @@ -949,7 +791,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has started verify the payload. + /// Called by the engine, raises the event. /// /// protected virtual void OnCacheVerifyBegin(CacheVerifyBeginEventArgs args) @@ -962,7 +804,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine completes verification of the payload. + /// Called by the engine, raises the event. /// /// protected virtual void OnCacheVerifyComplete(CacheVerifyCompleteEventArgs args) @@ -975,7 +817,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine completes caching a specific package. + /// Called by the engine, raises the event. /// /// protected virtual void OnCachePackageComplete(CachePackageCompleteEventArgs args) @@ -988,7 +830,7 @@ namespace WixToolset.Mba.Core } /// - /// Called after the engine has cached the installation sources. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnCacheComplete(CacheCompleteEventArgs args) @@ -1001,7 +843,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has begun installing packages. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnExecuteBegin(ExecuteBeginEventArgs args) @@ -1014,7 +856,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has begun installing a specific package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnExecutePackageBegin(ExecutePackageBeginEventArgs args) @@ -1027,7 +869,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine executes one or more patches targeting a product. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnExecutePatchTarget(ExecutePatchTargetEventArgs args) @@ -1040,7 +882,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when Windows Installer sends an installation message. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnExecuteMsiMessage(ExecuteMsiMessageEventArgs args) @@ -1053,7 +895,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when Windows Installer sends a file in use installation message. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnExecuteFilesInUse(ExecuteFilesInUseEventArgs args) @@ -1066,7 +908,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has completed installing a specific package. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnExecutePackageComplete(ExecutePackageCompleteEventArgs args) @@ -1079,7 +921,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has completed installing packages. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnExecuteComplete(ExecuteCompleteEventArgs args) @@ -1092,7 +934,7 @@ namespace WixToolset.Mba.Core } /// - /// Called when the engine has completed installing the bundle. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnApplyComplete(ApplyCompleteEventArgs args) @@ -1105,7 +947,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine while executing on payload. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnExecuteProgress(ExecuteProgressEventArgs args) @@ -1118,7 +960,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine before trying to launch the preapproved executable. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnLaunchApprovedExeBegin(LaunchApprovedExeBeginEventArgs args) @@ -1131,7 +973,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine after trying to launch the preapproved executable. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnLaunchApprovedExeComplete(LaunchApprovedExeCompleteEventArgs args) @@ -1144,7 +986,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine before beginning an MSI transaction. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnBeginMsiTransactionBegin(BeginMsiTransactionBeginEventArgs args) @@ -1157,7 +999,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine after beginning an MSI transaction. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnBeginMsiTransactionComplete(BeginMsiTransactionCompleteEventArgs args) @@ -1170,7 +1012,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine before committing an MSI transaction. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnCommitMsiTransactionBegin(CommitMsiTransactionBeginEventArgs args) @@ -1183,7 +1025,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine after committing an MSI transaction. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnCommitMsiTransactionComplete(CommitMsiTransactionCompleteEventArgs args) @@ -1196,7 +1038,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine before rolling back an MSI transaction. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnRollbackMsiTransactionBegin(RollbackMsiTransactionBeginEventArgs args) @@ -1209,7 +1051,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine after rolling back an MSI transaction. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnRollbackMsiTransactionComplete(RollbackMsiTransactionCompleteEventArgs args) @@ -1222,7 +1064,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine before pausing Windows automatic updates. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPauseAutomaticUpdatesBegin(PauseAutomaticUpdatesBeginEventArgs args) @@ -1235,7 +1077,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine after pausing Windows automatic updates. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnPauseAutomaticUpdatesComplete(PauseAutomaticUpdatesCompleteEventArgs args) @@ -1248,7 +1090,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine before taking a system restore point. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnSystemRestorePointBegin(SystemRestorePointBeginEventArgs args) @@ -1261,7 +1103,7 @@ namespace WixToolset.Mba.Core } /// - /// Called by the engine after taking a system restore point. + /// Called by the engine, raises the event. /// /// Additional arguments for this event. protected virtual void OnSystemRestorePointComplete(SystemRestorePointCompleteEventArgs args) diff --git a/src/WixToolset.Mba.Core/BootstrapperApplicationData.cs b/src/WixToolset.Mba.Core/BootstrapperApplicationData.cs index 05672f1b..739a08bb 100644 --- a/src/WixToolset.Mba.Core/BootstrapperApplicationData.cs +++ b/src/WixToolset.Mba.Core/BootstrapperApplicationData.cs @@ -6,12 +6,29 @@ namespace WixToolset.Mba.Core using System.IO; using System.Xml.XPath; + /// + /// Utility class for reading BootstrapperApplicationData.xml. + /// public class BootstrapperApplicationData : IBootstrapperApplicationData { + /// + /// + /// public const string DefaultFileName = "BootstrapperApplicationData.xml"; + + /// + /// + /// public const string XMLNamespace = "http://wixtoolset.org/schemas/v4/BootstrapperApplicationData"; + /// + /// The default path of where the BA was extracted to. + /// public static readonly DirectoryInfo DefaultFolder; + + /// + /// The default path to BootstrapperApplicationData.xml. + /// public static readonly FileInfo DefaultFile; static BootstrapperApplicationData() @@ -20,12 +37,21 @@ namespace WixToolset.Mba.Core DefaultFile = new FileInfo(Path.Combine(DefaultFolder.FullName, DefaultFileName)); } + /// public FileInfo BADataFile { get; private set; } + /// public IBundleInfo Bundle { get; private set; } + /// + /// Uses the default location for BootstrapperApplicationData.xml. + /// public BootstrapperApplicationData() : this(DefaultFile) { } + /// + /// Uses the given file for BootstrapperApplicationData.xml. + /// + /// public BootstrapperApplicationData(FileInfo baDataFile) { this.BADataFile = baDataFile; @@ -36,6 +62,12 @@ namespace WixToolset.Mba.Core } } + /// + /// Utility method for parsing BootstrapperApplicationData.xml. + /// + /// + /// + /// public static string GetAttribute(XPathNavigator node, string attributeName) { XPathNavigator attribute = node.SelectSingleNode("@" + attributeName); @@ -48,6 +80,12 @@ namespace WixToolset.Mba.Core return attribute.Value; } + /// + /// Utility method for parsing BootstrapperApplicationData.xml. + /// + /// + /// + /// public static bool? GetYesNoAttribute(XPathNavigator node, string attributeName) { string attributeValue = GetAttribute(node, attributeName); diff --git a/src/WixToolset.Mba.Core/BootstrapperCommand.cs b/src/WixToolset.Mba.Core/BootstrapperCommand.cs index 42d19bf9..65dde0f4 100644 --- a/src/WixToolset.Mba.Core/BootstrapperCommand.cs +++ b/src/WixToolset.Mba.Core/BootstrapperCommand.cs @@ -6,10 +6,28 @@ namespace WixToolset.Mba.Core using System.ComponentModel; using System.Runtime.InteropServices; + /// + /// Default implementation of . + /// public sealed class BootstrapperCommand : IBootstrapperCommand { private readonly string commandLine; + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public BootstrapperCommand( LaunchAction action, Display display, @@ -38,28 +56,40 @@ namespace WixToolset.Mba.Core this.BootstrapperApplicationDataPath = bootstrapperApplicationDataPath; } + /// public LaunchAction Action { get; } + /// public Display Display { get; } + /// public Restart Restart { get; } + /// public string[] CommandLineArgs => GetCommandLineArgs(this.commandLine); + /// public int CmdShow { get; } + /// public ResumeType Resume { get; } + /// public IntPtr SplashScreen { get; } + /// public RelationType Relation { get; } + /// public bool Passthrough { get; } + /// public string LayoutDirectory { get; } + /// public string BootstrapperWorkingFolder { get; } + /// public string BootstrapperApplicationDataPath { get; } /// diff --git a/src/WixToolset.Mba.Core/BundleInfo.cs b/src/WixToolset.Mba.Core/BundleInfo.cs index e1a56878..3d5d535d 100644 --- a/src/WixToolset.Mba.Core/BundleInfo.cs +++ b/src/WixToolset.Mba.Core/BundleInfo.cs @@ -8,11 +8,21 @@ namespace WixToolset.Mba.Core using System.Xml; using System.Xml.XPath; + /// + /// Default implementation of . + /// public class BundleInfo : IBundleInfo { + /// public bool PerMachine { get; internal set; } + + /// public string Name { get; internal set; } + + /// public string LogVariable { get; internal set; } + + /// public IDictionary Packages { get; internal set; } internal BundleInfo() @@ -20,6 +30,7 @@ namespace WixToolset.Mba.Core this.Packages = new Dictionary(); } + /// public IPackageInfo AddRelatedBundleAsPackage(DetectRelatedBundleEventArgs e) { var package = PackageInfo.GetRelatedBundleAsPackage(e.ProductCode, e.RelationType, e.PerMachine, e.Version); @@ -27,6 +38,11 @@ namespace WixToolset.Mba.Core return package; } + /// + /// Parses BA manifest from the given stream. + /// + /// + /// public static IBundleInfo ParseBundleFromStream(Stream stream) { XPathDocument manifest = new XPathDocument(stream); @@ -34,6 +50,11 @@ namespace WixToolset.Mba.Core return ParseBundleFromXml(root); } + /// + /// Parses BA manifest from the given . + /// + /// The root of the BA manifest. + /// public static IBundleInfo ParseBundleFromXml(XPathNavigator root) { BundleInfo bundle = new BundleInfo(); 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 using System.Text; /// - /// Container class for the interface. + /// Default implementation of . /// public sealed class Engine : IEngine { @@ -28,6 +28,7 @@ namespace WixToolset.Mba.Core this.engine = engine; } + /// public int PackageCount { get @@ -39,22 +40,26 @@ namespace WixToolset.Mba.Core } } + /// public void Apply(IntPtr hwndParent) { this.engine.Apply(hwndParent); } + /// public void CloseSplashScreen() { this.engine.CloseSplashScreen(); } + /// public int CompareVersions(string version1, string version2) { this.engine.CompareVersions(version1, version2, out var result); return result; } + /// public bool ContainsVariable(string name) { int capacity = 0; @@ -62,16 +67,19 @@ namespace WixToolset.Mba.Core return NativeMethods.E_NOTFOUND != ret; } + /// public void Detect() { this.Detect(IntPtr.Zero); } + /// public void Detect(IntPtr hwndParent) { this.engine.Detect(hwndParent); } + /// public bool Elevate(IntPtr hwndParent) { int ret = this.engine.Elevate(hwndParent); @@ -90,6 +98,7 @@ namespace WixToolset.Mba.Core } } + /// public string EscapeString(string input) { int capacity = InitialBufferSize; @@ -111,6 +120,7 @@ namespace WixToolset.Mba.Core return sb.ToString(); } + /// public bool EvaluateCondition(string condition) { bool value; @@ -119,6 +129,7 @@ namespace WixToolset.Mba.Core return value; } + /// public string FormatString(string format) { int capacity = InitialBufferSize; @@ -140,6 +151,7 @@ namespace WixToolset.Mba.Core return sb.ToString(); } + /// public long GetVariableNumeric(string name) { int ret = this.engine.GetVariableNumeric(name, out long value); @@ -151,6 +163,7 @@ namespace WixToolset.Mba.Core return value; } + /// public SecureString GetVariableSecureString(string name) { var pUniString = this.getStringVariable(name, out var length); @@ -167,6 +180,7 @@ namespace WixToolset.Mba.Core } } + /// public string GetVariableString(string name) { int length; @@ -184,6 +198,7 @@ namespace WixToolset.Mba.Core } } + /// public string GetVariableVersion(string name) { int length; @@ -201,46 +216,55 @@ namespace WixToolset.Mba.Core } } + /// public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments) { this.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, 0); } + /// public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments, int waitForInputIdleTimeout) { this.engine.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, waitForInputIdleTimeout); } + /// public void Log(LogLevel level, string message) { this.engine.Log(level, message); } + /// public void Plan(LaunchAction action) { this.engine.Plan(action); } + /// public void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, byte[] hash) { this.engine.SetUpdate(localSource, downloadSource, size, hashType, hash, null == hash ? 0 : hash.Length); } + /// public void SetLocalSource(string packageOrContainerId, string payloadId, string path) { this.engine.SetLocalSource(packageOrContainerId, payloadId, path); } + /// public void SetDownloadSource(string packageOrContainerId, string payloadId, string url, string user, string password) { this.engine.SetDownloadSource(packageOrContainerId, payloadId, url, user, password); } + /// public void SetVariableNumeric(string name, long value) { this.engine.SetVariableNumeric(name, value); } + /// public void SetVariableString(string name, SecureString value, bool formatted) { IntPtr pValue = Marshal.SecureStringToCoTaskMemUnicode(value); @@ -254,6 +278,7 @@ namespace WixToolset.Mba.Core } } + /// public void SetVariableString(string name, string value, bool formatted) { IntPtr pValue = Marshal.StringToCoTaskMemUni(value); @@ -267,6 +292,7 @@ namespace WixToolset.Mba.Core } } + /// public void SetVariableVersion(string name, string value) { IntPtr pValue = Marshal.StringToCoTaskMemUni(value); @@ -280,6 +306,7 @@ namespace WixToolset.Mba.Core } } + /// public int SendEmbeddedError(int errorCode, string message, int uiHint) { int result = 0; @@ -287,6 +314,7 @@ namespace WixToolset.Mba.Core return result; } + /// public int SendEmbeddedProgress(int progressPercentage, int overallPercentage) { int result = 0; @@ -294,6 +322,7 @@ namespace WixToolset.Mba.Core return result; } + /// public void Quit(int exitCode) { this.engine.Quit(exitCode); @@ -423,6 +452,11 @@ namespace WixToolset.Mba.Core return value; } + /// + /// Utility method for converting a into a . + /// + /// + /// public static long VersionToLong(Version version) { // In Windows, each version component has a max value of 65535, @@ -435,6 +469,11 @@ namespace WixToolset.Mba.Core return major | minor | build | revision; } + /// + /// Utility method for converting a into a . + /// + /// + /// public static Version LongToVersion(long version) { int major = (int)((version & ((long)0xffff << 48)) >> 48); @@ -446,7 +485,7 @@ namespace WixToolset.Mba.Core } /// - /// Verifies that VersionVariables can pass on the given Version to the engine. + /// Verifies that Version can be represented in a . /// If the Build or Revision fields are undefined, they are set to zero. /// public static Version NormalizeVersion(Version version) diff --git a/src/WixToolset.Mba.Core/EventArgs.cs b/src/WixToolset.Mba.Core/EventArgs.cs index b52b893a..4e59fd6f 100644 --- a/src/WixToolset.Mba.Core/EventArgs.cs +++ b/src/WixToolset.Mba.Core/EventArgs.cs @@ -163,7 +163,7 @@ namespace WixToolset.Mba.Core /// To prevent shutting down or logging off, set to /// true; otherwise, set it to false. /// By default setup will prevent shutting down or logging off between - /// and . + /// and . /// If contains /// the bootstrapper cannot prevent the shutdown and only has a few seconds to save state or perform any other /// critical operations before being closed by the operating system. @@ -1950,6 +1950,10 @@ namespace WixToolset.Mba.Core [Serializable] public class LaunchApprovedExeBeginEventArgs : CancellableHResultEventArgs { + /// + /// + /// + /// public LaunchApprovedExeBeginEventArgs(bool cancelRecommendation) : base(cancelRecommendation) { @@ -1964,6 +1968,11 @@ namespace WixToolset.Mba.Core { private int processId; + /// + /// + /// + /// + /// public LaunchApprovedExeCompleteEventArgs(int hrStatus, int processId) : base(hrStatus) { @@ -1988,6 +1997,11 @@ namespace WixToolset.Mba.Core { private string transactionId; + /// + /// + /// + /// + /// public BeginMsiTransactionBeginEventArgs(string transactionId, bool cancelRecommendation) : base(cancelRecommendation) { @@ -2011,6 +2025,11 @@ namespace WixToolset.Mba.Core { private string transactionId; + /// + /// + /// + /// + /// public BeginMsiTransactionCompleteEventArgs(string transactionId, int hrStatus) : base(hrStatus) { @@ -2034,6 +2053,11 @@ namespace WixToolset.Mba.Core { private string transactionId; + /// + /// + /// + /// + /// public CommitMsiTransactionBeginEventArgs(string transactionId, bool cancelRecommendation) : base(cancelRecommendation) { @@ -2057,6 +2081,11 @@ namespace WixToolset.Mba.Core { private string transactionId; + /// + /// + /// + /// + /// public CommitMsiTransactionCompleteEventArgs(string transactionId, int hrStatus) : base(hrStatus) { @@ -2080,6 +2109,10 @@ namespace WixToolset.Mba.Core { private string transactionId; + /// + /// + /// + /// public RollbackMsiTransactionBeginEventArgs(string transactionId) { this.transactionId = transactionId; @@ -2102,6 +2135,11 @@ namespace WixToolset.Mba.Core { private string transactionId; + /// + /// + /// + /// + /// public RollbackMsiTransactionCompleteEventArgs(string transactionId, int hrStatus) : base(hrStatus) { @@ -2123,6 +2161,9 @@ namespace WixToolset.Mba.Core [Serializable] public class PauseAutomaticUpdatesBeginEventArgs : HResultEventArgs { + /// + /// + /// public PauseAutomaticUpdatesBeginEventArgs() { } @@ -2134,6 +2175,10 @@ namespace WixToolset.Mba.Core [Serializable] public class PauseAutomaticUpdatesCompleteEventArgs : StatusEventArgs { + /// + /// + /// + /// public PauseAutomaticUpdatesCompleteEventArgs(int hrStatus) : base(hrStatus) { @@ -2146,6 +2191,9 @@ namespace WixToolset.Mba.Core [Serializable] public class SystemRestorePointBeginEventArgs : HResultEventArgs { + /// + /// + /// public SystemRestorePointBeginEventArgs() { } @@ -2157,6 +2205,10 @@ namespace WixToolset.Mba.Core [Serializable] public class SystemRestorePointCompleteEventArgs : StatusEventArgs { + /// + /// + /// + /// public SystemRestorePointCompleteEventArgs(int hrStatus) : base(hrStatus) { diff --git a/src/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/WixToolset.Mba.Core/IBootstrapperApplication.cs index f1a631a3..3c62370a 100644 --- a/src/WixToolset.Mba.Core/IBootstrapperApplication.cs +++ b/src/WixToolset.Mba.Core/IBootstrapperApplication.cs @@ -14,14 +14,26 @@ namespace WixToolset.Mba.Core [Guid("53C31D56-49C0-426B-AB06-099D717C67FE")] public interface IBootstrapperApplication { + /// + /// See . + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnStartup(); + /// + /// See . + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnShutdown(ref BOOTSTRAPPER_SHUTDOWN_ACTION action); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnSystemShutdown( @@ -29,6 +41,13 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectBegin( @@ -37,6 +56,17 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectForwardCompatibleBundle( @@ -49,6 +79,13 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fIgnoreBundle ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectUpdateBegin( @@ -57,6 +94,19 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fSkip ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectUpdate( @@ -71,6 +121,12 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fStopProcessingUpdates ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectUpdateComplete( @@ -78,6 +134,17 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fIgnoreError ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectRelatedBundle( @@ -90,6 +157,12 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectPackageBegin( @@ -97,6 +170,14 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectCompatibleMsiPackage( @@ -106,6 +187,17 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectRelatedMsiPackage( @@ -118,6 +210,14 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectTargetMsiPackage( @@ -127,6 +227,14 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectMsiFeature( @@ -136,6 +244,13 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectPackageComplete( @@ -144,12 +259,23 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] PackageState state ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnDetectComplete( int hrStatus ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanBegin( @@ -157,6 +283,14 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanRelatedBundle( @@ -166,6 +300,14 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanPackageBegin( @@ -175,6 +317,16 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanCompatibleMsiPackageBegin( @@ -186,6 +338,17 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanCompatibleMsiPackageComplete( @@ -198,6 +361,15 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] ActionState rollback ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanTargetMsiPackage( @@ -208,6 +380,15 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanMsiFeature( @@ -218,6 +399,17 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanMsiPackage( @@ -230,6 +422,16 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fDisableExternalUiHandler ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanPackageComplete( @@ -241,12 +443,23 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] ActionState rollback ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPlanComplete( int hrStatus ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnApplyBegin( @@ -254,18 +467,35 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnElevateBegin( [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnElevateComplete( int hrStatus ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnProgress( @@ -274,6 +504,19 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnError( @@ -288,24 +531,47 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.I4)] ref Result pResult ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnRegisterBegin( [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnRegisterComplete( int hrStatus ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCacheBegin( [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCachePackageBegin( @@ -315,6 +581,15 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCacheAcquireBegin( @@ -325,6 +600,16 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCacheAcquireProgress( @@ -336,6 +621,17 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnResolveSource( @@ -348,6 +644,15 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCacheAcquireComplete( @@ -358,6 +663,13 @@ namespace WixToolset.Mba.Core ref BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION pAction ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCacheVerifyBegin( @@ -366,6 +678,15 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCacheVerifyComplete( @@ -376,6 +697,14 @@ namespace WixToolset.Mba.Core ref BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCachePackageComplete( @@ -385,12 +714,23 @@ namespace WixToolset.Mba.Core ref BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCacheComplete( int hrStatus ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnExecuteBegin( @@ -398,6 +738,16 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnExecutePackageBegin( @@ -409,6 +759,13 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnExecutePatchTarget( @@ -417,6 +774,14 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnExecuteProgress( @@ -426,6 +791,18 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnExecuteMsiMessage( @@ -439,6 +816,15 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.I4)] ref Result pResult ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnExecuteFilesInUse( @@ -449,6 +835,15 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.I4)] ref Result pResult ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnExecutePackageComplete( @@ -459,24 +854,47 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION pAction ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnExecuteComplete( int hrStatus ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnUnregisterBegin( [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnUnregisterComplete( int hrStatus ); + /// + /// See . + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnApplyComplete( @@ -486,12 +904,23 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_APPLYCOMPLETE_ACTION pAction ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnLaunchApprovedExeBegin( [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnLaunchApprovedExeComplete( @@ -499,6 +928,12 @@ namespace WixToolset.Mba.Core int processId ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnBeginMsiTransactionBegin( @@ -506,6 +941,12 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnBeginMsiTransactionComplete( @@ -513,6 +954,12 @@ namespace WixToolset.Mba.Core int hrStatus ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCommitMsiTransactionBegin( @@ -520,6 +967,12 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.Bool)] ref bool fCancel ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnCommitMsiTransactionComplete( @@ -527,12 +980,23 @@ namespace WixToolset.Mba.Core int hrStatus ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnRollbackMsiTransactionBegin( [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnRollbackMsiTransactionComplete( @@ -540,28 +1004,54 @@ namespace WixToolset.Mba.Core int hrStatus ); + /// + /// See . + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPauseAutomaticUpdatesBegin( ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnPauseAutomaticUpdatesComplete( int hrStatus ); + /// + /// See . + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnSystemRestorePointBegin( ); + /// + /// See . + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnSystemRestorePointComplete( int hrStatus ); + /// + /// Low level method that is called directly from the engine. + /// + /// + /// + /// + /// + /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int BAProc( @@ -571,6 +1061,14 @@ namespace WixToolset.Mba.Core IntPtr pvContext ); + /// + /// Low level method that is called directly from the engine. + /// + /// + /// + /// + /// + /// void BAProcFallback( int message, IntPtr pvArgs, @@ -585,34 +1083,131 @@ namespace WixToolset.Mba.Core /// public enum Display { + /// + /// + /// Unknown, + + /// + /// + /// Embedded, + + /// + /// + /// None, + + /// + /// + /// Passive, + + /// + /// + /// Full, } /// - /// Messages from Windows Installer. + /// Messages from Windows Installer (msi.h). /// public enum InstallMessage { + /// + /// premature termination, possibly fatal OOM + /// FatalExit, + + /// + /// formatted error message + /// Error = 0x01000000, + + /// + /// formatted warning message + /// Warning = 0x02000000, + + /// + /// user request message + /// User = 0x03000000, + + /// + /// informative message for log + /// Info = 0x04000000, + + /// + /// list of files in use that need to be replaced + /// FilesInUse = 0x05000000, + + /// + /// request to determine a valid source location + /// ResolveSource = 0x06000000, + + /// + /// insufficient disk space message + /// OutOfDiskSpace = 0x07000000, + + /// + /// start of action: action name & description + /// ActionStart = 0x08000000, + + /// + /// formatted data associated with individual action item + /// ActionData = 0x09000000, + + /// + /// progress gauge info: units so far, total + /// Progress = 0x0a000000, + + /// + /// product info for dialog: language Id, dialog caption + /// CommonData = 0x0b000000, + + /// + /// sent prior to UI initialization, no string data + /// Initialize = 0x0c000000, + + /// + /// sent after UI termination, no string data + /// Terminate = 0x0d000000, + + /// + /// sent prior to display or authored dialog or wizard + /// ShowDialog = 0x0e000000, + + /// + /// log only, to log performance number like action time + /// + Performance = 0x0f000000, + + /// + /// the list of apps that the user can request Restart Manager to shut down and restart + /// RMFilesInUse = 0x19000000, + + /// + /// sent prior to server-side install of a product + /// + InstallStart = 0x1a000000, + + /// + /// sent after server-side install + /// + InstallEnd = 0x1B000000, } /// @@ -620,30 +1215,100 @@ namespace WixToolset.Mba.Core /// public enum Restart { + /// + /// + /// Unknown, + + /// + /// + /// Never, + + /// + /// + /// Prompt, + + /// + /// + /// Automatic, + + /// + /// + /// Always, } /// - /// Result codes. + /// Result codes (based on Dialog Box Command IDs from WinUser.h). /// public enum Result { + /// + /// + /// Error = -1, + + /// + /// + /// None, + + /// + /// + /// Ok, + + /// + /// + /// Cancel, + + /// + /// + /// Abort, + + /// + /// + /// Retry, + + /// + /// + /// Ignore, + + /// + /// + /// Yes, + + /// + /// + /// No, + + /// + /// / + /// Close, + + /// + /// + /// Help, + + /// + /// + /// TryAgain, + + /// + /// + /// Continue, } @@ -652,6 +1317,9 @@ namespace WixToolset.Mba.Core /// public enum ResumeType { + /// + /// + /// None, /// @@ -721,8 +1389,14 @@ namespace WixToolset.Mba.Core Apply, }; + /// + /// The calculated operation for the related bundle. + /// public enum RelatedOperation { + /// + /// + /// None, /// @@ -803,12 +1477,39 @@ namespace WixToolset.Mba.Core /// public enum RelationType { + /// + /// + /// None, + + /// + /// + /// Detect, + + /// + /// + /// Upgrade, + + /// + /// + /// Addon, + + /// + /// + /// Patch, + + /// + /// + /// Dependent, + + /// + /// + /// Update, } @@ -840,72 +1541,161 @@ namespace WixToolset.Mba.Core } /// - /// The available actions for OnApplyComplete. + /// The available actions for . /// public enum BOOTSTRAPPER_APPLYCOMPLETE_ACTION { + /// + /// + /// None, + + /// + /// Instructs the engine to restart. + /// The engine will not launch again after the machine is rebooted. + /// Ignored if reboot was already initiated by . + /// Restart, } /// - /// The available actions for OnCacheAcquireComplete. + /// The available actions for . /// public enum BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION { + /// + /// + /// None, + + /// + /// Instructs the engine to try the acquisition of the package again. + /// Ignored if hrStatus is a success. + /// Retry, } /// - /// The available actions for OnCachePackageComplete. + /// The available actions for . /// public enum BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION { + /// + /// + /// None, + + /// + /// Instructs the engine to ignore non-vital package failures and continue with the caching. + /// Ignored if hrStatus is a success or the package is vital. + /// Ignore, + + /// + /// Instructs the engine to try the acquisition and verification of the package again. + /// Ignored if hrStatus is a success. + /// Retry, } /// - /// The available actions for OnCacheVerifyComplete. + /// The available actions for . /// public enum BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION { + /// + /// + /// None, + + /// + /// Ignored if hrStatus is a success. + /// RetryVerification, + + /// + /// Ignored if hrStatus is a success. + /// RetryAcquisition, } /// - /// The available actions for OnExecutePackageComplete. + /// The available actions for . /// public enum BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION { + /// + /// + /// None, + + /// + /// Instructs the engine to ignore non-vital package failures and continue with the install. + /// Ignored if hrStatus is a success or the package is vital. + /// Ignore, + + /// + /// Instructs the engine to try the execution of the package again. + /// Ignored if hrStatus is a success. + /// Retry, + + /// + /// Instructs the engine to stop processing the chain and restart. + /// The engine will launch again after the machine is restarted. + /// Restart, + + /// + /// Instructs the engine to stop processing the chain and suspend the current state. + /// Suspend, } /// - /// The available actions for OnResolveSource. + /// The available actions for . /// public enum BOOTSTRAPPER_RESOLVESOURCE_ACTION { + /// + /// Instructs the engine that the source can't be found. + /// None, + + /// + /// Instructs the engine to try the local source again. + /// Retry, + + /// + /// Instructs the engine to try the download source. + /// Download, } /// - /// The available actions for OnShutdown. + /// The available actions for . /// public enum BOOTSTRAPPER_SHUTDOWN_ACTION { + /// + /// + /// None, + + /// + /// Instructs the engine to restart. + /// The engine will not launch again after the machine is rebooted. + /// Ignored if reboot was already initiated by . + /// Restart, + + /// + /// Instructs the engine to unload the bootstrapper application and + /// restart the engine which will load the bootstrapper application again. + /// Typically used to switch from a native bootstrapper application to a managed one. + /// ReloadBootstrapper, } diff --git a/src/WixToolset.Mba.Core/IBootstrapperApplicationData.cs b/src/WixToolset.Mba.Core/IBootstrapperApplicationData.cs index a19a34b5..23a1c8a3 100644 --- a/src/WixToolset.Mba.Core/IBootstrapperApplicationData.cs +++ b/src/WixToolset.Mba.Core/IBootstrapperApplicationData.cs @@ -4,9 +4,19 @@ namespace WixToolset.Mba.Core { using System.IO; + /// + /// Interface for BootstrapperApplicationData.xml. + /// public interface IBootstrapperApplicationData { + /// + /// The BootstrapperApplicationData.xml file. + /// FileInfo BADataFile { get; } + + /// + /// The BA manifest. + /// IBundleInfo Bundle { get; } } } \ No newline at end of file diff --git a/src/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs b/src/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs index b9c62a99..0f9193d0 100644 --- a/src/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs +++ b/src/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs @@ -6,12 +6,20 @@ namespace WixToolset.Mba.Core using System.CodeDom.Compiler; using System.Runtime.InteropServices; + /// + /// Interface used by WixToolset.Mba.Host to dynamically load the BA. + /// [ComVisible(true)] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [Guid("2965A12F-AC7B-43A0-85DF-E4B2168478A4")] [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")] public interface IBootstrapperApplicationFactory { + /// + /// Low level method called by the native host. + /// + /// + /// void Create( IntPtr pArgs, IntPtr pResults @@ -21,7 +29,7 @@ namespace WixToolset.Mba.Core [Serializable] [StructLayout(LayoutKind.Sequential)] [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")] - public struct Command + internal struct Command { // Strings must be declared as pointers so that Marshaling doesn't free them. [MarshalAs(UnmanagedType.I4)] internal int cbSize; @@ -55,25 +63,4 @@ namespace WixToolset.Mba.Core Marshal.PtrToStringUni(this.wzBootstrapperApplicationDataPath)); } } - - [Serializable] - [StructLayout(LayoutKind.Sequential)] - [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")] - public struct BootstrapperCreateArgs - { - [MarshalAs(UnmanagedType.I4)] public readonly int cbSize; - [MarshalAs(UnmanagedType.I8)] public readonly long qwEngineAPIVersion; - public readonly IntPtr pfnBootstrapperEngineProc; - public readonly IntPtr pvBootstrapperEngineProcContext; - public readonly IntPtr pCommand; - - public BootstrapperCreateArgs(long version, IntPtr pEngineProc, IntPtr pEngineContext, IntPtr pCommand) - { - this.cbSize = Marshal.SizeOf(typeof(BootstrapperCreateArgs)); - this.qwEngineAPIVersion = version; - this.pfnBootstrapperEngineProc = pEngineProc; - this.pvBootstrapperEngineProcContext = pEngineContext; - this.pCommand = pCommand; - } - } } diff --git a/src/WixToolset.Mba.Core/IBootstrapperCommand.cs b/src/WixToolset.Mba.Core/IBootstrapperCommand.cs index 889db529..e861813f 100644 --- a/src/WixToolset.Mba.Core/IBootstrapperCommand.cs +++ b/src/WixToolset.Mba.Core/IBootstrapperCommand.cs @@ -33,6 +33,9 @@ namespace WixToolset.Mba.Core /// The command line could not be parsed into an array. string[] CommandLineArgs { get; } + /// + /// Hint for the initial visibility of the window. + /// int CmdShow { get; } /// diff --git a/src/WixToolset.Mba.Core/IBootstrapperEngine.cs b/src/WixToolset.Mba.Core/IBootstrapperEngine.cs index 5cc42071..ddf223df 100644 --- a/src/WixToolset.Mba.Core/IBootstrapperEngine.cs +++ b/src/WixToolset.Mba.Core/IBootstrapperEngine.cs @@ -16,16 +16,33 @@ namespace WixToolset.Mba.Core [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")] public interface IBootstrapperEngine { + /// + /// See . + /// + /// void GetPackageCount( [MarshalAs(UnmanagedType.U4)] out int pcPackages ); + /// + /// See . + /// + /// + /// + /// [PreserveSig] int GetVariableNumeric( [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, out long pllValue ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] int GetVariableString( [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, @@ -33,6 +50,13 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] ref int pcchValue ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] int GetVariableVersion( [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, @@ -40,6 +64,13 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] ref int pcchValue ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] int FormatString( [MarshalAs(UnmanagedType.LPWStr)] string wzIn, @@ -47,6 +78,13 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] ref int pcchOut ); + /// + /// See . + /// + /// + /// + /// + /// [PreserveSig] int EscapeString( [MarshalAs(UnmanagedType.LPWStr)] string wzIn, @@ -54,16 +92,33 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] ref int pcchOut ); + /// + /// See . + /// + /// + /// void EvaluateCondition( [MarshalAs(UnmanagedType.LPWStr)] string wzCondition, [MarshalAs(UnmanagedType.Bool)] out bool pf ); + /// + /// See . + /// + /// + /// void Log( [MarshalAs(UnmanagedType.U4)] LogLevel level, [MarshalAs(UnmanagedType.LPWStr)] string wzMessage ); + /// + /// See . + /// + /// + /// + /// + /// void SendEmbeddedError( [MarshalAs(UnmanagedType.U4)] int dwErrorCode, [MarshalAs(UnmanagedType.LPWStr)] string wzMessage, @@ -71,12 +126,27 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.I4)] out int pnResult ); + /// + /// See . + /// + /// + /// + /// void SendEmbeddedProgress( [MarshalAs(UnmanagedType.U4)] int dwProgressPercentage, [MarshalAs(UnmanagedType.U4)] int dwOverallProgressPercentage, [MarshalAs(UnmanagedType.I4)] out int pnResult ); + /// + /// See . + /// + /// + /// + /// + /// + /// + /// void SetUpdate( [MarshalAs(UnmanagedType.LPWStr)] string wzLocalSource, [MarshalAs(UnmanagedType.LPWStr)] string wzDownloadSource, @@ -86,12 +156,26 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] int cbHash ); + /// + /// See . + /// + /// + /// + /// void SetLocalSource( [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId, [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId, [MarshalAs(UnmanagedType.LPWStr)] string wzPath ); + /// + /// See . + /// + /// + /// + /// + /// + /// void SetDownloadSource( [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId, [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId, @@ -100,45 +184,92 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.LPWStr)] string wzPassword ); + /// + /// See . + /// + /// + /// void SetVariableNumeric( [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, long llValue ); + /// + /// See . + /// + /// + /// + /// void SetVariableString( [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, IntPtr wzValue, [MarshalAs(UnmanagedType.Bool)] bool fFormatted ); + /// + /// See . + /// + /// + /// void SetVariableVersion( [MarshalAs(UnmanagedType.LPWStr)] string wzVariable, IntPtr wzValue ); + /// + /// See . + /// void CloseSplashScreen(); + /// + /// See . + /// + /// void Detect( IntPtr hwndParent ); + /// + /// See . + /// + /// void Plan( [MarshalAs(UnmanagedType.U4)] LaunchAction action ); + /// + /// See . + /// + /// + /// [PreserveSig] int Elevate( IntPtr hwndParent ); + /// + /// See . + /// + /// void Apply( IntPtr hwndParent ); + /// + /// See . + /// + /// void Quit( [MarshalAs(UnmanagedType.U4)] int dwExitCode ); + /// + /// See . + /// + /// + /// + /// + /// void LaunchApprovedExe( IntPtr hwndParent, [MarshalAs(UnmanagedType.LPWStr)] string wzApprovedExeForElevationId, @@ -146,6 +277,12 @@ namespace WixToolset.Mba.Core [MarshalAs(UnmanagedType.U4)] int dwWaitForInputIdleTimeout ); + /// + /// See . + /// + /// + /// + /// void CompareVersions( [MarshalAs(UnmanagedType.LPWStr)] string wzVersion1, [MarshalAs(UnmanagedType.LPWStr)] string wzVersion2, @@ -158,14 +295,49 @@ namespace WixToolset.Mba.Core /// public enum ActionState { + /// + /// + /// None, + + /// + /// + /// Uninstall, + + /// + /// + /// Install, + + /// + /// + /// AdminInstall, + + /// + /// + /// Modify, + + /// + /// + /// Repair, + + /// + /// + /// MinorUpgrade, + + /// + /// + /// MajorUpgrade, + + /// + /// + /// Patch, } @@ -174,15 +346,54 @@ namespace WixToolset.Mba.Core /// public enum LaunchAction { + /// + /// + /// Unknown, + + /// + /// + /// Help, + + /// + /// + /// Layout, + + /// + /// + /// Uninstall, + + /// + /// + /// Cache, + + /// + /// + /// Install, + + /// + /// + /// Modify, + + /// + /// + /// Repair, + + /// + /// + /// UpdateReplace, + + /// + /// + /// UpdateReplaceEmbedded, } @@ -238,11 +449,34 @@ namespace WixToolset.Mba.Core /// public enum PackageState { + /// + /// + /// Unknown, + + /// + /// + /// Obsolete, + + /// + /// + /// Absent, + + /// + /// + /// Cached, + + /// + /// + /// Present, + + /// + /// + /// Superseded, } @@ -251,11 +485,34 @@ namespace WixToolset.Mba.Core /// public enum RequestState { + /// + /// + /// None, + + /// + /// / + /// ForceAbsent, + + /// + /// + /// Absent, + + /// + /// + /// Cache, + + /// + /// + /// Present, + + /// + /// + /// Repair, } @@ -264,10 +521,29 @@ namespace WixToolset.Mba.Core /// public enum FeatureState { + /// + /// + /// Unknown, + + /// + /// + /// Absent, + + /// + /// + /// Advertised, + + /// + /// + /// Local, + + /// + /// + /// Source, } @@ -276,12 +552,39 @@ namespace WixToolset.Mba.Core /// public enum FeatureAction { + /// + /// + /// None, + + /// + /// + /// AddLocal, + + /// + /// + /// AddSource, + + /// + /// + /// AddDefault, + + /// + /// + /// Reinstall, + + /// + /// + /// Advertise, + + /// + /// + /// Remove, } } diff --git a/src/WixToolset.Mba.Core/IBundleInfo.cs b/src/WixToolset.Mba.Core/IBundleInfo.cs index d471c677..f4a82f36 100644 --- a/src/WixToolset.Mba.Core/IBundleInfo.cs +++ b/src/WixToolset.Mba.Core/IBundleInfo.cs @@ -4,13 +4,36 @@ namespace WixToolset.Mba.Core { using System.Collections.Generic; + /// + /// BA manifest data. + /// public interface IBundleInfo { + /// + /// + /// string LogVariable { get; } + + /// + /// + /// string Name { get; } + + /// + /// + /// IDictionary Packages { get; } + + /// + /// + /// bool PerMachine { get; } + /// + /// Adds a related bundle as a package. + /// + /// + /// The created . IPackageInfo AddRelatedBundleAsPackage(DetectRelatedBundleEventArgs e); } } \ No newline at end of file diff --git a/src/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs b/src/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs index 4a30da7e..b7e4759c 100644 --- a/src/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs +++ b/src/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs @@ -4,73 +4,351 @@ namespace WixToolset.Mba.Core { using System; + /// + /// Interface for built-in implementation of . + /// public interface IDefaultBootstrapperApplication : IBootstrapperApplication { + /// + /// Fired when the engine has begun installing the bundle. + /// event EventHandler ApplyBegin; + + /// + /// Fired when the engine has completed installing the bundle. + /// event EventHandler ApplyComplete; + + /// + /// Fired when the engine is about to begin an MSI transaction. + /// event EventHandler BeginMsiTransactionBegin; + + /// + /// Fired when the engine has completed beginning an MSI transaction. + /// event EventHandler BeginMsiTransactionComplete; + + /// + /// Fired when the engine has begun acquiring the installation sources. + /// event EventHandler CacheAcquireBegin; + + /// + /// Fired when the engine has completed the acquisition of the installation sources. + /// event EventHandler CacheAcquireComplete; + + /// + /// Fired when the engine has progress acquiring the installation sources. + /// event EventHandler CacheAcquireProgress; + + /// + /// Fired when the engine has begun caching the installation sources. + /// event EventHandler CacheBegin; + + /// + /// Fired after the engine has cached the installation sources. + /// event EventHandler CacheComplete; + + /// + /// Fired when the engine has begun caching a specific package. + /// event EventHandler CachePackageBegin; + + /// + /// Fired when the engine has completed caching a specific package. + /// event EventHandler CachePackageComplete; + + /// + /// Fired when the engine begins the verification of the acquired installation sources. + /// event EventHandler CacheVerifyBegin; + + /// + /// Fired when the engine complete the verification of the acquired installation sources. + /// event EventHandler CacheVerifyComplete; + + /// + /// Fired when the engine is about to commit an MSI transaction. + /// event EventHandler CommitMsiTransactionBegin; + + /// + /// Fired when the engine has completed comitting an MSI transaction. + /// event EventHandler CommitMsiTransactionComplete; + + /// + /// Fired when the overall detection phase has begun. + /// event EventHandler DetectBegin; + + /// + /// Fired when a package was not detected but a package using the same provider key was. + /// event EventHandler DetectCompatibleMsiPackage; + + /// + /// Fired when the detection phase has completed. + /// event EventHandler DetectComplete; + + /// + /// Fired when a forward compatible bundle is detected. + /// event EventHandler DetectForwardCompatibleBundle; + + /// + /// Fired when a feature in an MSI package has been detected. + /// event EventHandler DetectMsiFeature; + + /// + /// Fired when the detection for a specific package has begun. + /// event EventHandler DetectPackageBegin; + + /// + /// Fired when the detection for a specific package has completed. + /// event EventHandler DetectPackageComplete; + + /// + /// Fired when a related bundle has been detected for a bundle. + /// event EventHandler DetectRelatedBundle; + + /// + /// Fired when a related MSI package has been detected for a package. + /// event EventHandler DetectRelatedMsiPackage; + + /// + /// Fired when an MSP package detects a target MSI has been detected. + /// event EventHandler DetectTargetMsiPackage; + + /// + /// Fired when the update detection has found a potential update candidate. + /// event EventHandler DetectUpdate; + + /// + /// Fired when the update detection phase has begun. + /// event EventHandler DetectUpdateBegin; + + /// + /// Fired when the update detection phase has completed. + /// event EventHandler DetectUpdateComplete; + + /// + /// Fired when the engine is about to start the elevated process. + /// event EventHandler ElevateBegin; + + /// + /// Fired when the engine has completed starting the elevated process. + /// event EventHandler ElevateComplete; + + /// + /// Fired when the engine has encountered an error. + /// event EventHandler Error; + + /// + /// Fired when the engine has begun installing packages. + /// event EventHandler ExecuteBegin; + + /// + /// Fired when the engine has completed installing packages. + /// event EventHandler ExecuteComplete; + + /// + /// Fired when Windows Installer sends a files in use installation message. + /// event EventHandler ExecuteFilesInUse; + + /// + /// Fired when Windows Installer sends an installation message. + /// event EventHandler ExecuteMsiMessage; + + /// + /// Fired when the engine has begun installing a specific package. + /// event EventHandler ExecutePackageBegin; + + /// + /// Fired when the engine has completed installing a specific package. + /// event EventHandler ExecutePackageComplete; + + /// + /// Fired when the engine executes one or more patches targeting a product. + /// event EventHandler ExecutePatchTarget; + + /// + /// Fired by the engine while executing on payload. + /// event EventHandler ExecuteProgress; + + /// + /// Fired when the engine is about to launch the preapproved executable. + /// event EventHandler LaunchApprovedExeBegin; + + /// + /// Fired when the engine has completed launching the preapproved executable. + /// event EventHandler LaunchApprovedExeComplete; + + /// + /// Fired when the engine is about to pause Windows automatic updates. + /// event EventHandler PauseAutomaticUpdatesBegin; + + /// + /// Fired when the engine has completed pausing Windows automatic updates. + /// event EventHandler PauseAutomaticUpdatesComplete; + + /// + /// Fired when the engine has begun planning the installation. + /// event EventHandler PlanBegin; + + /// + /// Fired when the engine plans a new, compatible package using the same provider key. + /// event EventHandler PlanCompatibleMsiPackageBegin; + + /// + /// Fired when the engine has completed planning the installation of a specific package. + /// event EventHandler PlanCompatibleMsiPackageComplete; + + /// + /// Fired when the engine has completed planning the installation. + /// event EventHandler PlanComplete; + + /// + /// Fired when the engine is about to plan a feature in an MSI package. + /// event EventHandler PlanMsiFeature; + + /// + /// Fired when the engine is planning an MSI or MSP package. + /// event EventHandler PlanMsiPackage; + + /// + /// Fired when the engine has begun planning the installation of a specific package. + /// event EventHandler PlanPackageBegin; + + /// + /// Fired when the engine has completed planning the installation of a specific package. + /// event EventHandler PlanPackageComplete; + + /// + /// Fired when the engine has begun planning for a related bundle. + /// event EventHandler PlanRelatedBundle; + + /// + /// Fired when the engine is about to plan the target MSI of a MSP package. + /// event EventHandler PlanTargetMsiPackage; + + /// + /// Fired when the engine has changed progress for the bundle installation. + /// event EventHandler Progress; + + /// + /// Fired when the engine has begun registering the location and visibility of the bundle. + /// event EventHandler RegisterBegin; + + /// + /// Fired when the engine has completed registering the location and visibility of the bundle. + /// event EventHandler RegisterComplete; + + /// + /// Fired by the engine to allow the BA to change the source + /// using or . + /// event EventHandler ResolveSource; + + /// + /// Fired when the engine is about to rollback an MSI transaction. + /// event EventHandler RollbackMsiTransactionBegin; + + /// + /// Fired when the engine has completed rolling back an MSI transaction. + /// event EventHandler RollbackMsiTransactionComplete; + + /// + /// Fired when the engine is shutting down the bootstrapper application. + /// event EventHandler Shutdown; + + /// + /// Fired when the engine is starting up the bootstrapper application. + /// event EventHandler Startup; + + /// + /// Fired when the engine is about to take a system restore point. + /// event EventHandler SystemRestorePointBegin; + + /// + /// Fired when the engine has completed taking a system restore point. + /// event EventHandler SystemRestorePointComplete; + + /// + /// Fired when the system is shutting down or user is logging off. + /// + /// + /// To prevent shutting down or logging off, set to + /// true; otherwise, set it to false. + /// By default setup will prevent shutting down or logging off between + /// and . + /// Derivatives can change this behavior by handling . + /// If contains + /// the bootstrapper cannot prevent the shutdown and only has a few seconds to save state or perform any other + /// critical operations before being closed by the operating system. + /// This event may be fired on a different thread. + /// event EventHandler SystemShutdown; + + /// + /// Fired when the engine has begun removing the registration for the location and visibility of the bundle. + /// event EventHandler UnregisterBegin; + + /// + /// Fired when the engine has completed removing the registration for the location and visibility of the bundle. + /// event EventHandler UnregisterComplete; } } \ No newline at end of file diff --git a/src/WixToolset.Mba.Core/IEngine.cs b/src/WixToolset.Mba.Core/IEngine.cs index 8403352d..0899ec43 100644 --- a/src/WixToolset.Mba.Core/IEngine.cs +++ b/src/WixToolset.Mba.Core/IEngine.cs @@ -6,6 +6,9 @@ namespace WixToolset.Mba.Core using System.ComponentModel; using System.Security; + /// + /// High level abstraction over the interface. + /// public interface IEngine { /// diff --git a/src/WixToolset.Mba.Core/IPackageInfo.cs b/src/WixToolset.Mba.Core/IPackageInfo.cs index a82e81ea..0d7e549e 100644 --- a/src/WixToolset.Mba.Core/IPackageInfo.cs +++ b/src/WixToolset.Mba.Core/IPackageInfo.cs @@ -2,23 +2,89 @@ namespace WixToolset.Mba.Core { + /// + /// Package information from the BA manifest. + /// public interface IPackageInfo { + /// + /// + /// CacheType CacheType { get; } + + /// + /// Place for the BA to store it's own custom data for this package. + /// object CustomData { get; set; } + + /// + /// + /// string Description { get; } + + /// + /// + /// string DisplayInternalUICondition { get; } + + /// + /// + /// string DisplayName { get; } + + /// + /// + /// string Id { get; } + + /// + /// + /// string InstallCondition { get; } + + /// + /// + /// bool Permanent { get; } + + /// + /// + /// bool PrereqPackage { get; } + + /// + /// + /// string PrereqLicenseFile { get; } + + /// + /// + /// string PrereqLicenseUrl { get; } + + /// + /// + /// string ProductCode { get; } + + /// + /// + /// PackageType Type { get; } + + /// + /// + /// string UpgradeCode { get; } + + /// + /// + /// string Version { get; } + + /// + /// + /// bool Vital { get; } } } \ No newline at end of file diff --git a/src/WixToolset.Mba.Core/PackageInfo.cs b/src/WixToolset.Mba.Core/PackageInfo.cs index d54438f5..75a0fd53 100644 --- a/src/WixToolset.Mba.Core/PackageInfo.cs +++ b/src/WixToolset.Mba.Core/PackageInfo.cs @@ -7,46 +7,133 @@ namespace WixToolset.Mba.Core using System.Xml; using System.Xml.XPath; + /// + /// + /// public enum CacheType { + /// + /// + /// No, + + /// + /// + /// Yes, + + /// + /// + /// Always, } + /// + /// + /// public enum PackageType { + /// + /// + /// Unknown, + + /// + /// + /// Exe, + + /// + /// + /// Msi, + + /// + /// + /// Msp, + + /// + /// + /// Msu, + + /// + /// + /// UpgradeBundle, + + /// + /// + /// AddonBundle, + + /// + /// + /// PatchBundle, } + /// + /// Default implementation of . + /// public class PackageInfo : IPackageInfo { + /// public string Id { get; internal set; } + + /// public string DisplayName { get; internal set; } + + /// public string Description { get; internal set; } + + /// public PackageType Type { get; internal set; } + + /// public bool Permanent { get; internal set; } + + /// public bool Vital { get; internal set; } + + /// public string DisplayInternalUICondition { get; internal set; } + + /// public string ProductCode { get; internal set; } + + /// public string UpgradeCode { get; internal set; } + + /// public string Version { get; internal set; } + + /// public string InstallCondition { get; internal set; } + + /// public CacheType CacheType { get; internal set; } + + /// public bool PrereqPackage { get; internal set; } + + /// public string PrereqLicenseFile { get; internal set; } + + /// public string PrereqLicenseUrl { get; internal set; } + + /// public object CustomData { get; set; } internal PackageInfo() { } + /// + /// + /// + /// + /// public static IDictionary ParsePackagesFromXml(XPathNavigator root) { var packagesById = new Dictionary(); @@ -105,6 +192,12 @@ namespace WixToolset.Mba.Core return packagesById; } + /// + /// + /// + /// + /// + /// public static CacheType? GetCacheTypeAttribute(XPathNavigator node, string attributeName) { string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName); @@ -128,6 +221,12 @@ namespace WixToolset.Mba.Core } } + /// + /// + /// + /// + /// + /// public static PackageType? GetPackageTypeAttribute(XPathNavigator node, string attributeName) { string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName); @@ -159,6 +258,14 @@ namespace WixToolset.Mba.Core } } + /// + /// + /// + /// + /// + /// + /// + /// public static IPackageInfo GetRelatedBundleAsPackage(string id, RelationType relationType, bool perMachine, string version) { PackageInfo package = new PackageInfo(); diff --git a/src/WixToolset.Mba.Core/VerUtil.cs b/src/WixToolset.Mba.Core/VerUtil.cs index dcc9dee2..81c5b716 100644 --- a/src/WixToolset.Mba.Core/VerUtil.cs +++ b/src/WixToolset.Mba.Core/VerUtil.cs @@ -6,6 +6,9 @@ namespace WixToolset.Mba.Core using System.Runtime.InteropServices; using System.Text; + /// + /// Managed wrapper for verutil. + /// public static class VerUtil { [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)] @@ -105,18 +108,34 @@ namespace WixToolset.Mba.Core return VerCompareStringVersions(version1, version2, strict); } + /// + /// + /// + /// + /// public static VerUtilVersion CopyVersion(VerUtilVersion version) { var handle = VerCopyVersion(version.GetHandle()); return new VerUtilVersion(handle); } + /// + /// + /// + /// + /// Whether to throw exception on invalid version. + /// public static VerUtilVersion ParseVersion(string version, bool strict) { var handle = VerParseVersion(version, 0, strict); return new VerUtilVersion(handle); } + /// + /// + /// + /// + /// public static VerUtilVersion VersionFromQword(long version) { var handle = VerVersionFromQword(version); diff --git a/src/WixToolset.Mba.Core/VerUtilVersion.cs b/src/WixToolset.Mba.Core/VerUtilVersion.cs index 2b509a21..7408c26f 100644 --- a/src/WixToolset.Mba.Core/VerUtilVersion.cs +++ b/src/WixToolset.Mba.Core/VerUtilVersion.cs @@ -5,6 +5,9 @@ namespace WixToolset.Mba.Core using System; using System.Runtime.InteropServices; + /// + /// An enhanced implementation of SemVer 2.0. + /// public sealed class VerUtilVersion : IDisposable { internal VerUtilVersion(VerUtil.VersionHandle handle) @@ -30,15 +33,48 @@ namespace WixToolset.Mba.Core } } + /// + /// String version, which would have stripped the leading 'v'. + /// public string Version { get; private set; } + + /// + /// For version A.B.C.D, Major is A. It is 0 if not specified. + /// public uint Major { get; private set; } + + /// + /// For version A.B.C.D, Minor is B. It is 0 if not specified. + /// public uint Minor { get; private set; } + + /// + /// For version A.B.C.D, Patch is C. It is 0 if not specified. + /// public uint Patch { get; private set; } + + /// + /// For version A.B.C.D, Revision is D. It is 0 if not specified. + /// public uint Revision { get; private set; } + + /// + /// For version X.Y.Z-releaselabels+metadata, ReleaseLabels is the parsed information for releaselabels. + /// public VerUtilVersionReleaseLabel[] ReleaseLabels { get; private set; } + + /// + /// For version X.Y.Z-releaselabels+metadata, Metadata is the rest of the string after +. + /// For invalid versions, it is all of the string after the point where it was an invalid string. + /// public string Metadata { get; private set; } + + /// + /// Whether the version conformed to the spec. + /// public bool IsInvalid { get; private set; } + /// public void Dispose() { if (this.Handle != null) diff --git a/src/WixToolset.Mba.Core/VerUtilVersionReleaseLabel.cs b/src/WixToolset.Mba.Core/VerUtilVersionReleaseLabel.cs index 84ff3b36..97e8190d 100644 --- a/src/WixToolset.Mba.Core/VerUtilVersionReleaseLabel.cs +++ b/src/WixToolset.Mba.Core/VerUtilVersionReleaseLabel.cs @@ -5,6 +5,9 @@ namespace WixToolset.Mba.Core using System; using System.Runtime.InteropServices; + /// + /// A release label from a . + /// public sealed class VerUtilVersionReleaseLabel { internal VerUtilVersionReleaseLabel(IntPtr pReleaseLabel, IntPtr wzVersion) @@ -15,8 +18,19 @@ namespace WixToolset.Mba.Core this.Label = VerUtil.VersionStringFromOffset(wzVersion, releaseLabel.cchLabelOffset, releaseLabel.cchLabel); } + /// + /// Whether the label was parsed as a number. + /// public bool IsNumeric { get; private set; } + + /// + /// If then the value that was parsed. + /// public uint Value { get; private set; } + + /// + /// The string version of the label. + /// public string Label { get; private set; } } } diff --git a/src/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj b/src/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj index 2ca3d2d9..1cfc8c11 100644 --- a/src/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj +++ b/src/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj @@ -10,11 +10,7 @@ Managed Bootstrapper Application Core $(MSBuildThisFileName).nuspec true - false - - - - $(OutputPath)\$(AssemblyName).xml + true diff --git a/src/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec b/src/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec index cf7d014d..a5e09ea9 100644 --- a/src/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec +++ b/src/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec @@ -19,7 +19,9 @@ + + diff --git a/src/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs b/src/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs index 7fe0a405..aaf5ee29 100644 --- a/src/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs +++ b/src/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs @@ -102,6 +102,25 @@ namespace WixToolsetTest.Mba.Core [MarshalAs(UnmanagedType.LPWStr)] public string wzLayoutDirectory; } + [StructLayout(LayoutKind.Sequential)] + public struct BootstrapperCreateArgs + { + [MarshalAs(UnmanagedType.I4)] public readonly int cbSize; + [MarshalAs(UnmanagedType.I8)] public readonly long qwEngineAPIVersion; + public readonly IntPtr pfnBootstrapperEngineProc; + public readonly IntPtr pvBootstrapperEngineProcContext; + public readonly IntPtr pCommand; + + public BootstrapperCreateArgs(long version, IntPtr pEngineProc, IntPtr pEngineContext, IntPtr pCommand) + { + this.cbSize = Marshal.SizeOf(typeof(BootstrapperCreateArgs)); + this.qwEngineAPIVersion = version; + this.pfnBootstrapperEngineProc = pEngineProc; + this.pvBootstrapperEngineProcContext = pEngineContext; + this.pCommand = pCommand; + } + } + [StructLayout(LayoutKind.Sequential)] public struct TestCreateResults { -- cgit v1.2.3-55-g6feb