diff options
author | Nir Bar <nir.bar@panel-sw.co.il> | 2022-12-06 13:22:41 +0200 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-12-12 21:50:39 -0600 |
commit | 50e24e9cf2084b6cb67b5d8fc509163061408bb6 (patch) | |
tree | 05c9df57480eb6308c3462c13847b43288f9dbb4 | |
parent | c54f3083489827a1e57c6fd7f3d76f62ddc6e85e (diff) | |
download | wix-50e24e9cf2084b6cb67b5d8fc509163061408bb6.tar.gz wix-50e24e9cf2084b6cb67b5d8fc509163061408bb6.tar.bz2 wix-50e24e9cf2084b6cb67b5d8fc509163061408bb6.zip |
Use MSI transaction end result to detect whether reboot is needed
-rw-r--r-- | src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h | 14 | ||||
-rw-r--r-- | src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs | 12 | ||||
-rw-r--r-- | src/api/burn/WixToolset.Mba.Core/EventArgs.cs | 38 | ||||
-rw-r--r-- | src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs | 127 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/BalBaseBAFunctions.h | 10 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h | 32 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h | 10 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/IBootstrapperApplication.h | 12 | ||||
-rw-r--r-- | src/burn/engine/apply.cpp | 48 | ||||
-rw-r--r-- | src/burn/engine/elevation.cpp | 80 | ||||
-rw-r--r-- | src/burn/engine/elevation.h | 10 | ||||
-rw-r--r-- | src/burn/engine/msiengine.cpp | 42 | ||||
-rw-r--r-- | src/burn/engine/msiengine.h | 6 | ||||
-rw-r--r-- | src/burn/engine/userexperience.cpp | 38 | ||||
-rw-r--r-- | src/burn/engine/userexperience.h | 12 | ||||
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/inc/wiutil.h | 3 | ||||
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/wiutil.cpp | 8 |
17 files changed, 347 insertions, 155 deletions
diff --git a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h index c65ca86b..2633a9c2 100644 --- a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h +++ b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h | |||
@@ -293,6 +293,14 @@ enum BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION | |||
293 | BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION_SUSPEND, | 293 | BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION_SUSPEND, |
294 | }; | 294 | }; |
295 | 295 | ||
296 | enum BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION | ||
297 | { | ||
298 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_NONE, | ||
299 | // Instructs the engine to stop processing the chain and restart. | ||
300 | // The engine will launch again after the machine is restarted. | ||
301 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART, | ||
302 | }; | ||
303 | |||
296 | enum BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION | 304 | enum BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION |
297 | { | 305 | { |
298 | // Instructs the engine to stop waiting for the process to exit. | 306 | // Instructs the engine to stop waiting for the process to exit. |
@@ -697,11 +705,14 @@ struct BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS | |||
697 | DWORD cbSize; | 705 | DWORD cbSize; |
698 | LPCWSTR wzTransactionId; | 706 | LPCWSTR wzTransactionId; |
699 | HRESULT hrStatus; | 707 | HRESULT hrStatus; |
708 | BOOTSTRAPPER_APPLY_RESTART restart; | ||
709 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation; | ||
700 | }; | 710 | }; |
701 | 711 | ||
702 | struct BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS | 712 | struct BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS |
703 | { | 713 | { |
704 | DWORD cbSize; | 714 | DWORD cbSize; |
715 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action; | ||
705 | }; | 716 | }; |
706 | 717 | ||
707 | struct BA_ONDETECTBEGIN_ARGS | 718 | struct BA_ONDETECTBEGIN_ARGS |
@@ -1417,11 +1428,14 @@ struct BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS | |||
1417 | DWORD cbSize; | 1428 | DWORD cbSize; |
1418 | LPCWSTR wzTransactionId; | 1429 | LPCWSTR wzTransactionId; |
1419 | HRESULT hrStatus; | 1430 | HRESULT hrStatus; |
1431 | BOOTSTRAPPER_APPLY_RESTART restart; | ||
1432 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation; | ||
1420 | }; | 1433 | }; |
1421 | 1434 | ||
1422 | struct BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS | 1435 | struct BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS |
1423 | { | 1436 | { |
1424 | DWORD cbSize; | 1437 | DWORD cbSize; |
1438 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action; | ||
1425 | }; | 1439 | }; |
1426 | 1440 | ||
1427 | struct BA_ONSETUPDATEBEGIN_ARGS | 1441 | struct BA_ONSETUPDATEBEGIN_ARGS |
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs index ecc99069..b23cb3b2 100644 --- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs | |||
@@ -60,7 +60,7 @@ namespace WixToolset.Mba.Core | |||
60 | 60 | ||
61 | /// <inheritdoc/> | 61 | /// <inheritdoc/> |
62 | public event EventHandler<DetectCompatibleMsiPackageEventArgs> DetectCompatibleMsiPackage; | 62 | public event EventHandler<DetectCompatibleMsiPackageEventArgs> DetectCompatibleMsiPackage; |
63 | 63 | ||
64 | /// <inheritdoc/> | 64 | /// <inheritdoc/> |
65 | public event EventHandler<DetectRelatedMsiPackageEventArgs> DetectRelatedMsiPackage; | 65 | public event EventHandler<DetectRelatedMsiPackageEventArgs> DetectRelatedMsiPackage; |
66 | 66 | ||
@@ -1985,11 +1985,12 @@ namespace WixToolset.Mba.Core | |||
1985 | return args.HResult; | 1985 | return args.HResult; |
1986 | } | 1986 | } |
1987 | 1987 | ||
1988 | int IBootstrapperApplication.OnCommitMsiTransactionComplete(string transactionId, int hrStatus) | 1988 | int IBootstrapperApplication.OnCommitMsiTransactionComplete(string transactionId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION pAction) |
1989 | { | 1989 | { |
1990 | CommitMsiTransactionCompleteEventArgs args = new CommitMsiTransactionCompleteEventArgs(transactionId, hrStatus); | 1990 | CommitMsiTransactionCompleteEventArgs args = new CommitMsiTransactionCompleteEventArgs(transactionId, hrStatus, restart, recommendation, pAction); |
1991 | this.OnCommitMsiTransactionComplete(args); | 1991 | this.OnCommitMsiTransactionComplete(args); |
1992 | 1992 | ||
1993 | pAction = args.Action; | ||
1993 | return args.HResult; | 1994 | return args.HResult; |
1994 | } | 1995 | } |
1995 | 1996 | ||
@@ -2001,11 +2002,12 @@ namespace WixToolset.Mba.Core | |||
2001 | return args.HResult; | 2002 | return args.HResult; |
2002 | } | 2003 | } |
2003 | 2004 | ||
2004 | int IBootstrapperApplication.OnRollbackMsiTransactionComplete(string transactionId, int hrStatus) | 2005 | int IBootstrapperApplication.OnRollbackMsiTransactionComplete(string transactionId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION pAction) |
2005 | { | 2006 | { |
2006 | RollbackMsiTransactionCompleteEventArgs args = new RollbackMsiTransactionCompleteEventArgs(transactionId, hrStatus); | 2007 | RollbackMsiTransactionCompleteEventArgs args = new RollbackMsiTransactionCompleteEventArgs(transactionId, hrStatus, restart, recommendation, pAction); |
2007 | this.OnRollbackMsiTransactionComplete(args); | 2008 | this.OnRollbackMsiTransactionComplete(args); |
2008 | 2009 | ||
2010 | pAction = args.Action; | ||
2009 | return args.HResult; | 2011 | return args.HResult; |
2010 | } | 2012 | } |
2011 | 2013 | ||
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs index 48850fd7..9d18c4eb 100644 --- a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs +++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs | |||
@@ -568,7 +568,7 @@ namespace WixToolset.Mba.Core | |||
568 | public class DetectPatchTargetEventArgs : CancellableHResultEventArgs | 568 | public class DetectPatchTargetEventArgs : CancellableHResultEventArgs |
569 | { | 569 | { |
570 | /// <summary> | 570 | /// <summary> |
571 | /// | 571 | /// |
572 | /// </summary> | 572 | /// </summary> |
573 | /// <param name="packageId"></param> | 573 | /// <param name="packageId"></param> |
574 | /// <param name="productCode"></param> | 574 | /// <param name="productCode"></param> |
@@ -944,7 +944,7 @@ namespace WixToolset.Mba.Core | |||
944 | public class PlanPatchTargetEventArgs : CancellableHResultEventArgs | 944 | public class PlanPatchTargetEventArgs : CancellableHResultEventArgs |
945 | { | 945 | { |
946 | /// <summary> | 946 | /// <summary> |
947 | /// | 947 | /// |
948 | /// </summary> | 948 | /// </summary> |
949 | /// <param name="packageId"></param> | 949 | /// <param name="packageId"></param> |
950 | /// <param name="productCode"></param> | 950 | /// <param name="productCode"></param> |
@@ -1086,7 +1086,7 @@ namespace WixToolset.Mba.Core | |||
1086 | public class PlanPackageCompleteEventArgs : StatusEventArgs | 1086 | public class PlanPackageCompleteEventArgs : StatusEventArgs |
1087 | { | 1087 | { |
1088 | /// <summary> | 1088 | /// <summary> |
1089 | /// | 1089 | /// |
1090 | /// </summary> | 1090 | /// </summary> |
1091 | /// <param name="packageId"></param> | 1091 | /// <param name="packageId"></param> |
1092 | /// <param name="hrStatus"></param> | 1092 | /// <param name="hrStatus"></param> |
@@ -2117,19 +2117,25 @@ namespace WixToolset.Mba.Core | |||
2117 | /// Additional arguments passed by the engine after committing an MSI transaction. | 2117 | /// Additional arguments passed by the engine after committing an MSI transaction. |
2118 | /// </summary> | 2118 | /// </summary> |
2119 | [Serializable] | 2119 | [Serializable] |
2120 | public class CommitMsiTransactionCompleteEventArgs : StatusEventArgs | 2120 | public class CommitMsiTransactionCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION> |
2121 | { | 2121 | { |
2122 | /// <summary /> | 2122 | /// <summary /> |
2123 | public CommitMsiTransactionCompleteEventArgs(string transactionId, int hrStatus) | 2123 | public CommitMsiTransactionCompleteEventArgs(string transactionId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action) |
2124 | : base(hrStatus) | 2124 | : base(hrStatus, recommendation, action) |
2125 | { | 2125 | { |
2126 | this.TransactionId = transactionId; | 2126 | this.TransactionId = transactionId; |
2127 | this.Restart = restart; | ||
2127 | } | 2128 | } |
2128 | 2129 | ||
2129 | /// <summary> | 2130 | /// <summary> |
2130 | /// Gets the MSI transaction Id. | 2131 | /// Gets the MSI transaction Id. |
2131 | /// </summary> | 2132 | /// </summary> |
2132 | public string TransactionId { get; private set; } | 2133 | public string TransactionId { get; private set; } |
2134 | |||
2135 | /// <summary> | ||
2136 | /// Gets the package restart state after being applied. | ||
2137 | /// </summary> | ||
2138 | public ApplyRestart Restart { get; private set; } | ||
2133 | } | 2139 | } |
2134 | 2140 | ||
2135 | /// <summary> | 2141 | /// <summary> |
@@ -2154,19 +2160,25 @@ namespace WixToolset.Mba.Core | |||
2154 | /// Additional arguments passed by the engine after rolling back an MSI transaction. | 2160 | /// Additional arguments passed by the engine after rolling back an MSI transaction. |
2155 | /// </summary> | 2161 | /// </summary> |
2156 | [Serializable] | 2162 | [Serializable] |
2157 | public class RollbackMsiTransactionCompleteEventArgs : StatusEventArgs | 2163 | public class RollbackMsiTransactionCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION> |
2158 | { | 2164 | { |
2159 | /// <summary /> | 2165 | /// <summary /> |
2160 | public RollbackMsiTransactionCompleteEventArgs(string transactionId, int hrStatus) | 2166 | public RollbackMsiTransactionCompleteEventArgs(string transactionId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action) |
2161 | : base(hrStatus) | 2167 | : base(hrStatus, recommendation, action) |
2162 | { | 2168 | { |
2163 | this.TransactionId = transactionId; | 2169 | this.TransactionId = transactionId; |
2170 | this.Restart = restart; | ||
2164 | } | 2171 | } |
2165 | 2172 | ||
2166 | /// <summary> | 2173 | /// <summary> |
2167 | /// Gets the MSI transaction Id. | 2174 | /// Gets the MSI transaction Id. |
2168 | /// </summary> | 2175 | /// </summary> |
2169 | public string TransactionId { get; private set; } | 2176 | public string TransactionId { get; private set; } |
2177 | |||
2178 | /// <summary> | ||
2179 | /// Gets the package restart state after being applied. | ||
2180 | /// </summary> | ||
2181 | public ApplyRestart Restart { get; private set; } | ||
2170 | } | 2182 | } |
2171 | 2183 | ||
2172 | /// <summary> | 2184 | /// <summary> |
@@ -2176,7 +2188,7 @@ namespace WixToolset.Mba.Core | |||
2176 | public class PauseAutomaticUpdatesBeginEventArgs : HResultEventArgs | 2188 | public class PauseAutomaticUpdatesBeginEventArgs : HResultEventArgs |
2177 | { | 2189 | { |
2178 | /// <summary> | 2190 | /// <summary> |
2179 | /// | 2191 | /// |
2180 | /// </summary> | 2192 | /// </summary> |
2181 | public PauseAutomaticUpdatesBeginEventArgs() | 2193 | public PauseAutomaticUpdatesBeginEventArgs() |
2182 | { | 2194 | { |
@@ -2190,7 +2202,7 @@ namespace WixToolset.Mba.Core | |||
2190 | public class PauseAutomaticUpdatesCompleteEventArgs : StatusEventArgs | 2202 | public class PauseAutomaticUpdatesCompleteEventArgs : StatusEventArgs |
2191 | { | 2203 | { |
2192 | /// <summary> | 2204 | /// <summary> |
2193 | /// | 2205 | /// |
2194 | /// </summary> | 2206 | /// </summary> |
2195 | /// <param name="hrStatus"></param> | 2207 | /// <param name="hrStatus"></param> |
2196 | public PauseAutomaticUpdatesCompleteEventArgs(int hrStatus) | 2208 | public PauseAutomaticUpdatesCompleteEventArgs(int hrStatus) |
@@ -2206,7 +2218,7 @@ namespace WixToolset.Mba.Core | |||
2206 | public class SystemRestorePointBeginEventArgs : HResultEventArgs | 2218 | public class SystemRestorePointBeginEventArgs : HResultEventArgs |
2207 | { | 2219 | { |
2208 | /// <summary> | 2220 | /// <summary> |
2209 | /// | 2221 | /// |
2210 | /// </summary> | 2222 | /// </summary> |
2211 | public SystemRestorePointBeginEventArgs() | 2223 | public SystemRestorePointBeginEventArgs() |
2212 | { | 2224 | { |
@@ -2220,7 +2232,7 @@ namespace WixToolset.Mba.Core | |||
2220 | public class SystemRestorePointCompleteEventArgs : StatusEventArgs | 2232 | public class SystemRestorePointCompleteEventArgs : StatusEventArgs |
2221 | { | 2233 | { |
2222 | /// <summary> | 2234 | /// <summary> |
2223 | /// | 2235 | /// |
2224 | /// </summary> | 2236 | /// </summary> |
2225 | /// <param name="hrStatus"></param> | 2237 | /// <param name="hrStatus"></param> |
2226 | public SystemRestorePointCompleteEventArgs(int hrStatus) | 2238 | public SystemRestorePointCompleteEventArgs(int hrStatus) |
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs index daa95e17..7bfabeb3 100644 --- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs | |||
@@ -933,12 +933,18 @@ namespace WixToolset.Mba.Core | |||
933 | /// </summary> | 933 | /// </summary> |
934 | /// <param name="wzTransactionId"></param> | 934 | /// <param name="wzTransactionId"></param> |
935 | /// <param name="hrStatus"></param> | 935 | /// <param name="hrStatus"></param> |
936 | /// <param name="restart"></param> | ||
937 | /// <param name="recommendation"></param> | ||
938 | /// <param name="pAction"></param> | ||
936 | /// <returns></returns> | 939 | /// <returns></returns> |
937 | [PreserveSig] | 940 | [PreserveSig] |
938 | [return: MarshalAs(UnmanagedType.I4)] | 941 | [return: MarshalAs(UnmanagedType.I4)] |
939 | int OnCommitMsiTransactionComplete( | 942 | int OnCommitMsiTransactionComplete( |
940 | [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId, | 943 | [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId, |
941 | int hrStatus | 944 | int hrStatus, |
945 | [MarshalAs(UnmanagedType.U4)] ApplyRestart restart, | ||
946 | [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, | ||
947 | [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION pAction | ||
942 | ); | 948 | ); |
943 | 949 | ||
944 | /// <summary> | 950 | /// <summary> |
@@ -957,12 +963,18 @@ namespace WixToolset.Mba.Core | |||
957 | /// </summary> | 963 | /// </summary> |
958 | /// <param name="wzTransactionId"></param> | 964 | /// <param name="wzTransactionId"></param> |
959 | /// <param name="hrStatus"></param> | 965 | /// <param name="hrStatus"></param> |
966 | /// <param name="restart"></param> | ||
967 | /// <param name="recommendation"></param> | ||
968 | /// <param name="pAction"></param> | ||
960 | /// <returns></returns> | 969 | /// <returns></returns> |
961 | [PreserveSig] | 970 | [PreserveSig] |
962 | [return: MarshalAs(UnmanagedType.I4)] | 971 | [return: MarshalAs(UnmanagedType.I4)] |
963 | int OnRollbackMsiTransactionComplete( | 972 | int OnRollbackMsiTransactionComplete( |
964 | [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId, | 973 | [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId, |
965 | int hrStatus | 974 | int hrStatus, |
975 | [MarshalAs(UnmanagedType.U4)] ApplyRestart restart, | ||
976 | [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, | ||
977 | [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION pAction | ||
966 | ); | 978 | ); |
967 | 979 | ||
968 | /// <summary> | 980 | /// <summary> |
@@ -1199,27 +1211,27 @@ namespace WixToolset.Mba.Core | |||
1199 | public enum Display | 1211 | public enum Display |
1200 | { | 1212 | { |
1201 | /// <summary> | 1213 | /// <summary> |
1202 | /// | 1214 | /// |
1203 | /// </summary> | 1215 | /// </summary> |
1204 | Unknown, | 1216 | Unknown, |
1205 | 1217 | ||
1206 | /// <summary> | 1218 | /// <summary> |
1207 | /// | 1219 | /// |
1208 | /// </summary> | 1220 | /// </summary> |
1209 | Embedded, | 1221 | Embedded, |
1210 | 1222 | ||
1211 | /// <summary> | 1223 | /// <summary> |
1212 | /// | 1224 | /// |
1213 | /// </summary> | 1225 | /// </summary> |
1214 | None, | 1226 | None, |
1215 | 1227 | ||
1216 | /// <summary> | 1228 | /// <summary> |
1217 | /// | 1229 | /// |
1218 | /// </summary> | 1230 | /// </summary> |
1219 | Passive, | 1231 | Passive, |
1220 | 1232 | ||
1221 | /// <summary> | 1233 | /// <summary> |
1222 | /// | 1234 | /// |
1223 | /// </summary> | 1235 | /// </summary> |
1224 | Full, | 1236 | Full, |
1225 | } | 1237 | } |
@@ -1331,27 +1343,27 @@ namespace WixToolset.Mba.Core | |||
1331 | public enum Restart | 1343 | public enum Restart |
1332 | { | 1344 | { |
1333 | /// <summary> | 1345 | /// <summary> |
1334 | /// | 1346 | /// |
1335 | /// </summary> | 1347 | /// </summary> |
1336 | Unknown, | 1348 | Unknown, |
1337 | 1349 | ||
1338 | /// <summary> | 1350 | /// <summary> |
1339 | /// | 1351 | /// |
1340 | /// </summary> | 1352 | /// </summary> |
1341 | Never, | 1353 | Never, |
1342 | 1354 | ||
1343 | /// <summary> | 1355 | /// <summary> |
1344 | /// | 1356 | /// |
1345 | /// </summary> | 1357 | /// </summary> |
1346 | Prompt, | 1358 | Prompt, |
1347 | 1359 | ||
1348 | /// <summary> | 1360 | /// <summary> |
1349 | /// | 1361 | /// |
1350 | /// </summary> | 1362 | /// </summary> |
1351 | Automatic, | 1363 | Automatic, |
1352 | 1364 | ||
1353 | /// <summary> | 1365 | /// <summary> |
1354 | /// | 1366 | /// |
1355 | /// </summary> | 1367 | /// </summary> |
1356 | Always, | 1368 | Always, |
1357 | } | 1369 | } |
@@ -1384,47 +1396,47 @@ namespace WixToolset.Mba.Core | |||
1384 | public enum Result | 1396 | public enum Result |
1385 | { | 1397 | { |
1386 | /// <summary> | 1398 | /// <summary> |
1387 | /// | 1399 | /// |
1388 | /// </summary> | 1400 | /// </summary> |
1389 | Error = -1, | 1401 | Error = -1, |
1390 | 1402 | ||
1391 | /// <summary> | 1403 | /// <summary> |
1392 | /// | 1404 | /// |
1393 | /// </summary> | 1405 | /// </summary> |
1394 | None, | 1406 | None, |
1395 | 1407 | ||
1396 | /// <summary> | 1408 | /// <summary> |
1397 | /// | 1409 | /// |
1398 | /// </summary> | 1410 | /// </summary> |
1399 | Ok, | 1411 | Ok, |
1400 | 1412 | ||
1401 | /// <summary> | 1413 | /// <summary> |
1402 | /// | 1414 | /// |
1403 | /// </summary> | 1415 | /// </summary> |
1404 | Cancel, | 1416 | Cancel, |
1405 | 1417 | ||
1406 | /// <summary> | 1418 | /// <summary> |
1407 | /// | 1419 | /// |
1408 | /// </summary> | 1420 | /// </summary> |
1409 | Abort, | 1421 | Abort, |
1410 | 1422 | ||
1411 | /// <summary> | 1423 | /// <summary> |
1412 | /// | 1424 | /// |
1413 | /// </summary> | 1425 | /// </summary> |
1414 | Retry, | 1426 | Retry, |
1415 | 1427 | ||
1416 | /// <summary> | 1428 | /// <summary> |
1417 | /// | 1429 | /// |
1418 | /// </summary> | 1430 | /// </summary> |
1419 | Ignore, | 1431 | Ignore, |
1420 | 1432 | ||
1421 | /// <summary> | 1433 | /// <summary> |
1422 | /// | 1434 | /// |
1423 | /// </summary> | 1435 | /// </summary> |
1424 | Yes, | 1436 | Yes, |
1425 | 1437 | ||
1426 | /// <summary> | 1438 | /// <summary> |
1427 | /// | 1439 | /// |
1428 | /// </summary> | 1440 | /// </summary> |
1429 | No, | 1441 | No, |
1430 | 1442 | ||
@@ -1434,17 +1446,17 @@ namespace WixToolset.Mba.Core | |||
1434 | Close, | 1446 | Close, |
1435 | 1447 | ||
1436 | /// <summary> | 1448 | /// <summary> |
1437 | /// | 1449 | /// |
1438 | /// </summary> | 1450 | /// </summary> |
1439 | Help, | 1451 | Help, |
1440 | 1452 | ||
1441 | /// <summary> | 1453 | /// <summary> |
1442 | /// | 1454 | /// |
1443 | /// </summary> | 1455 | /// </summary> |
1444 | TryAgain, | 1456 | TryAgain, |
1445 | 1457 | ||
1446 | /// <summary> | 1458 | /// <summary> |
1447 | /// | 1459 | /// |
1448 | /// </summary> | 1460 | /// </summary> |
1449 | Continue, | 1461 | Continue, |
1450 | } | 1462 | } |
@@ -1455,7 +1467,7 @@ namespace WixToolset.Mba.Core | |||
1455 | public enum ResumeType | 1467 | public enum ResumeType |
1456 | { | 1468 | { |
1457 | /// <summary> | 1469 | /// <summary> |
1458 | /// | 1470 | /// |
1459 | /// </summary> | 1471 | /// </summary> |
1460 | None, | 1472 | None, |
1461 | 1473 | ||
@@ -1546,7 +1558,7 @@ namespace WixToolset.Mba.Core | |||
1546 | public enum RelatedOperation | 1558 | public enum RelatedOperation |
1547 | { | 1559 | { |
1548 | /// <summary> | 1560 | /// <summary> |
1549 | /// | 1561 | /// |
1550 | /// </summary> | 1562 | /// </summary> |
1551 | None, | 1563 | None, |
1552 | 1564 | ||
@@ -1685,47 +1697,47 @@ namespace WixToolset.Mba.Core | |||
1685 | public enum RelationType | 1697 | public enum RelationType |
1686 | { | 1698 | { |
1687 | /// <summary> | 1699 | /// <summary> |
1688 | /// | 1700 | /// |
1689 | /// </summary> | 1701 | /// </summary> |
1690 | None, | 1702 | None, |
1691 | 1703 | ||
1692 | /// <summary> | 1704 | /// <summary> |
1693 | /// | 1705 | /// |
1694 | /// </summary> | 1706 | /// </summary> |
1695 | Detect, | 1707 | Detect, |
1696 | 1708 | ||
1697 | /// <summary> | 1709 | /// <summary> |
1698 | /// | 1710 | /// |
1699 | /// </summary> | 1711 | /// </summary> |
1700 | Upgrade, | 1712 | Upgrade, |
1701 | 1713 | ||
1702 | /// <summary> | 1714 | /// <summary> |
1703 | /// | 1715 | /// |
1704 | /// </summary> | 1716 | /// </summary> |
1705 | Addon, | 1717 | Addon, |
1706 | 1718 | ||
1707 | /// <summary> | 1719 | /// <summary> |
1708 | /// | 1720 | /// |
1709 | /// </summary> | 1721 | /// </summary> |
1710 | Patch, | 1722 | Patch, |
1711 | 1723 | ||
1712 | /// <summary> | 1724 | /// <summary> |
1713 | /// | 1725 | /// |
1714 | /// </summary> | 1726 | /// </summary> |
1715 | DependentAddon, | 1727 | DependentAddon, |
1716 | 1728 | ||
1717 | /// <summary> | 1729 | /// <summary> |
1718 | /// | 1730 | /// |
1719 | /// </summary> | 1731 | /// </summary> |
1720 | DependentPatch, | 1732 | DependentPatch, |
1721 | 1733 | ||
1722 | /// <summary> | 1734 | /// <summary> |
1723 | /// | 1735 | /// |
1724 | /// </summary> | 1736 | /// </summary> |
1725 | Update, | 1737 | Update, |
1726 | 1738 | ||
1727 | /// <summary> | 1739 | /// <summary> |
1728 | /// | 1740 | /// |
1729 | /// </summary> | 1741 | /// </summary> |
1730 | ChainPackage, | 1742 | ChainPackage, |
1731 | } | 1743 | } |
@@ -1736,37 +1748,37 @@ namespace WixToolset.Mba.Core | |||
1736 | public enum RelatedBundlePlanType | 1748 | public enum RelatedBundlePlanType |
1737 | { | 1749 | { |
1738 | /// <summary> | 1750 | /// <summary> |
1739 | /// | 1751 | /// |
1740 | /// </summary> | 1752 | /// </summary> |
1741 | None, | 1753 | None, |
1742 | 1754 | ||
1743 | /// <summary> | 1755 | /// <summary> |
1744 | /// | 1756 | /// |
1745 | /// </summary> | 1757 | /// </summary> |
1746 | Downgrade, | 1758 | Downgrade, |
1747 | 1759 | ||
1748 | /// <summary> | 1760 | /// <summary> |
1749 | /// | 1761 | /// |
1750 | /// </summary> | 1762 | /// </summary> |
1751 | Upgrade, | 1763 | Upgrade, |
1752 | 1764 | ||
1753 | /// <summary> | 1765 | /// <summary> |
1754 | /// | 1766 | /// |
1755 | /// </summary> | 1767 | /// </summary> |
1756 | Addon, | 1768 | Addon, |
1757 | 1769 | ||
1758 | /// <summary> | 1770 | /// <summary> |
1759 | /// | 1771 | /// |
1760 | /// </summary> | 1772 | /// </summary> |
1761 | Patch, | 1773 | Patch, |
1762 | 1774 | ||
1763 | /// <summary> | 1775 | /// <summary> |
1764 | /// | 1776 | /// |
1765 | /// </summary> | 1777 | /// </summary> |
1766 | DependentAddon, | 1778 | DependentAddon, |
1767 | 1779 | ||
1768 | /// <summary> | 1780 | /// <summary> |
1769 | /// | 1781 | /// |
1770 | /// </summary> | 1782 | /// </summary> |
1771 | DependentPatch, | 1783 | DependentPatch, |
1772 | } | 1784 | } |
@@ -1804,7 +1816,7 @@ namespace WixToolset.Mba.Core | |||
1804 | public enum BOOTSTRAPPER_APPLYCOMPLETE_ACTION | 1816 | public enum BOOTSTRAPPER_APPLYCOMPLETE_ACTION |
1805 | { | 1817 | { |
1806 | /// <summary> | 1818 | /// <summary> |
1807 | /// | 1819 | /// |
1808 | /// </summary> | 1820 | /// </summary> |
1809 | None, | 1821 | None, |
1810 | 1822 | ||
@@ -1843,7 +1855,7 @@ namespace WixToolset.Mba.Core | |||
1843 | public enum BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION | 1855 | public enum BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION |
1844 | { | 1856 | { |
1845 | /// <summary> | 1857 | /// <summary> |
1846 | /// | 1858 | /// |
1847 | /// </summary> | 1859 | /// </summary> |
1848 | None, | 1860 | None, |
1849 | 1861 | ||
@@ -1860,7 +1872,7 @@ namespace WixToolset.Mba.Core | |||
1860 | public enum BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION | 1872 | public enum BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION |
1861 | { | 1873 | { |
1862 | /// <summary> | 1874 | /// <summary> |
1863 | /// | 1875 | /// |
1864 | /// </summary> | 1876 | /// </summary> |
1865 | None, | 1877 | None, |
1866 | 1878 | ||
@@ -1883,7 +1895,7 @@ namespace WixToolset.Mba.Core | |||
1883 | public enum BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION | 1895 | public enum BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION |
1884 | { | 1896 | { |
1885 | /// <summary> | 1897 | /// <summary> |
1886 | /// | 1898 | /// |
1887 | /// </summary> | 1899 | /// </summary> |
1888 | None, | 1900 | None, |
1889 | 1901 | ||
@@ -1900,7 +1912,7 @@ namespace WixToolset.Mba.Core | |||
1900 | public enum BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION | 1912 | public enum BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION |
1901 | { | 1913 | { |
1902 | /// <summary> | 1914 | /// <summary> |
1903 | /// | 1915 | /// |
1904 | /// </summary> | 1916 | /// </summary> |
1905 | None, | 1917 | None, |
1906 | 1918 | ||
@@ -1921,7 +1933,7 @@ namespace WixToolset.Mba.Core | |||
1921 | public enum BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION | 1933 | public enum BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION |
1922 | { | 1934 | { |
1923 | /// <summary> | 1935 | /// <summary> |
1924 | /// | 1936 | /// |
1925 | /// </summary> | 1937 | /// </summary> |
1926 | None, | 1938 | None, |
1927 | 1939 | ||
@@ -1950,6 +1962,23 @@ namespace WixToolset.Mba.Core | |||
1950 | } | 1962 | } |
1951 | 1963 | ||
1952 | /// <summary> | 1964 | /// <summary> |
1965 | /// The available actions for <see cref="IDefaultBootstrapperApplication.CommitMsiTransactionComplete"/> and <see cref="IDefaultBootstrapperApplication.RollbackMsiTransactionComplete"/>. | ||
1966 | /// </summary> | ||
1967 | public enum BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION | ||
1968 | { | ||
1969 | /// <summary> | ||
1970 | /// | ||
1971 | /// </summary> | ||
1972 | None, | ||
1973 | |||
1974 | /// <summary> | ||
1975 | /// Instructs the engine to stop processing the chain and restart. | ||
1976 | /// The engine will launch again after the machine is restarted. | ||
1977 | /// </summary> | ||
1978 | Restart, | ||
1979 | }; | ||
1980 | |||
1981 | /// <summary> | ||
1953 | /// The available actions for <see cref="IDefaultBootstrapperApplication.ExecuteProcessCancel"/>. | 1982 | /// The available actions for <see cref="IDefaultBootstrapperApplication.ExecuteProcessCancel"/>. |
1954 | /// </summary> | 1983 | /// </summary> |
1955 | public enum BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION | 1984 | public enum BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION |
@@ -2017,7 +2046,7 @@ namespace WixToolset.Mba.Core | |||
2017 | public enum BOOTSTRAPPER_SHUTDOWN_ACTION | 2046 | public enum BOOTSTRAPPER_SHUTDOWN_ACTION |
2018 | { | 2047 | { |
2019 | /// <summary> | 2048 | /// <summary> |
2020 | /// | 2049 | /// |
2021 | /// </summary> | 2050 | /// </summary> |
2022 | None, | 2051 | None, |
2023 | 2052 | ||
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h index 9a8ac87e..6ad109c3 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h | |||
@@ -710,7 +710,10 @@ public: // IBootstrapperApplication | |||
710 | 710 | ||
711 | virtual STDMETHODIMP OnCommitMsiTransactionComplete( | 711 | virtual STDMETHODIMP OnCommitMsiTransactionComplete( |
712 | __in_z LPCWSTR /*wzTransactionId*/, | 712 | __in_z LPCWSTR /*wzTransactionId*/, |
713 | __in HRESULT /*hrStatus*/ | 713 | __in HRESULT /*hrStatus*/, |
714 | __in BOOTSTRAPPER_APPLY_RESTART /*restart*/, | ||
715 | __in BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION /*recommendation*/, | ||
716 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* /*pAction*/ | ||
714 | ) | 717 | ) |
715 | { | 718 | { |
716 | return S_OK; | 719 | return S_OK; |
@@ -725,7 +728,10 @@ public: // IBootstrapperApplication | |||
725 | 728 | ||
726 | virtual STDMETHODIMP OnRollbackMsiTransactionComplete( | 729 | virtual STDMETHODIMP OnRollbackMsiTransactionComplete( |
727 | __in_z LPCWSTR /*wzTransactionId*/, | 730 | __in_z LPCWSTR /*wzTransactionId*/, |
728 | __in HRESULT /*hrStatus*/ | 731 | __in HRESULT /*hrStatus*/, |
732 | __in BOOTSTRAPPER_APPLY_RESTART /*restart*/, | ||
733 | __in BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION /*recommendation*/, | ||
734 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* /*pAction*/ | ||
729 | ) | 735 | ) |
730 | { | 736 | { |
731 | return S_OK; | 737 | return S_OK; |
diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h index 58cc0673..c8b80d13 100644 --- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h | |||
@@ -197,7 +197,7 @@ public: // IBootstrapperApplication | |||
197 | __in LPCWSTR /*wzVersion*/, | 197 | __in LPCWSTR /*wzVersion*/, |
198 | __in BOOTSTRAPPER_RELATED_OPERATION /*operation*/, | 198 | __in BOOTSTRAPPER_RELATED_OPERATION /*operation*/, |
199 | __inout BOOL* pfCancel | 199 | __inout BOOL* pfCancel |
200 | ) | 200 | ) |
201 | { | 201 | { |
202 | *pfCancel |= CheckCanceled(); | 202 | *pfCancel |= CheckCanceled(); |
203 | return S_OK; | 203 | return S_OK; |
@@ -902,10 +902,21 @@ public: // IBootstrapperApplication | |||
902 | 902 | ||
903 | virtual STDMETHODIMP OnCommitMsiTransactionComplete( | 903 | virtual STDMETHODIMP OnCommitMsiTransactionComplete( |
904 | __in_z LPCWSTR /*wzTransactionId*/, | 904 | __in_z LPCWSTR /*wzTransactionId*/, |
905 | __in HRESULT /*hrStatus*/ | 905 | __in HRESULT /*hrStatus*/, |
906 | __in BOOTSTRAPPER_APPLY_RESTART /*restart*/, | ||
907 | __in BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION /*recommendation*/, | ||
908 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* /*pAction*/ | ||
906 | ) | 909 | ) |
907 | { | 910 | { |
908 | return S_OK; | 911 | HRESULT hr = S_OK; |
912 | |||
913 | if (CheckCanceled()) | ||
914 | { | ||
915 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); | ||
916 | } | ||
917 | |||
918 | LExit: | ||
919 | return hr; | ||
909 | } | 920 | } |
910 | 921 | ||
911 | virtual STDMETHODIMP OnRollbackMsiTransactionBegin( | 922 | virtual STDMETHODIMP OnRollbackMsiTransactionBegin( |
@@ -917,10 +928,21 @@ public: // IBootstrapperApplication | |||
917 | 928 | ||
918 | virtual STDMETHODIMP OnRollbackMsiTransactionComplete( | 929 | virtual STDMETHODIMP OnRollbackMsiTransactionComplete( |
919 | __in_z LPCWSTR /*wzTransactionId*/, | 930 | __in_z LPCWSTR /*wzTransactionId*/, |
920 | __in HRESULT /*hrStatus*/ | 931 | __in HRESULT /*hrStatus*/, |
932 | __in BOOTSTRAPPER_APPLY_RESTART /*restart*/, | ||
933 | __in BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION /*recommendation*/, | ||
934 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* /*pAction*/ | ||
921 | ) | 935 | ) |
922 | { | 936 | { |
923 | return S_OK; | 937 | HRESULT hr = S_OK; |
938 | |||
939 | if (CheckCanceled()) | ||
940 | { | ||
941 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); | ||
942 | } | ||
943 | |||
944 | LExit: | ||
945 | return hr; | ||
924 | } | 946 | } |
925 | 947 | ||
926 | virtual STDMETHODIMP OnPauseAutomaticUpdatesBegin( | 948 | virtual STDMETHODIMP OnPauseAutomaticUpdatesBegin( |
diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h index 62cb85bc..34739ba3 100644 --- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h +++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h | |||
@@ -579,10 +579,10 @@ static HRESULT BalBaseBAProcOnCommitMsiTransactionBegin( | |||
579 | static HRESULT BalBaseBAProcOnCommitMsiTransactionComplete( | 579 | static HRESULT BalBaseBAProcOnCommitMsiTransactionComplete( |
580 | __in IBootstrapperApplication* pBA, | 580 | __in IBootstrapperApplication* pBA, |
581 | __in BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS* pArgs, | 581 | __in BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS* pArgs, |
582 | __inout BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS* /*pResults*/ | 582 | __inout BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS* pResults |
583 | ) | 583 | ) |
584 | { | 584 | { |
585 | return pBA->OnCommitMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus); | 585 | return pBA->OnCommitMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action); |
586 | } | 586 | } |
587 | 587 | ||
588 | static HRESULT BalBaseBAProcOnRollbackMsiTransactionBegin( | 588 | static HRESULT BalBaseBAProcOnRollbackMsiTransactionBegin( |
@@ -597,10 +597,10 @@ static HRESULT BalBaseBAProcOnRollbackMsiTransactionBegin( | |||
597 | static HRESULT BalBaseBAProcOnRollbackMsiTransactionComplete( | 597 | static HRESULT BalBaseBAProcOnRollbackMsiTransactionComplete( |
598 | __in IBootstrapperApplication* pBA, | 598 | __in IBootstrapperApplication* pBA, |
599 | __in BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS* pArgs, | 599 | __in BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS* pArgs, |
600 | __inout BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS* /*pResults*/ | 600 | __inout BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS* pResults |
601 | ) | 601 | ) |
602 | { | 602 | { |
603 | return pBA->OnRollbackMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus); | 603 | return pBA->OnRollbackMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action); |
604 | } | 604 | } |
605 | 605 | ||
606 | static HRESULT BalBaseBAProcOnPauseAutomaticUpdatesBegin( | 606 | static HRESULT BalBaseBAProcOnPauseAutomaticUpdatesBegin( |
@@ -780,7 +780,7 @@ static HRESULT WINAPI BalBaseBootstrapperApplicationProc( | |||
780 | { | 780 | { |
781 | IBootstrapperApplication* pBA = reinterpret_cast<IBootstrapperApplication*>(pvContext); | 781 | IBootstrapperApplication* pBA = reinterpret_cast<IBootstrapperApplication*>(pvContext); |
782 | HRESULT hr = pBA->BAProc(message, pvArgs, pvResults, pvContext); | 782 | HRESULT hr = pBA->BAProc(message, pvArgs, pvResults, pvContext); |
783 | 783 | ||
784 | if (E_NOTIMPL == hr) | 784 | if (E_NOTIMPL == hr) |
785 | { | 785 | { |
786 | switch (message) | 786 | switch (message) |
diff --git a/src/api/burn/balutil/inc/IBootstrapperApplication.h b/src/api/burn/balutil/inc/IBootstrapperApplication.h index fba919ea..faa211e4 100644 --- a/src/api/burn/balutil/inc/IBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/IBootstrapperApplication.h | |||
@@ -574,7 +574,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
574 | ) = 0; | 574 | ) = 0; |
575 | 575 | ||
576 | // OnLaunchApprovedExeBegin - called before trying to launch the preapproved executable. | 576 | // OnLaunchApprovedExeBegin - called before trying to launch the preapproved executable. |
577 | // | 577 | // |
578 | STDMETHOD(OnLaunchApprovedExeBegin)( | 578 | STDMETHOD(OnLaunchApprovedExeBegin)( |
579 | __inout BOOL* pfCancel | 579 | __inout BOOL* pfCancel |
580 | ) = 0; | 580 | ) = 0; |
@@ -603,7 +603,10 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
603 | 603 | ||
604 | STDMETHOD(OnCommitMsiTransactionComplete)( | 604 | STDMETHOD(OnCommitMsiTransactionComplete)( |
605 | __in_z LPCWSTR wzTransactionId, | 605 | __in_z LPCWSTR wzTransactionId, |
606 | __in HRESULT hrStatus | 606 | __in HRESULT hrStatus, |
607 | __in BOOTSTRAPPER_APPLY_RESTART restart, | ||
608 | __in BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, | ||
609 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction | ||
607 | ) = 0; | 610 | ) = 0; |
608 | 611 | ||
609 | STDMETHOD(OnRollbackMsiTransactionBegin)( | 612 | STDMETHOD(OnRollbackMsiTransactionBegin)( |
@@ -612,7 +615,10 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
612 | 615 | ||
613 | STDMETHOD(OnRollbackMsiTransactionComplete)( | 616 | STDMETHOD(OnRollbackMsiTransactionComplete)( |
614 | __in_z LPCWSTR wzTransactionId, | 617 | __in_z LPCWSTR wzTransactionId, |
615 | __in HRESULT hrStatus | 618 | __in HRESULT hrStatus, |
619 | __in BOOTSTRAPPER_APPLY_RESTART restart, | ||
620 | __in BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, | ||
621 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction | ||
616 | ) = 0; | 622 | ) = 0; |
617 | 623 | ||
618 | STDMETHOD(OnPauseAutomaticUpdatesBegin)( | 624 | STDMETHOD(OnPauseAutomaticUpdatesBegin)( |
diff --git a/src/burn/engine/apply.cpp b/src/burn/engine/apply.cpp index 8fbaa76e..9a1a7bf9 100644 --- a/src/burn/engine/apply.cpp +++ b/src/burn/engine/apply.cpp | |||
@@ -300,12 +300,14 @@ static HRESULT ExecuteMsiBeginTransaction( | |||
300 | static HRESULT ExecuteMsiCommitTransaction( | 300 | static HRESULT ExecuteMsiCommitTransaction( |
301 | __in BURN_ENGINE_STATE* pEngineState, | 301 | __in BURN_ENGINE_STATE* pEngineState, |
302 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 302 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
303 | __in BURN_EXECUTE_CONTEXT* pContext | 303 | __in BURN_EXECUTE_CONTEXT* pContext, |
304 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
304 | ); | 305 | ); |
305 | static HRESULT ExecuteMsiRollbackTransaction( | 306 | static HRESULT ExecuteMsiRollbackTransaction( |
306 | __in BURN_ENGINE_STATE* pEngineState, | 307 | __in BURN_ENGINE_STATE* pEngineState, |
307 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 308 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
308 | __in BURN_EXECUTE_CONTEXT* pContext | 309 | __in BURN_EXECUTE_CONTEXT* pContext, |
310 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
309 | ); | 311 | ); |
310 | static void ResetTransactionRegistrationState( | 312 | static void ResetTransactionRegistrationState( |
311 | __in BURN_ENGINE_STATE* pEngineState, | 313 | __in BURN_ENGINE_STATE* pEngineState, |
@@ -645,7 +647,7 @@ extern "C" HRESULT ApplyCache( | |||
645 | Assert(pPlan->sczLayoutDirectory); | 647 | Assert(pPlan->sczLayoutDirectory); |
646 | hr = ApplyLayoutContainer(&cacheContext, pCacheAction->container.pContainer); | 648 | hr = ApplyLayoutContainer(&cacheContext, pCacheAction->container.pContainer); |
647 | ExitOnFailure(hr, "Failed cache action: %ls", L"layout container"); | 649 | ExitOnFailure(hr, "Failed cache action: %ls", L"layout container"); |
648 | 650 | ||
649 | break; | 651 | break; |
650 | 652 | ||
651 | case BURN_CACHE_ACTION_TYPE_SIGNAL_SYNCPOINT: | 653 | case BURN_CACHE_ACTION_TYPE_SIGNAL_SYNCPOINT: |
@@ -793,7 +795,7 @@ extern "C" HRESULT ApplyExecute( | |||
793 | 795 | ||
794 | if (pCheckpoint && pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) | 796 | if (pCheckpoint && pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) |
795 | { | 797 | { |
796 | hrRollback = ExecuteMsiCommitTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context); | 798 | hrRollback = ExecuteMsiCommitTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context, pRestart); |
797 | IgnoreRollbackError(hrRollback, "Failed commit transaction from disable rollback"); | 799 | IgnoreRollbackError(hrRollback, "Failed commit transaction from disable rollback"); |
798 | } | 800 | } |
799 | 801 | ||
@@ -806,7 +808,7 @@ extern "C" HRESULT ApplyExecute( | |||
806 | // If inside a MSI transaction, roll it back. | 808 | // If inside a MSI transaction, roll it back. |
807 | if (pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) | 809 | if (pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) |
808 | { | 810 | { |
809 | hrRollback = ExecuteMsiRollbackTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context); | 811 | hrRollback = ExecuteMsiRollbackTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context, pRestart); |
810 | IgnoreRollbackError(hrRollback, "Failed rolling back transaction"); | 812 | IgnoreRollbackError(hrRollback, "Failed rolling back transaction"); |
811 | } | 813 | } |
812 | 814 | ||
@@ -2058,13 +2060,13 @@ static HRESULT DownloadPayload( | |||
2058 | cacheCallback.pfnProgress = CacheProgressRoutine; | 2060 | cacheCallback.pfnProgress = CacheProgressRoutine; |
2059 | cacheCallback.pfnCancel = NULL; // TODO: set this | 2061 | cacheCallback.pfnCancel = NULL; // TODO: set this |
2060 | cacheCallback.pv = pProgress; | 2062 | cacheCallback.pv = pProgress; |
2061 | 2063 | ||
2062 | authenticationData.pUX = pProgress->pCacheContext->pUX; | 2064 | authenticationData.pUX = pProgress->pCacheContext->pUX; |
2063 | authenticationData.wzPackageOrContainerId = wzPackageOrContainerId; | 2065 | authenticationData.wzPackageOrContainerId = wzPackageOrContainerId; |
2064 | authenticationData.wzPayloadId = wzPayloadId; | 2066 | authenticationData.wzPayloadId = wzPayloadId; |
2065 | authenticationCallback.pv = static_cast<LPVOID>(&authenticationData); | 2067 | authenticationCallback.pv = static_cast<LPVOID>(&authenticationData); |
2066 | authenticationCallback.pfnAuthenticate = &AuthenticationRequired; | 2068 | authenticationCallback.pfnAuthenticate = &AuthenticationRequired; |
2067 | 2069 | ||
2068 | hr = DownloadUrl(pDownloadSource, qwDownloadSize, wzDestinationPath, &cacheCallback, &authenticationCallback); | 2070 | hr = DownloadUrl(pDownloadSource, qwDownloadSize, wzDestinationPath, &cacheCallback, &authenticationCallback); |
2069 | ExitOnFailure(hr, "Failed attempt to download URL: '%ls' to: '%ls'", pDownloadSource->sczUrl, wzDestinationPath); | 2071 | ExitOnFailure(hr, "Failed attempt to download URL: '%ls' to: '%ls'", pDownloadSource->sczUrl, wzDestinationPath); |
2070 | 2072 | ||
@@ -2526,7 +2528,7 @@ static HRESULT DoExecuteAction( | |||
2526 | break; | 2528 | break; |
2527 | 2529 | ||
2528 | case BURN_EXECUTE_ACTION_TYPE_COMMIT_MSI_TRANSACTION: | 2530 | case BURN_EXECUTE_ACTION_TYPE_COMMIT_MSI_TRANSACTION: |
2529 | hr = ExecuteMsiCommitTransaction(pEngineState, pExecuteAction->msiTransaction.pRollbackBoundary, pContext); | 2531 | hr = ExecuteMsiCommitTransaction(pEngineState, pExecuteAction->msiTransaction.pRollbackBoundary, pContext, &restart); |
2530 | ExitOnFailure(hr, "Failed to execute commit MSI transaction action."); | 2532 | ExitOnFailure(hr, "Failed to execute commit MSI transaction action."); |
2531 | break; | 2533 | break; |
2532 | 2534 | ||
@@ -3381,11 +3383,13 @@ LExit: | |||
3381 | static HRESULT ExecuteMsiCommitTransaction( | 3383 | static HRESULT ExecuteMsiCommitTransaction( |
3382 | __in BURN_ENGINE_STATE* pEngineState, | 3384 | __in BURN_ENGINE_STATE* pEngineState, |
3383 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 3385 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
3384 | __in BURN_EXECUTE_CONTEXT* /*pContext*/ | 3386 | __in BURN_EXECUTE_CONTEXT* pContext, |
3387 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
3385 | ) | 3388 | ) |
3386 | { | 3389 | { |
3387 | HRESULT hr = S_OK; | 3390 | HRESULT hr = S_OK; |
3388 | BOOL fCommitBeginCalled = FALSE; | 3391 | BOOL fCommitBeginCalled = FALSE; |
3392 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action = BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_NONE; | ||
3389 | 3393 | ||
3390 | if (!pRollbackBoundary->fActiveTransaction) | 3394 | if (!pRollbackBoundary->fActiveTransaction) |
3391 | { | 3395 | { |
@@ -3398,12 +3402,12 @@ static HRESULT ExecuteMsiCommitTransaction( | |||
3398 | 3402 | ||
3399 | if (pEngineState->plan.fPerMachine) | 3403 | if (pEngineState->plan.fPerMachine) |
3400 | { | 3404 | { |
3401 | hr = ElevationMsiCommitTransaction(pEngineState->companionConnection.hPipe, pRollbackBoundary); | 3405 | hr = ElevationMsiCommitTransaction(pEngineState->companionConnection.hPipe, pRollbackBoundary, MsiExecuteMessageHandler, pContext, pRestart); |
3402 | ExitOnFailure(hr, "Failed to commit an elevated MSI transaction."); | 3406 | ExitOnFailure(hr, "Failed to commit an elevated MSI transaction."); |
3403 | } | 3407 | } |
3404 | else | 3408 | else |
3405 | { | 3409 | { |
3406 | hr = MsiEngineCommitTransaction(pRollbackBoundary); | 3410 | hr = MsiEngineCommitTransaction(pRollbackBoundary, pRestart); |
3407 | } | 3411 | } |
3408 | 3412 | ||
3409 | // Assume that MsiEndTransaction can only be called once for each MsiBeginTransaction. | 3413 | // Assume that MsiEndTransaction can only be called once for each MsiBeginTransaction. |
@@ -3414,7 +3418,12 @@ static HRESULT ExecuteMsiCommitTransaction( | |||
3414 | LExit: | 3418 | LExit: |
3415 | if (fCommitBeginCalled) | 3419 | if (fCommitBeginCalled) |
3416 | { | 3420 | { |
3417 | UserExperienceOnCommitMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr); | 3421 | UserExperienceOnCommitMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr, *pRestart, &action); |
3422 | |||
3423 | if (action == BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART) | ||
3424 | { | ||
3425 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | ||
3426 | } | ||
3418 | } | 3427 | } |
3419 | 3428 | ||
3420 | return hr; | 3429 | return hr; |
@@ -3423,11 +3432,13 @@ LExit: | |||
3423 | static HRESULT ExecuteMsiRollbackTransaction( | 3432 | static HRESULT ExecuteMsiRollbackTransaction( |
3424 | __in BURN_ENGINE_STATE* pEngineState, | 3433 | __in BURN_ENGINE_STATE* pEngineState, |
3425 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 3434 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
3426 | __in BURN_EXECUTE_CONTEXT* /*pContext*/ | 3435 | __in BURN_EXECUTE_CONTEXT* pContext, |
3436 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
3427 | ) | 3437 | ) |
3428 | { | 3438 | { |
3429 | HRESULT hr = S_OK; | 3439 | HRESULT hr = S_OK; |
3430 | BOOL fRollbackBeginCalled = FALSE; | 3440 | BOOL fRollbackBeginCalled = FALSE; |
3441 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action = BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_NONE; | ||
3431 | 3442 | ||
3432 | if (!pRollbackBoundary->fActiveTransaction) | 3443 | if (!pRollbackBoundary->fActiveTransaction) |
3433 | { | 3444 | { |
@@ -3439,12 +3450,12 @@ static HRESULT ExecuteMsiRollbackTransaction( | |||
3439 | 3450 | ||
3440 | if (pEngineState->plan.fPerMachine) | 3451 | if (pEngineState->plan.fPerMachine) |
3441 | { | 3452 | { |
3442 | hr = ElevationMsiRollbackTransaction(pEngineState->companionConnection.hPipe, pRollbackBoundary); | 3453 | hr = ElevationMsiRollbackTransaction(pEngineState->companionConnection.hPipe, pRollbackBoundary, MsiExecuteMessageHandler, pContext, pRestart); |
3443 | ExitOnFailure(hr, "Failed to rollback an elevated MSI transaction."); | 3454 | ExitOnFailure(hr, "Failed to rollback an elevated MSI transaction."); |
3444 | } | 3455 | } |
3445 | else | 3456 | else |
3446 | { | 3457 | { |
3447 | hr = MsiEngineRollbackTransaction(pRollbackBoundary); | 3458 | hr = MsiEngineRollbackTransaction(pRollbackBoundary, pRestart); |
3448 | } | 3459 | } |
3449 | 3460 | ||
3450 | LExit: | 3461 | LExit: |
@@ -3454,7 +3465,12 @@ LExit: | |||
3454 | 3465 | ||
3455 | if (fRollbackBeginCalled) | 3466 | if (fRollbackBeginCalled) |
3456 | { | 3467 | { |
3457 | UserExperienceOnRollbackMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr); | 3468 | UserExperienceOnRollbackMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr, *pRestart, &action); |
3469 | |||
3470 | if (action == BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART) | ||
3471 | { | ||
3472 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | ||
3473 | } | ||
3458 | } | 3474 | } |
3459 | 3475 | ||
3460 | return hr; | 3476 | return hr; |
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index 154c407d..63a76c2c 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
@@ -371,12 +371,14 @@ static HRESULT OnMsiBeginTransaction( | |||
371 | static HRESULT OnMsiCommitTransaction( | 371 | static HRESULT OnMsiCommitTransaction( |
372 | __in BURN_PACKAGES* pPackages, | 372 | __in BURN_PACKAGES* pPackages, |
373 | __in BYTE* pbData, | 373 | __in BYTE* pbData, |
374 | __in SIZE_T cbData | 374 | __in SIZE_T cbData, |
375 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
375 | ); | 376 | ); |
376 | static HRESULT OnMsiRollbackTransaction( | 377 | static HRESULT OnMsiRollbackTransaction( |
377 | __in BURN_PACKAGES* pPackages, | 378 | __in BURN_PACKAGES* pPackages, |
378 | __in BYTE* pbData, | 379 | __in BYTE* pbData, |
379 | __in SIZE_T cbData | 380 | __in SIZE_T cbData, |
381 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
380 | ); | 382 | ); |
381 | static HRESULT ElevatedOnPauseAUBegin( | 383 | static HRESULT ElevatedOnPauseAUBegin( |
382 | __in HANDLE hPipe | 384 | __in HANDLE hPipe |
@@ -496,7 +498,7 @@ extern "C" HRESULT ElevationApplyInitialize( | |||
496 | 498 | ||
497 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)!pPlan->pInternalCommand->fDisableSystemRestore); | 499 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)!pPlan->pInternalCommand->fDisableSystemRestore); |
498 | ExitOnFailure(hr, "Failed to write system restore point action to message buffer."); | 500 | ExitOnFailure(hr, "Failed to write system restore point action to message buffer."); |
499 | 501 | ||
500 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); | 502 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); |
501 | ExitOnFailure(hr, "Failed to write variables."); | 503 | ExitOnFailure(hr, "Failed to write variables."); |
502 | 504 | ||
@@ -544,7 +546,7 @@ LExit: | |||
544 | } | 546 | } |
545 | 547 | ||
546 | /******************************************************************* | 548 | /******************************************************************* |
547 | ElevationSessionBegin - | 549 | ElevationSessionBegin - |
548 | 550 | ||
549 | *******************************************************************/ | 551 | *******************************************************************/ |
550 | extern "C" HRESULT ElevationSessionBegin( | 552 | extern "C" HRESULT ElevationSessionBegin( |
@@ -602,7 +604,7 @@ LExit: | |||
602 | } | 604 | } |
603 | 605 | ||
604 | /******************************************************************* | 606 | /******************************************************************* |
605 | ElevationSessionEnd - | 607 | ElevationSessionEnd - |
606 | 608 | ||
607 | *******************************************************************/ | 609 | *******************************************************************/ |
608 | extern "C" HRESULT ElevationSessionEnd( | 610 | extern "C" HRESULT ElevationSessionEnd( |
@@ -648,7 +650,7 @@ LExit: | |||
648 | } | 650 | } |
649 | 651 | ||
650 | /******************************************************************* | 652 | /******************************************************************* |
651 | ElevationSaveState - | 653 | ElevationSaveState - |
652 | 654 | ||
653 | *******************************************************************/ | 655 | *******************************************************************/ |
654 | HRESULT ElevationSaveState( | 656 | HRESULT ElevationSaveState( |
@@ -697,7 +699,7 @@ LExit: | |||
697 | } | 699 | } |
698 | 700 | ||
699 | /******************************************************************* | 701 | /******************************************************************* |
700 | ElevationCacheCompletePayload - | 702 | ElevationCacheCompletePayload - |
701 | 703 | ||
702 | *******************************************************************/ | 704 | *******************************************************************/ |
703 | extern "C" HRESULT ElevationCacheCompletePayload( | 705 | extern "C" HRESULT ElevationCacheCompletePayload( |
@@ -785,7 +787,7 @@ LExit: | |||
785 | } | 787 | } |
786 | 788 | ||
787 | /******************************************************************* | 789 | /******************************************************************* |
788 | ElevationCacheCleanup - | 790 | ElevationCacheCleanup - |
789 | 791 | ||
790 | *******************************************************************/ | 792 | *******************************************************************/ |
791 | extern "C" HRESULT ElevationCacheCleanup( | 793 | extern "C" HRESULT ElevationCacheCleanup( |
@@ -838,7 +840,7 @@ LExit: | |||
838 | } | 840 | } |
839 | 841 | ||
840 | /******************************************************************* | 842 | /******************************************************************* |
841 | ElevationExecuteRelatedBundle - | 843 | ElevationExecuteRelatedBundle - |
842 | 844 | ||
843 | *******************************************************************/ | 845 | *******************************************************************/ |
844 | extern "C" HRESULT ElevationExecuteRelatedBundle( | 846 | extern "C" HRESULT ElevationExecuteRelatedBundle( |
@@ -899,7 +901,7 @@ LExit: | |||
899 | } | 901 | } |
900 | 902 | ||
901 | /******************************************************************* | 903 | /******************************************************************* |
902 | ElevationExecuteBundlePackage - | 904 | ElevationExecuteBundlePackage - |
903 | 905 | ||
904 | *******************************************************************/ | 906 | *******************************************************************/ |
905 | extern "C" HRESULT ElevationExecuteBundlePackage( | 907 | extern "C" HRESULT ElevationExecuteBundlePackage( |
@@ -963,7 +965,7 @@ LExit: | |||
963 | } | 965 | } |
964 | 966 | ||
965 | /******************************************************************* | 967 | /******************************************************************* |
966 | ElevationExecuteExePackage - | 968 | ElevationExecuteExePackage - |
967 | 969 | ||
968 | *******************************************************************/ | 970 | *******************************************************************/ |
969 | extern "C" HRESULT ElevationExecuteExePackage( | 971 | extern "C" HRESULT ElevationExecuteExePackage( |
@@ -1047,12 +1049,16 @@ LExit: | |||
1047 | 1049 | ||
1048 | extern "C" HRESULT ElevationMsiCommitTransaction( | 1050 | extern "C" HRESULT ElevationMsiCommitTransaction( |
1049 | __in HANDLE hPipe, | 1051 | __in HANDLE hPipe, |
1050 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1052 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
1053 | __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler, | ||
1054 | __in LPVOID pvContext, | ||
1055 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
1051 | ) | 1056 | ) |
1052 | { | 1057 | { |
1053 | HRESULT hr = S_OK; | 1058 | HRESULT hr = S_OK; |
1054 | BYTE* pbData = NULL; | 1059 | BYTE* pbData = NULL; |
1055 | SIZE_T cbData = 0; | 1060 | SIZE_T cbData = 0; |
1061 | BURN_ELEVATION_MSI_MESSAGE_CONTEXT context = { }; | ||
1056 | DWORD dwResult = ERROR_SUCCESS; | 1062 | DWORD dwResult = ERROR_SUCCESS; |
1057 | 1063 | ||
1058 | // serialize message data | 1064 | // serialize message data |
@@ -1062,10 +1068,15 @@ extern "C" HRESULT ElevationMsiCommitTransaction( | |||
1062 | hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); | 1068 | hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); |
1063 | ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); | 1069 | ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); |
1064 | 1070 | ||
1065 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION, pbData, cbData, NULL, NULL, &dwResult); | 1071 | // send message |
1072 | context.pfnMessageHandler = pfnMessageHandler; | ||
1073 | context.pvContext = pvContext; | ||
1074 | |||
1075 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); | ||
1066 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION message to per-machine process."); | 1076 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION message to per-machine process."); |
1067 | 1077 | ||
1068 | hr = static_cast<HRESULT>(dwResult); | 1078 | hr = static_cast<HRESULT>(dwResult); |
1079 | *pRestart = context.restart; | ||
1069 | 1080 | ||
1070 | LExit: | 1081 | LExit: |
1071 | ReleaseBuffer(pbData); | 1082 | ReleaseBuffer(pbData); |
@@ -1075,12 +1086,16 @@ LExit: | |||
1075 | 1086 | ||
1076 | extern "C" HRESULT ElevationMsiRollbackTransaction( | 1087 | extern "C" HRESULT ElevationMsiRollbackTransaction( |
1077 | __in HANDLE hPipe, | 1088 | __in HANDLE hPipe, |
1078 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1089 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
1090 | __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler, | ||
1091 | __in LPVOID pvContext, | ||
1092 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
1079 | ) | 1093 | ) |
1080 | { | 1094 | { |
1081 | HRESULT hr = S_OK; | 1095 | HRESULT hr = S_OK; |
1082 | BYTE* pbData = NULL; | 1096 | BYTE* pbData = NULL; |
1083 | SIZE_T cbData = 0; | 1097 | SIZE_T cbData = 0; |
1098 | BURN_ELEVATION_MSI_MESSAGE_CONTEXT context = { }; | ||
1084 | DWORD dwResult = ERROR_SUCCESS; | 1099 | DWORD dwResult = ERROR_SUCCESS; |
1085 | 1100 | ||
1086 | // serialize message data | 1101 | // serialize message data |
@@ -1090,10 +1105,15 @@ extern "C" HRESULT ElevationMsiRollbackTransaction( | |||
1090 | hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); | 1105 | hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); |
1091 | ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); | 1106 | ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); |
1092 | 1107 | ||
1093 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION, pbData, cbData, NULL, NULL, &dwResult); | 1108 | // send message |
1109 | context.pfnMessageHandler = pfnMessageHandler; | ||
1110 | context.pvContext = pvContext; | ||
1111 | |||
1112 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); | ||
1094 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION message to per-machine process."); | 1113 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION message to per-machine process."); |
1095 | 1114 | ||
1096 | hr = static_cast<HRESULT>(dwResult); | 1115 | hr = static_cast<HRESULT>(dwResult); |
1116 | *pRestart = context.restart; | ||
1097 | 1117 | ||
1098 | LExit: | 1118 | LExit: |
1099 | ReleaseBuffer(pbData); | 1119 | ReleaseBuffer(pbData); |
@@ -1104,7 +1124,7 @@ LExit: | |||
1104 | 1124 | ||
1105 | 1125 | ||
1106 | /******************************************************************* | 1126 | /******************************************************************* |
1107 | ElevationExecuteMsiPackage - | 1127 | ElevationExecuteMsiPackage - |
1108 | 1128 | ||
1109 | *******************************************************************/ | 1129 | *******************************************************************/ |
1110 | extern "C" HRESULT ElevationExecuteMsiPackage( | 1130 | extern "C" HRESULT ElevationExecuteMsiPackage( |
@@ -1189,7 +1209,7 @@ LExit: | |||
1189 | } | 1209 | } |
1190 | 1210 | ||
1191 | /******************************************************************* | 1211 | /******************************************************************* |
1192 | ElevationExecuteMspPackage - | 1212 | ElevationExecuteMspPackage - |
1193 | 1213 | ||
1194 | *******************************************************************/ | 1214 | *******************************************************************/ |
1195 | extern "C" HRESULT ElevationExecuteMspPackage( | 1215 | extern "C" HRESULT ElevationExecuteMspPackage( |
@@ -1269,7 +1289,7 @@ LExit: | |||
1269 | } | 1289 | } |
1270 | 1290 | ||
1271 | /******************************************************************* | 1291 | /******************************************************************* |
1272 | ElevationExecuteMsuPackage - | 1292 | ElevationExecuteMsuPackage - |
1273 | 1293 | ||
1274 | *******************************************************************/ | 1294 | *******************************************************************/ |
1275 | extern "C" HRESULT ElevationExecuteMsuPackage( | 1295 | extern "C" HRESULT ElevationExecuteMsuPackage( |
@@ -1480,7 +1500,7 @@ LExit: | |||
1480 | } | 1500 | } |
1481 | 1501 | ||
1482 | /******************************************************************* | 1502 | /******************************************************************* |
1483 | ElevationCleanPackage - | 1503 | ElevationCleanPackage - |
1484 | 1504 | ||
1485 | *******************************************************************/ | 1505 | *******************************************************************/ |
1486 | extern "C" HRESULT ElevationCleanPackage( | 1506 | extern "C" HRESULT ElevationCleanPackage( |
@@ -1545,7 +1565,7 @@ LExit: | |||
1545 | } | 1565 | } |
1546 | 1566 | ||
1547 | /******************************************************************* | 1567 | /******************************************************************* |
1548 | ElevationChildPumpMessages - | 1568 | ElevationChildPumpMessages - |
1549 | 1569 | ||
1550 | *******************************************************************/ | 1570 | *******************************************************************/ |
1551 | extern "C" HRESULT ElevationChildPumpMessages( | 1571 | extern "C" HRESULT ElevationChildPumpMessages( |
@@ -1875,7 +1895,7 @@ static HRESULT ProcessGenericExecuteMessages( | |||
1875 | 1895 | ||
1876 | hr = BuffReadNumber((BYTE*)pMsg->pvData, pMsg->cbData, &iData, &message.dwUIHint); | 1896 | hr = BuffReadNumber((BYTE*)pMsg->pvData, pMsg->cbData, &iData, &message.dwUIHint); |
1877 | ExitOnFailure(hr, "Failed to allowed results."); | 1897 | ExitOnFailure(hr, "Failed to allowed results."); |
1878 | 1898 | ||
1879 | // Process the message. | 1899 | // Process the message. |
1880 | switch (pMsg->dwMessage) | 1900 | switch (pMsg->dwMessage) |
1881 | { | 1901 | { |
@@ -2052,7 +2072,7 @@ static HRESULT ProcessMsiPackageMessages( | |||
2052 | ExitOnRootFailure(hr, "Invalid package message."); | 2072 | ExitOnRootFailure(hr, "Invalid package message."); |
2053 | break; | 2073 | break; |
2054 | } | 2074 | } |
2055 | 2075 | ||
2056 | // send message | 2076 | // send message |
2057 | *pdwResult = (DWORD)pContext->pfnMessageHandler(&message, pContext->pvContext); | 2077 | *pdwResult = (DWORD)pContext->pfnMessageHandler(&message, pContext->pvContext); |
2058 | 2078 | ||
@@ -2154,11 +2174,13 @@ static HRESULT ProcessElevatedChildMessage( | |||
2154 | break; | 2174 | break; |
2155 | 2175 | ||
2156 | case BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION: | 2176 | case BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION: |
2157 | hrResult = OnMsiCommitTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); | 2177 | hrResult = OnMsiCommitTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData, &restart); |
2178 | fSendRestart = TRUE; | ||
2158 | break; | 2179 | break; |
2159 | 2180 | ||
2160 | case BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION: | 2181 | case BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION: |
2161 | hrResult = OnMsiRollbackTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); | 2182 | hrResult = OnMsiRollbackTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData, &restart); |
2183 | fSendRestart = TRUE; | ||
2162 | break; | 2184 | break; |
2163 | 2185 | ||
2164 | case BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE: | 2186 | case BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE: |
@@ -3922,7 +3944,8 @@ LExit: | |||
3922 | static HRESULT OnMsiCommitTransaction( | 3944 | static HRESULT OnMsiCommitTransaction( |
3923 | __in BURN_PACKAGES* pPackages, | 3945 | __in BURN_PACKAGES* pPackages, |
3924 | __in BYTE* pbData, | 3946 | __in BYTE* pbData, |
3925 | __in SIZE_T cbData | 3947 | __in SIZE_T cbData, |
3948 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
3926 | ) | 3949 | ) |
3927 | { | 3950 | { |
3928 | HRESULT hr = S_OK; | 3951 | HRESULT hr = S_OK; |
@@ -3946,7 +3969,7 @@ static HRESULT OnMsiCommitTransaction( | |||
3946 | pRollbackBoundary->sczLogPath = sczLogPath; | 3969 | pRollbackBoundary->sczLogPath = sczLogPath; |
3947 | } | 3970 | } |
3948 | 3971 | ||
3949 | hr = MsiEngineCommitTransaction(pRollbackBoundary); | 3972 | hr = MsiEngineCommitTransaction(pRollbackBoundary, pRestart); |
3950 | 3973 | ||
3951 | LExit: | 3974 | LExit: |
3952 | ReleaseStr(sczId); | 3975 | ReleaseStr(sczId); |
@@ -3963,7 +3986,8 @@ LExit: | |||
3963 | static HRESULT OnMsiRollbackTransaction( | 3986 | static HRESULT OnMsiRollbackTransaction( |
3964 | __in BURN_PACKAGES* pPackages, | 3987 | __in BURN_PACKAGES* pPackages, |
3965 | __in BYTE* pbData, | 3988 | __in BYTE* pbData, |
3966 | __in SIZE_T cbData | 3989 | __in SIZE_T cbData, |
3990 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
3967 | ) | 3991 | ) |
3968 | { | 3992 | { |
3969 | HRESULT hr = S_OK; | 3993 | HRESULT hr = S_OK; |
@@ -3987,7 +4011,7 @@ static HRESULT OnMsiRollbackTransaction( | |||
3987 | pRollbackBoundary->sczLogPath = sczLogPath; | 4011 | pRollbackBoundary->sczLogPath = sczLogPath; |
3988 | } | 4012 | } |
3989 | 4013 | ||
3990 | hr = MsiEngineRollbackTransaction(pRollbackBoundary); | 4014 | hr = MsiEngineRollbackTransaction(pRollbackBoundary, pRestart); |
3991 | 4015 | ||
3992 | LExit: | 4016 | LExit: |
3993 | ReleaseStr(sczId); | 4017 | ReleaseStr(sczId); |
diff --git a/src/burn/engine/elevation.h b/src/burn/engine/elevation.h index 810287a3..02019977 100644 --- a/src/burn/engine/elevation.h +++ b/src/burn/engine/elevation.h | |||
@@ -191,11 +191,17 @@ HRESULT ElevationMsiBeginTransaction( | |||
191 | ); | 191 | ); |
192 | HRESULT ElevationMsiCommitTransaction( | 192 | HRESULT ElevationMsiCommitTransaction( |
193 | __in HANDLE hPipe, | 193 | __in HANDLE hPipe, |
194 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 194 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
195 | __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler, | ||
196 | __in LPVOID pvContext, | ||
197 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
195 | ); | 198 | ); |
196 | HRESULT ElevationMsiRollbackTransaction( | 199 | HRESULT ElevationMsiRollbackTransaction( |
197 | __in HANDLE hPipe, | 200 | __in HANDLE hPipe, |
198 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 201 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
202 | __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler, | ||
203 | __in LPVOID pvContext, | ||
204 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
199 | ); | 205 | ); |
200 | 206 | ||
201 | #ifdef __cplusplus | 207 | #ifdef __cplusplus |
diff --git a/src/burn/engine/msiengine.cpp b/src/burn/engine/msiengine.cpp index 2c1b0d4f..fec995e0 100644 --- a/src/burn/engine/msiengine.cpp +++ b/src/burn/engine/msiengine.cpp | |||
@@ -1139,33 +1139,65 @@ LExit: | |||
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | extern "C" HRESULT MsiEngineCommitTransaction( | 1141 | extern "C" HRESULT MsiEngineCommitTransaction( |
1142 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1142 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
1143 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
1143 | ) | 1144 | ) |
1144 | { | 1145 | { |
1145 | HRESULT hr = S_OK; | 1146 | HRESULT hr = S_OK; |
1147 | WIU_RESTART restart = WIU_RESTART_NONE; | ||
1146 | 1148 | ||
1147 | LogId(REPORT_STANDARD, MSG_MSI_TRANSACTION_COMMIT, pRollbackBoundary->sczId); | 1149 | LogId(REPORT_STANDARD, MSG_MSI_TRANSACTION_COMMIT, pRollbackBoundary->sczId); |
1148 | 1150 | ||
1149 | hr = WiuEndTransaction(MSITRANSACTIONSTATE_COMMIT, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, pRollbackBoundary->sczLogPath); | 1151 | hr = WiuEndTransaction(MSITRANSACTIONSTATE_COMMIT, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, pRollbackBoundary->sczLogPath, &restart); |
1150 | ExitOnFailure(hr, "Failed to commit the MSI transaction"); | 1152 | ExitOnFailure(hr, "Failed to commit the MSI transaction"); |
1151 | 1153 | ||
1152 | LExit: | 1154 | LExit: |
1155 | switch (restart) | ||
1156 | { | ||
1157 | case WIU_RESTART_NONE: | ||
1158 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_NONE; | ||
1159 | break; | ||
1160 | |||
1161 | case WIU_RESTART_REQUIRED: | ||
1162 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_REQUIRED; | ||
1163 | break; | ||
1164 | |||
1165 | case WIU_RESTART_INITIATED: | ||
1166 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | ||
1167 | break; | ||
1168 | } | ||
1153 | 1169 | ||
1154 | return hr; | 1170 | return hr; |
1155 | } | 1171 | } |
1156 | 1172 | ||
1157 | extern "C" HRESULT MsiEngineRollbackTransaction( | 1173 | extern "C" HRESULT MsiEngineRollbackTransaction( |
1158 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1174 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
1175 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
1159 | ) | 1176 | ) |
1160 | { | 1177 | { |
1161 | HRESULT hr = S_OK; | 1178 | HRESULT hr = S_OK; |
1179 | WIU_RESTART restart = WIU_RESTART_NONE; | ||
1162 | 1180 | ||
1163 | LogId(REPORT_WARNING, MSG_MSI_TRANSACTION_ROLLBACK, pRollbackBoundary->sczId); | 1181 | LogId(REPORT_WARNING, MSG_MSI_TRANSACTION_ROLLBACK, pRollbackBoundary->sczId); |
1164 | 1182 | ||
1165 | hr = WiuEndTransaction(MSITRANSACTIONSTATE_ROLLBACK, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, pRollbackBoundary->sczLogPath); | 1183 | hr = WiuEndTransaction(MSITRANSACTIONSTATE_ROLLBACK, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, pRollbackBoundary->sczLogPath, &restart); |
1166 | ExitOnFailure(hr, "Failed to rollback the MSI transaction"); | 1184 | ExitOnFailure(hr, "Failed to rollback the MSI transaction"); |
1167 | 1185 | ||
1168 | LExit: | 1186 | LExit: |
1187 | switch (restart) | ||
1188 | { | ||
1189 | case WIU_RESTART_NONE: | ||
1190 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_NONE; | ||
1191 | break; | ||
1192 | |||
1193 | case WIU_RESTART_REQUIRED: | ||
1194 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_REQUIRED; | ||
1195 | break; | ||
1196 | |||
1197 | case WIU_RESTART_INITIATED: | ||
1198 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | ||
1199 | break; | ||
1200 | } | ||
1169 | 1201 | ||
1170 | return hr; | 1202 | return hr; |
1171 | } | 1203 | } |
@@ -1246,7 +1278,7 @@ extern "C" HRESULT MsiEngineExecutePackage( | |||
1246 | 1278 | ||
1247 | // Best effort to set the execute package action variable. | 1279 | // Best effort to set the execute package action variable. |
1248 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->msiPackage.action, TRUE); | 1280 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->msiPackage.action, TRUE); |
1249 | 1281 | ||
1250 | // Wire up the external UI handler and logging. | 1282 | // Wire up the external UI handler and logging. |
1251 | if (pExecuteAction->msiPackage.fDisableExternalUiHandler) | 1283 | if (pExecuteAction->msiPackage.fDisableExternalUiHandler) |
1252 | { | 1284 | { |
diff --git a/src/burn/engine/msiengine.h b/src/burn/engine/msiengine.h index bc356fab..862c4f6a 100644 --- a/src/burn/engine/msiengine.h +++ b/src/burn/engine/msiengine.h | |||
@@ -60,10 +60,12 @@ HRESULT MsiEngineBeginTransaction( | |||
60 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 60 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary |
61 | ); | 61 | ); |
62 | HRESULT MsiEngineCommitTransaction( | 62 | HRESULT MsiEngineCommitTransaction( |
63 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 63 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
64 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
64 | ); | 65 | ); |
65 | HRESULT MsiEngineRollbackTransaction( | 66 | HRESULT MsiEngineRollbackTransaction( |
66 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 67 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
68 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
67 | ); | 69 | ); |
68 | HRESULT MsiEngineExecutePackage( | 70 | HRESULT MsiEngineExecutePackage( |
69 | __in_opt HWND hwndParent, | 71 | __in_opt HWND hwndParent, |
diff --git a/src/burn/engine/userexperience.cpp b/src/burn/engine/userexperience.cpp index 28429394..372ca901 100644 --- a/src/burn/engine/userexperience.cpp +++ b/src/burn/engine/userexperience.cpp | |||
@@ -35,7 +35,7 @@ static HRESULT SendBAMessageFromInactiveEngine( | |||
35 | // function definitions | 35 | // function definitions |
36 | 36 | ||
37 | /******************************************************************* | 37 | /******************************************************************* |
38 | UserExperienceParseFromXml - | 38 | UserExperienceParseFromXml - |
39 | 39 | ||
40 | *******************************************************************/ | 40 | *******************************************************************/ |
41 | extern "C" HRESULT UserExperienceParseFromXml( | 41 | extern "C" HRESULT UserExperienceParseFromXml( |
@@ -72,7 +72,7 @@ LExit: | |||
72 | } | 72 | } |
73 | 73 | ||
74 | /******************************************************************* | 74 | /******************************************************************* |
75 | UserExperienceUninitialize - | 75 | UserExperienceUninitialize - |
76 | 76 | ||
77 | *******************************************************************/ | 77 | *******************************************************************/ |
78 | extern "C" void UserExperienceUninitialize( | 78 | extern "C" void UserExperienceUninitialize( |
@@ -87,7 +87,7 @@ extern "C" void UserExperienceUninitialize( | |||
87 | } | 87 | } |
88 | 88 | ||
89 | /******************************************************************* | 89 | /******************************************************************* |
90 | UserExperienceLoad - | 90 | UserExperienceLoad - |
91 | 91 | ||
92 | *******************************************************************/ | 92 | *******************************************************************/ |
93 | extern "C" HRESULT UserExperienceLoad( | 93 | extern "C" HRESULT UserExperienceLoad( |
@@ -129,7 +129,7 @@ LExit: | |||
129 | } | 129 | } |
130 | 130 | ||
131 | /******************************************************************* | 131 | /******************************************************************* |
132 | UserExperienceUnload - | 132 | UserExperienceUnload - |
133 | 133 | ||
134 | *******************************************************************/ | 134 | *******************************************************************/ |
135 | extern "C" HRESULT UserExperienceUnload( | 135 | extern "C" HRESULT UserExperienceUnload( |
@@ -380,7 +380,7 @@ EXTERN_C BAAPI UserExperienceOnBeginMsiTransactionBegin( | |||
380 | args.wzTransactionId = wzTransactionId; | 380 | args.wzTransactionId = wzTransactionId; |
381 | 381 | ||
382 | results.cbSize = sizeof(results); | 382 | results.cbSize = sizeof(results); |
383 | 383 | ||
384 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, &args, &results); | 384 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, &args, &results); |
385 | ExitOnFailure(hr, "BA OnBeginMsiTransactionBegin failed."); | 385 | ExitOnFailure(hr, "BA OnBeginMsiTransactionBegin failed."); |
386 | 386 | ||
@@ -1017,7 +1017,7 @@ EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionBegin( | |||
1017 | args.wzTransactionId = wzTransactionId; | 1017 | args.wzTransactionId = wzTransactionId; |
1018 | 1018 | ||
1019 | results.cbSize = sizeof(results); | 1019 | results.cbSize = sizeof(results); |
1020 | 1020 | ||
1021 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, &args, &results); | 1021 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, &args, &results); |
1022 | ExitOnFailure(hr, "BA OnCommitMsiTransactionBegin failed."); | 1022 | ExitOnFailure(hr, "BA OnCommitMsiTransactionBegin failed."); |
1023 | 1023 | ||
@@ -1033,8 +1033,10 @@ LExit: | |||
1033 | EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete( | 1033 | EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete( |
1034 | __in BURN_USER_EXPERIENCE* pUserExperience, | 1034 | __in BURN_USER_EXPERIENCE* pUserExperience, |
1035 | __in LPCWSTR wzTransactionId, | 1035 | __in LPCWSTR wzTransactionId, |
1036 | __in HRESULT hrStatus | 1036 | __in HRESULT hrStatus, |
1037 | ) | 1037 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
1038 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction | ||
1039 | ) | ||
1038 | { | 1040 | { |
1039 | HRESULT hr = S_OK; | 1041 | HRESULT hr = S_OK; |
1040 | BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS args = { }; | 1042 | BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS args = { }; |
@@ -1043,12 +1045,17 @@ EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete( | |||
1043 | args.cbSize = sizeof(args); | 1045 | args.cbSize = sizeof(args); |
1044 | args.wzTransactionId = wzTransactionId; | 1046 | args.wzTransactionId = wzTransactionId; |
1045 | args.hrStatus = hrStatus; | 1047 | args.hrStatus = hrStatus; |
1048 | args.restart = restart; | ||
1049 | args.recommendation = *pAction; | ||
1046 | 1050 | ||
1047 | results.cbSize = sizeof(results); | 1051 | results.cbSize = sizeof(results); |
1052 | results.action = *pAction; | ||
1048 | 1053 | ||
1049 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, &args, &results); | 1054 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, &args, &results); |
1050 | ExitOnFailure(hr, "BA OnCommitMsiTransactionComplete failed."); | 1055 | ExitOnFailure(hr, "BA OnCommitMsiTransactionComplete failed."); |
1051 | 1056 | ||
1057 | *pAction = results.action; | ||
1058 | |||
1052 | LExit: | 1059 | LExit: |
1053 | return hr; | 1060 | return hr; |
1054 | } | 1061 | } |
@@ -1908,7 +1915,7 @@ EXTERN_C BAAPI UserExperienceOnPauseAUBegin( | |||
1908 | args.cbSize = sizeof(args); | 1915 | args.cbSize = sizeof(args); |
1909 | 1916 | ||
1910 | results.cbSize = sizeof(results); | 1917 | results.cbSize = sizeof(results); |
1911 | 1918 | ||
1912 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, &args, &results); | 1919 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, &args, &results); |
1913 | ExitOnFailure(hr, "BA OnPauseAUBegin failed."); | 1920 | ExitOnFailure(hr, "BA OnPauseAUBegin failed."); |
1914 | 1921 | ||
@@ -2523,7 +2530,7 @@ EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionBegin( | |||
2523 | args.wzTransactionId = wzTransactionId; | 2530 | args.wzTransactionId = wzTransactionId; |
2524 | 2531 | ||
2525 | results.cbSize = sizeof(results); | 2532 | results.cbSize = sizeof(results); |
2526 | 2533 | ||
2527 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, &args, &results); | 2534 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, &args, &results); |
2528 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionBegin failed."); | 2535 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionBegin failed."); |
2529 | 2536 | ||
@@ -2534,7 +2541,9 @@ LExit: | |||
2534 | EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete( | 2541 | EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete( |
2535 | __in BURN_USER_EXPERIENCE* pUserExperience, | 2542 | __in BURN_USER_EXPERIENCE* pUserExperience, |
2536 | __in LPCWSTR wzTransactionId, | 2543 | __in LPCWSTR wzTransactionId, |
2537 | __in HRESULT hrStatus | 2544 | __in HRESULT hrStatus, |
2545 | __in BOOTSTRAPPER_APPLY_RESTART restart, | ||
2546 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION *pAction | ||
2538 | ) | 2547 | ) |
2539 | { | 2548 | { |
2540 | HRESULT hr = S_OK; | 2549 | HRESULT hr = S_OK; |
@@ -2544,12 +2553,17 @@ EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete( | |||
2544 | args.cbSize = sizeof(args); | 2553 | args.cbSize = sizeof(args); |
2545 | args.wzTransactionId = wzTransactionId; | 2554 | args.wzTransactionId = wzTransactionId; |
2546 | args.hrStatus = hrStatus; | 2555 | args.hrStatus = hrStatus; |
2556 | args.restart = restart; | ||
2557 | args.recommendation = *pAction; | ||
2547 | 2558 | ||
2548 | results.cbSize = sizeof(results); | 2559 | results.cbSize = sizeof(results); |
2560 | results.action = *pAction; | ||
2549 | 2561 | ||
2550 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, &args, &results); | 2562 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, &args, &results); |
2551 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionComplete failed."); | 2563 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionComplete failed."); |
2552 | 2564 | ||
2565 | *pAction = results.action; | ||
2566 | |||
2553 | LExit: | 2567 | LExit: |
2554 | return hr; | 2568 | return hr; |
2555 | } | 2569 | } |
@@ -2651,7 +2665,7 @@ EXTERN_C BAAPI UserExperienceOnSystemRestorePointBegin( | |||
2651 | args.cbSize = sizeof(args); | 2665 | args.cbSize = sizeof(args); |
2652 | 2666 | ||
2653 | results.cbSize = sizeof(results); | 2667 | results.cbSize = sizeof(results); |
2654 | 2668 | ||
2655 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, &args, &results); | 2669 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, &args, &results); |
2656 | ExitOnFailure(hr, "BA OnSystemRestorePointBegin failed."); | 2670 | ExitOnFailure(hr, "BA OnSystemRestorePointBegin failed."); |
2657 | 2671 | ||
diff --git a/src/burn/engine/userexperience.h b/src/burn/engine/userexperience.h index e342da03..4f15c5d7 100644 --- a/src/burn/engine/userexperience.h +++ b/src/burn/engine/userexperience.h | |||
@@ -251,8 +251,10 @@ BAAPI UserExperienceOnCommitMsiTransactionBegin( | |||
251 | BAAPI UserExperienceOnCommitMsiTransactionComplete( | 251 | BAAPI UserExperienceOnCommitMsiTransactionComplete( |
252 | __in BURN_USER_EXPERIENCE* pUserExperience, | 252 | __in BURN_USER_EXPERIENCE* pUserExperience, |
253 | __in LPCWSTR wzTransactionId, | 253 | __in LPCWSTR wzTransactionId, |
254 | __in HRESULT hrStatus | 254 | __in HRESULT hrStatus, |
255 | ); | 255 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
256 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction | ||
257 | ); | ||
256 | BAAPI UserExperienceOnDetectBegin( | 258 | BAAPI UserExperienceOnDetectBegin( |
257 | __in BURN_USER_EXPERIENCE* pUserExperience, | 259 | __in BURN_USER_EXPERIENCE* pUserExperience, |
258 | __in BOOL fCached, | 260 | __in BOOL fCached, |
@@ -567,8 +569,10 @@ BAAPI UserExperienceOnRollbackMsiTransactionBegin( | |||
567 | BAAPI UserExperienceOnRollbackMsiTransactionComplete( | 569 | BAAPI UserExperienceOnRollbackMsiTransactionComplete( |
568 | __in BURN_USER_EXPERIENCE* pUserExperience, | 570 | __in BURN_USER_EXPERIENCE* pUserExperience, |
569 | __in LPCWSTR wzTransactionId, | 571 | __in LPCWSTR wzTransactionId, |
570 | __in HRESULT hrStatus | 572 | __in HRESULT hrStatus, |
571 | ); | 573 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
574 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction | ||
575 | ); | ||
572 | BAAPI UserExperienceOnSetUpdateBegin( | 576 | BAAPI UserExperienceOnSetUpdateBegin( |
573 | __in BURN_USER_EXPERIENCE* pUserExperience | 577 | __in BURN_USER_EXPERIENCE* pUserExperience |
574 | ); | 578 | ); |
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h b/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h index 0ddcd893..71f40e8a 100644 --- a/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h +++ b/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h | |||
@@ -392,7 +392,8 @@ HRESULT DAPI WiuBeginTransaction( | |||
392 | HRESULT DAPI WiuEndTransaction( | 392 | HRESULT DAPI WiuEndTransaction( |
393 | __in DWORD dwTransactionState, | 393 | __in DWORD dwTransactionState, |
394 | __in DWORD dwLogMode, | 394 | __in DWORD dwLogMode, |
395 | __in_z LPCWSTR szLogPath | 395 | __in_z LPCWSTR szLogPath, |
396 | __out WIU_RESTART *pRestart | ||
396 | ); | 397 | ); |
397 | BOOL DAPI WiuIsMsiTransactionSupported( | 398 | BOOL DAPI WiuIsMsiTransactionSupported( |
398 | ); | 399 | ); |
diff --git a/src/libs/dutil/WixToolset.DUtil/wiutil.cpp b/src/libs/dutil/WixToolset.DUtil/wiutil.cpp index 4ed0e2c5..dac57a3d 100644 --- a/src/libs/dutil/WixToolset.DUtil/wiutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/wiutil.cpp | |||
@@ -317,7 +317,7 @@ extern "C" HRESULT DAPI WiuGetComponentPath( | |||
317 | } | 317 | } |
318 | 318 | ||
319 | // If the actual path length is greater than or equal to the original buffer | 319 | // If the actual path length is greater than or equal to the original buffer |
320 | // allocate a larger buffer and get the path again, just in case we are | 320 | // allocate a larger buffer and get the path again, just in case we are |
321 | // missing any part of the path. | 321 | // missing any part of the path. |
322 | if (cchCompare <= cch) | 322 | if (cchCompare <= cch) |
323 | { | 323 | { |
@@ -369,7 +369,7 @@ extern "C" HRESULT DAPI WiuLocateComponent( | |||
369 | } | 369 | } |
370 | 370 | ||
371 | // If the actual path length is greater than or equal to the original buffer | 371 | // If the actual path length is greater than or equal to the original buffer |
372 | // allocate a larger buffer and get the path again, just in case we are | 372 | // allocate a larger buffer and get the path again, just in case we are |
373 | // missing any part of the path. | 373 | // missing any part of the path. |
374 | if (cchCompare <= cch) | 374 | if (cchCompare <= cch) |
375 | { | 375 | { |
@@ -993,7 +993,8 @@ LExit: | |||
993 | extern "C" HRESULT DAPI WiuEndTransaction( | 993 | extern "C" HRESULT DAPI WiuEndTransaction( |
994 | __in DWORD dwTransactionState, | 994 | __in DWORD dwTransactionState, |
995 | __in DWORD dwLogMode, | 995 | __in DWORD dwLogMode, |
996 | __in_z LPCWSTR szLogPath | 996 | __in_z LPCWSTR szLogPath, |
997 | __out WIU_RESTART *pRestart | ||
997 | ) | 998 | ) |
998 | { | 999 | { |
999 | HRESULT hr = S_OK; | 1000 | HRESULT hr = S_OK; |
@@ -1008,6 +1009,7 @@ extern "C" HRESULT DAPI WiuEndTransaction( | |||
1008 | WiuExitOnFailure(hr, "Failed to enable logging for MSI transaction"); | 1009 | WiuExitOnFailure(hr, "Failed to enable logging for MSI transaction"); |
1009 | 1010 | ||
1010 | er = vpfnMsiEndTransaction(dwTransactionState); | 1011 | er = vpfnMsiEndTransaction(dwTransactionState); |
1012 | er = CheckForRestartErrorCode(er, pRestart); | ||
1011 | WiuExitOnWin32Error(er, hr, "Failed to end transaction."); | 1013 | WiuExitOnWin32Error(er, hr, "Failed to end transaction."); |
1012 | 1014 | ||
1013 | LExit: | 1015 | LExit: |