@joebigelow / wix / commits / efbe4080

Add action to OnExecutePackageBegin.

Sean Hall committed Apr 21, 2020 at 17:11 UTC efbe40802d13867ab43f4d7808e1b91052b18ca2
13 files changed +27 -16
src/WixToolset.Mba.Core/BootstrapperApplication.cs
+2 -2
@@ -1466,9 +1466,9 @@ namespace WixToolset.Mba.Core
1466 return args.HResult;
1467 }
1468
1469 - int IBootstrapperApplication.OnExecutePackageBegin(string wzPackageId, bool fExecute, ref bool fCancel)
1469 + int IBootstrapperApplication.OnExecutePackageBegin(string wzPackageId, bool fExecute, ActionState action, ref bool fCancel)
1470 {
1471 - ExecutePackageBeginEventArgs args = new ExecutePackageBeginEventArgs(wzPackageId, fExecute, fCancel);
1471 + ExecutePackageBeginEventArgs args = new ExecutePackageBeginEventArgs(wzPackageId, fExecute, action, fCancel);
1472 this.OnExecutePackageBegin(args);
1473
1474 fCancel = args.Cancel;
src/WixToolset.Mba.Core/EventArgs.cs
+10 -3
@@ -1501,13 +1501,15 @@ namespace WixToolset.Mba.Core
1501 /// Creates a new instance of the <see cref="ExecutePackageBeginEventArgs"/> class.
1502 /// </summary>
1503 /// <param name="packageId">The identity of the package to act on.</param>
1504 - /// <param name="shouldExecute">Whether the package should really be acted on.</param>
1504 + /// <param name="shouldExecute">Whether the package is being executed or rolled back.</param>
1505 + /// <param name="action">The action about to be executed.</param>
1506 /// <param name="cancelRecommendation">The recommendation from the engine.</param>
1506 - public ExecutePackageBeginEventArgs(string packageId, bool shouldExecute, bool cancelRecommendation)
1507 + public ExecutePackageBeginEventArgs(string packageId, bool shouldExecute, ActionState action, bool cancelRecommendation)
1508 : base(cancelRecommendation)
1509 {
1510 this.PackageId = packageId;
1511 this.ShouldExecute = shouldExecute;
1512 + this.Action = action;
1513 }
1514
1515 /// <summary>
@@ -1516,9 +1518,14 @@ namespace WixToolset.Mba.Core
1518 public string PackageId { get; private set; }
1519
1520 /// <summary>
1519 - /// Gets whether the package should really be acted on.
1521 + /// Gets whether the package is being executed or rolled back.
1522 /// </summary>
1523 public bool ShouldExecute { get; private set; }
1524 +
1525 + /// <summary>
1526 + /// Gets the action about to be executed.
1527 + /// </summary>
1528 + public ActionState Action { get; private set; }
1529 }
1530
1531 /// <summary>
src/WixToolset.Mba.Core/IBootstrapperApplication.cs
+1
@@ -392,6 +392,7 @@ namespace WixToolset.Mba.Core
392 int OnExecutePackageBegin(
393 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
394 [MarshalAs(UnmanagedType.Bool)] bool fExecute,
395 + [MarshalAs(UnmanagedType.U4)] ActionState action,
396 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
397 );
398
src/balutil/balutil.vcxproj
+2 -2
@@ -2,7 +2,7 @@
2 <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4 <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 - <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props')" />
5 + <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props')" />
6 <Import Project="..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" />
7
8 <ItemGroup Label="ProjectConfigurations">
@@ -90,7 +90,7 @@
90 <PropertyGroup>
91 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
92 </PropertyGroup>
93 - <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props'))" />
93 + <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props'))" />
94 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props'))" />
95 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
96 </Target>
src/balutil/inc/BalBaseBAFunctions.h
+1
@@ -489,6 +489,7 @@ public: // IBootstrapperApplication
489 virtual STDMETHODIMP OnExecutePackageBegin(
490 __in_z LPCWSTR /*wzPackageId*/,
491 __in BOOL /*fExecute*/,
492 + __in BOOTSTRAPPER_ACTION_STATE /*action*/,
493 __inout BOOL* /*pfCancel*/
494 )
495 {
src/balutil/inc/BalBaseBootstrapperApplication.h
+1
@@ -603,6 +603,7 @@ public: // IBootstrapperApplication
603 virtual STDMETHODIMP OnExecutePackageBegin(
604 __in_z LPCWSTR wzPackageId,
605 __in BOOL fExecute,
606 + __in BOOTSTRAPPER_ACTION_STATE /*action*/,
607 __inout BOOL* pfCancel
608 )
609 {
src/balutil/inc/BalBaseBootstrapperApplicationProc.h
+1 -1
@@ -402,7 +402,7 @@ static HRESULT BalBaseBAProcOnExecutePackageBegin(
402 __inout BA_ONEXECUTEPACKAGEBEGIN_RESULTS* pResults
403 )
404 {
405 - return pBA->OnExecutePackageBegin(pArgs->wzPackageId, pArgs->fExecute, &pResults->fCancel);
405 + return pBA->OnExecutePackageBegin(pArgs->wzPackageId, pArgs->fExecute, pArgs->action, &pResults->fCancel);
406 }
407
408 static HRESULT BalBaseBAProcOnExecutePatchTarget(
src/balutil/inc/IBootstrapperApplication.h
+2 -1
@@ -388,7 +388,8 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
388 //
389 STDMETHOD(OnExecutePackageBegin)(
390 __in_z LPCWSTR wzPackageId,
391 - __in BOOL fExecute,
391 + __in BOOL fExecute, // false means rollback.
392 + __in BOOTSTRAPPER_ACTION_STATE action,
393 __inout BOOL* pfCancel
394 ) = 0;
395
src/balutil/packages.config
+1 -1
@@ -1,6 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <packages>
3 <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
4 - <package id="WixToolset.BootstrapperCore.Native" version="4.0.13" targetFramework="native" />
4 + <package id="WixToolset.BootstrapperCore.Native" version="4.0.14" targetFramework="native" />
5 <package id="WixToolset.DUtil" version="4.0.18" targetFramework="native" />
6 </packages>
\ No newline at end of file
src/bextutil/bextutil.vcxproj
+2 -2
@@ -2,7 +2,7 @@
2 <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4 <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 - <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props')" />
5 + <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props')" />
6 <Import Project="..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" />
7
8 <ItemGroup Label="ProjectConfigurations">
@@ -79,7 +79,7 @@
79 <PropertyGroup>
80 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
81 </PropertyGroup>
82 - <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props'))" />
82 + <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props'))" />
83 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props'))" />
84 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
85 </Target>
src/bextutil/packages.config
+1 -1
@@ -1,6 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <packages>
3 <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
4 - <package id="WixToolset.BootstrapperCore.Native" version="4.0.13" targetFramework="native" />
4 + <package id="WixToolset.BootstrapperCore.Native" version="4.0.14" targetFramework="native" />
5 <package id="WixToolset.DUtil" version="4.0.18" targetFramework="native" />
6 </packages>
\ No newline at end of file
src/mbanative/mbanative.vcxproj
+2 -2
@@ -2,7 +2,7 @@
2 <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4 <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 - <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props')" />
5 + <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props')" />
6 <Import Project="..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" />
7
8 <ItemGroup Label="ProjectConfigurations">
@@ -69,7 +69,7 @@
69 <PropertyGroup>
70 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
71 </PropertyGroup>
72 - <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.13\build\WixToolset.BootstrapperCore.Native.props'))" />
72 + <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props'))" />
73 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props'))" />
74 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
75 </Target>
src/mbanative/packages.config
+1 -1
@@ -1,6 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <packages>
3 <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
4 - <package id="WixToolset.BootstrapperCore.Native" version="4.0.13" targetFramework="native" />
4 + <package id="WixToolset.BootstrapperCore.Native" version="4.0.14" targetFramework="native" />
5 <package id="WixToolset.DUtil" version="4.0.18" targetFramework="native" />
6 </packages>
\ No newline at end of file