diff options
Diffstat (limited to 'src/api/burn/WixToolset.Mba.Core')
4 files changed, 64 insertions, 0 deletions
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs index fd36cf26..8a2e0e93 100644 --- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs | |||
@@ -209,6 +209,9 @@ namespace WixToolset.Mba.Core | |||
209 | public event EventHandler<ApplyCompleteEventArgs> ApplyComplete; | 209 | public event EventHandler<ApplyCompleteEventArgs> ApplyComplete; |
210 | 210 | ||
211 | /// <inheritdoc/> | 211 | /// <inheritdoc/> |
212 | public event EventHandler<ApplyDowngradeEventArgs> ApplyDowngrade; | ||
213 | |||
214 | /// <inheritdoc/> | ||
212 | public event EventHandler<ExecuteProgressEventArgs> ExecuteProgress; | 215 | public event EventHandler<ExecuteProgressEventArgs> ExecuteProgress; |
213 | 216 | ||
214 | /// <inheritdoc/> | 217 | /// <inheritdoc/> |
@@ -1056,6 +1059,19 @@ namespace WixToolset.Mba.Core | |||
1056 | } | 1059 | } |
1057 | 1060 | ||
1058 | /// <summary> | 1061 | /// <summary> |
1062 | /// Called by the engine, raises the <see cref="ApplyDowngrade"/> event. | ||
1063 | /// </summary> | ||
1064 | /// <param name="args">Additional arguments for this event.</param> | ||
1065 | protected virtual void OnApplyDowngrade(ApplyDowngradeEventArgs args) | ||
1066 | { | ||
1067 | EventHandler<ApplyDowngradeEventArgs> handler = this.ApplyDowngrade; | ||
1068 | if (null != handler) | ||
1069 | { | ||
1070 | handler(this, args); | ||
1071 | } | ||
1072 | } | ||
1073 | |||
1074 | /// <summary> | ||
1059 | /// Called by the engine, raises the <see cref="ExecuteProgress"/> event. | 1075 | /// Called by the engine, raises the <see cref="ExecuteProgress"/> event. |
1060 | /// </summary> | 1076 | /// </summary> |
1061 | /// <param name="args">Additional arguments for this event.</param> | 1077 | /// <param name="args">Additional arguments for this event.</param> |
@@ -1907,6 +1923,15 @@ namespace WixToolset.Mba.Core | |||
1907 | return args.HResult; | 1923 | return args.HResult; |
1908 | } | 1924 | } |
1909 | 1925 | ||
1926 | int IBootstrapperApplication.OnApplyDowngrade(int hrRecommendation, ref int hrStatus) | ||
1927 | { | ||
1928 | ApplyDowngradeEventArgs args = new ApplyDowngradeEventArgs(hrRecommendation, hrStatus); | ||
1929 | this.OnApplyDowngrade(args); | ||
1930 | |||
1931 | hrStatus = args.Status; | ||
1932 | return args.HResult; | ||
1933 | } | ||
1934 | |||
1910 | int IBootstrapperApplication.OnLaunchApprovedExeBegin(ref bool fCancel) | 1935 | int IBootstrapperApplication.OnLaunchApprovedExeBegin(ref bool fCancel) |
1911 | { | 1936 | { |
1912 | LaunchApprovedExeBeginEventArgs args = new LaunchApprovedExeBeginEventArgs(fCancel); | 1937 | LaunchApprovedExeBeginEventArgs args = new LaunchApprovedExeBeginEventArgs(fCancel); |
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs index d8ec7998..c93c2885 100644 --- a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs +++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs | |||
@@ -1859,6 +1859,30 @@ namespace WixToolset.Mba.Core | |||
1859 | } | 1859 | } |
1860 | 1860 | ||
1861 | /// <summary> | 1861 | /// <summary> |
1862 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ApplyDowngrade"/> | ||
1863 | /// </summary> | ||
1864 | [Serializable] | ||
1865 | public class ApplyDowngradeEventArgs : HResultEventArgs | ||
1866 | { | ||
1867 | /// <summary /> | ||
1868 | public ApplyDowngradeEventArgs(int hrRecommendation, int hrStatus) | ||
1869 | { | ||
1870 | this.Recommendation = hrRecommendation; | ||
1871 | this.Status = hrStatus; | ||
1872 | } | ||
1873 | |||
1874 | /// <summary> | ||
1875 | /// Gets the recommended HRESULT. | ||
1876 | /// </summary> | ||
1877 | public int Recommendation { get; private set; } | ||
1878 | |||
1879 | /// <summary> | ||
1880 | /// Gets or sets the HRESULT for Apply. | ||
1881 | /// </summary> | ||
1882 | public int Status { get; set; } | ||
1883 | } | ||
1884 | |||
1885 | /// <summary> | ||
1862 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>. | 1886 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>. |
1863 | /// </summary> | 1887 | /// </summary> |
1864 | [Serializable] | 1888 | [Serializable] |
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs index 4ab0f8d9..d4fe8320 100644 --- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs | |||
@@ -1160,6 +1160,16 @@ namespace WixToolset.Mba.Core | |||
1160 | [MarshalAs(UnmanagedType.U4)] ref RelatedBundlePlanType pRequestedType, | 1160 | [MarshalAs(UnmanagedType.U4)] ref RelatedBundlePlanType pRequestedType, |
1161 | [MarshalAs(UnmanagedType.Bool)] ref bool fCancel | 1161 | [MarshalAs(UnmanagedType.Bool)] ref bool fCancel |
1162 | ); | 1162 | ); |
1163 | |||
1164 | /// <summary> | ||
1165 | /// See <see cref="IDefaultBootstrapperApplication.ApplyDowngrade"/>. | ||
1166 | /// </summary> | ||
1167 | [PreserveSig] | ||
1168 | [return: MarshalAs(UnmanagedType.I4)] | ||
1169 | int OnApplyDowngrade( | ||
1170 | [MarshalAs(UnmanagedType.I4)] int hrRecommended, | ||
1171 | [MarshalAs(UnmanagedType.I4)] ref int hrStatus | ||
1172 | ); | ||
1163 | } | 1173 | } |
1164 | 1174 | ||
1165 | /// <summary> | 1175 | /// <summary> |
diff --git a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs index ebd1580b..c9284b69 100644 --- a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs | |||
@@ -20,6 +20,11 @@ namespace WixToolset.Mba.Core | |||
20 | event EventHandler<ApplyCompleteEventArgs> ApplyComplete; | 20 | event EventHandler<ApplyCompleteEventArgs> ApplyComplete; |
21 | 21 | ||
22 | /// <summary> | 22 | /// <summary> |
23 | /// Fired when the plan determined that nothing should happen to prevent downgrading. | ||
24 | /// </summary> | ||
25 | event EventHandler<ApplyDowngradeEventArgs> ApplyDowngrade; | ||
26 | |||
27 | /// <summary> | ||
23 | /// Fired when the engine is about to begin an MSI transaction. | 28 | /// Fired when the engine is about to begin an MSI transaction. |
24 | /// </summary> | 29 | /// </summary> |
25 | event EventHandler<BeginMsiTransactionBeginEventArgs> BeginMsiTransactionBegin; | 30 | event EventHandler<BeginMsiTransactionBeginEventArgs> BeginMsiTransactionBegin; |