diff options
Diffstat (limited to 'src/api/burn')
8 files changed, 86 insertions, 49 deletions
diff --git a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h index 2a6d5c8a..56f6b361 100644 --- a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h +++ b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h | |||
@@ -20,6 +20,13 @@ enum BOOTSTRAPPER_RESTART | |||
20 | BOOTSTRAPPER_RESTART_ALWAYS, | 20 | BOOTSTRAPPER_RESTART_ALWAYS, |
21 | }; | 21 | }; |
22 | 22 | ||
23 | enum BOOTSTRAPPER_REGISTRATION_TYPE | ||
24 | { | ||
25 | BOOTSTRAPPER_REGISTRATION_TYPE_NONE, // The engine will ignore NONE if it recommended INPROGRESS or FULL. | ||
26 | BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS, | ||
27 | BOOTSTRAPPER_REGISTRATION_TYPE_FULL, | ||
28 | }; | ||
29 | |||
23 | enum BOOTSTRAPPER_RESUME_TYPE | 30 | enum BOOTSTRAPPER_RESUME_TYPE |
24 | { | 31 | { |
25 | BOOTSTRAPPER_RESUME_TYPE_NONE, | 32 | BOOTSTRAPPER_RESUME_TYPE_NONE, |
@@ -1163,12 +1170,14 @@ struct BA_ONPROGRESS_RESULTS | |||
1163 | struct BA_ONREGISTERBEGIN_ARGS | 1170 | struct BA_ONREGISTERBEGIN_ARGS |
1164 | { | 1171 | { |
1165 | DWORD cbSize; | 1172 | DWORD cbSize; |
1173 | BOOTSTRAPPER_REGISTRATION_TYPE recommendedRegistrationType; | ||
1166 | }; | 1174 | }; |
1167 | 1175 | ||
1168 | struct BA_ONREGISTERBEGIN_RESULTS | 1176 | struct BA_ONREGISTERBEGIN_RESULTS |
1169 | { | 1177 | { |
1170 | DWORD cbSize; | 1178 | DWORD cbSize; |
1171 | BOOL fCancel; | 1179 | BOOL fCancel; |
1180 | BOOTSTRAPPER_REGISTRATION_TYPE registrationType; | ||
1172 | }; | 1181 | }; |
1173 | 1182 | ||
1174 | struct BA_ONREGISTERCOMPLETE_ARGS | 1183 | struct BA_ONREGISTERCOMPLETE_ARGS |
@@ -1262,13 +1271,13 @@ struct BA_ONSYSTEMSHUTDOWN_RESULTS | |||
1262 | struct BA_ONUNREGISTERBEGIN_ARGS | 1271 | struct BA_ONUNREGISTERBEGIN_ARGS |
1263 | { | 1272 | { |
1264 | DWORD cbSize; | 1273 | DWORD cbSize; |
1265 | BOOL fKeepRegistration; | 1274 | BOOTSTRAPPER_REGISTRATION_TYPE recommendedRegistrationType; |
1266 | }; | 1275 | }; |
1267 | 1276 | ||
1268 | struct BA_ONUNREGISTERBEGIN_RESULTS | 1277 | struct BA_ONUNREGISTERBEGIN_RESULTS |
1269 | { | 1278 | { |
1270 | DWORD cbSize; | 1279 | DWORD cbSize; |
1271 | BOOL fForceKeepRegistration; | 1280 | BOOTSTRAPPER_REGISTRATION_TYPE registrationType; |
1272 | }; | 1281 | }; |
1273 | 1282 | ||
1274 | struct BA_ONUNREGISTERCOMPLETE_ARGS | 1283 | struct BA_ONUNREGISTERCOMPLETE_ARGS |
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs index 072d3ef0..d7dbf04c 100644 --- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs | |||
@@ -1490,12 +1490,13 @@ namespace WixToolset.Mba.Core | |||
1490 | return args.HResult; | 1490 | return args.HResult; |
1491 | } | 1491 | } |
1492 | 1492 | ||
1493 | int IBootstrapperApplication.OnRegisterBegin(ref bool fCancel) | 1493 | int IBootstrapperApplication.OnRegisterBegin(RegistrationType recommendedRegistrationType, ref bool fCancel, ref RegistrationType registrationType) |
1494 | { | 1494 | { |
1495 | RegisterBeginEventArgs args = new RegisterBeginEventArgs(fCancel); | 1495 | RegisterBeginEventArgs args = new RegisterBeginEventArgs(recommendedRegistrationType, fCancel, registrationType); |
1496 | this.OnRegisterBegin(args); | 1496 | this.OnRegisterBegin(args); |
1497 | 1497 | ||
1498 | fCancel = args.Cancel; | 1498 | fCancel = args.Cancel; |
1499 | registrationType = args.RegistrationType; | ||
1499 | return args.HResult; | 1500 | return args.HResult; |
1500 | } | 1501 | } |
1501 | 1502 | ||
@@ -1679,12 +1680,12 @@ namespace WixToolset.Mba.Core | |||
1679 | return args.HResult; | 1680 | return args.HResult; |
1680 | } | 1681 | } |
1681 | 1682 | ||
1682 | int IBootstrapperApplication.OnUnregisterBegin(bool fKeepRegistration, ref bool fForceKeepRegistration) | 1683 | int IBootstrapperApplication.OnUnregisterBegin(RegistrationType recommendedRegistrationType, ref RegistrationType registrationType) |
1683 | { | 1684 | { |
1684 | UnregisterBeginEventArgs args = new UnregisterBeginEventArgs(fKeepRegistration, fForceKeepRegistration); | 1685 | UnregisterBeginEventArgs args = new UnregisterBeginEventArgs(recommendedRegistrationType, registrationType); |
1685 | this.OnUnregisterBegin(args); | 1686 | this.OnUnregisterBegin(args); |
1686 | 1687 | ||
1687 | fForceKeepRegistration = args.ForceKeepRegistration; | 1688 | registrationType = args.RegistrationType; |
1688 | return args.HResult; | 1689 | return args.HResult; |
1689 | } | 1690 | } |
1690 | 1691 | ||
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs index 8ef8af14..00d90c83 100644 --- a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs +++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs | |||
@@ -1184,22 +1184,31 @@ namespace WixToolset.Mba.Core | |||
1184 | public class RegisterBeginEventArgs : CancellableHResultEventArgs | 1184 | public class RegisterBeginEventArgs : CancellableHResultEventArgs |
1185 | { | 1185 | { |
1186 | /// <summary /> | 1186 | /// <summary /> |
1187 | public RegisterBeginEventArgs(bool cancelRecommendation) | 1187 | public RegisterBeginEventArgs(RegistrationType recommendedRegistrationType, bool cancelRecommendation, RegistrationType registrationType) |
1188 | : base(cancelRecommendation) | 1188 | : base(cancelRecommendation) |
1189 | { | 1189 | { |
1190 | this.RecommendedRegistrationType = recommendedRegistrationType; | ||
1191 | this.RegistrationType = registrationType; | ||
1190 | } | 1192 | } |
1193 | |||
1194 | /// <summary> | ||
1195 | /// Gets the recommended registration type. | ||
1196 | /// </summary> | ||
1197 | public RegistrationType RecommendedRegistrationType { get; private set; } | ||
1198 | |||
1199 | /// <summary> | ||
1200 | /// Gets or sets the registration type. | ||
1201 | /// </summary> | ||
1202 | public RegistrationType RegistrationType { get; set; } | ||
1191 | } | 1203 | } |
1192 | 1204 | ||
1193 | /// <summary> | 1205 | /// <summary> |
1194 | /// Additional arguments used when the engine has completed registering the location and visilibity of the bundle. | 1206 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.RegisterComplete"/>. |
1195 | /// </summary> | 1207 | /// </summary> |
1196 | [Serializable] | 1208 | [Serializable] |
1197 | public class RegisterCompleteEventArgs : StatusEventArgs | 1209 | public class RegisterCompleteEventArgs : StatusEventArgs |
1198 | { | 1210 | { |
1199 | /// <summary> | 1211 | /// <summary /> |
1200 | /// Creates a new instance of the <see cref="RegisterCompleteEventArgs"/> class. | ||
1201 | /// </summary> | ||
1202 | /// <param name="hrStatus">The return code of the operation.</param> | ||
1203 | public RegisterCompleteEventArgs(int hrStatus) | 1212 | public RegisterCompleteEventArgs(int hrStatus) |
1204 | : base(hrStatus) | 1213 | : base(hrStatus) |
1205 | { | 1214 | { |
@@ -1212,26 +1221,22 @@ namespace WixToolset.Mba.Core | |||
1212 | [Serializable] | 1221 | [Serializable] |
1213 | public class UnregisterBeginEventArgs : HResultEventArgs | 1222 | public class UnregisterBeginEventArgs : HResultEventArgs |
1214 | { | 1223 | { |
1215 | /// <summary> | 1224 | /// <summary /> |
1216 | /// | 1225 | public UnregisterBeginEventArgs(RegistrationType recommendedRegistrationType, RegistrationType registrationType) |
1217 | /// </summary> | ||
1218 | /// <param name="keepRegistration"></param> | ||
1219 | /// <param name="forceKeepRegistration"></param> | ||
1220 | public UnregisterBeginEventArgs(bool keepRegistration, bool forceKeepRegistration) | ||
1221 | { | 1226 | { |
1222 | this.KeepRegistration = keepRegistration; | 1227 | this.RecommendedRegistrationType = recommendedRegistrationType; |
1223 | this.ForceKeepRegistration = forceKeepRegistration; | 1228 | this.RegistrationType = registrationType; |
1224 | } | 1229 | } |
1225 | 1230 | ||
1226 | /// <summary> | 1231 | /// <summary> |
1227 | /// Indicates whether the engine will uninstall the bundle. | 1232 | /// Gets the recommended registration type. |
1228 | /// </summary> | 1233 | /// </summary> |
1229 | public bool ForceKeepRegistration { get; set; } | 1234 | public RegistrationType RecommendedRegistrationType { get; private set; } |
1230 | 1235 | ||
1231 | /// <summary> | 1236 | /// <summary> |
1232 | /// If <see cref="KeepRegistration"/> is FALSE, then this can be set to TRUE to make the engine keep the bundle installed. | 1237 | /// Gets or sets the registration type. |
1233 | /// </summary> | 1238 | /// </summary> |
1234 | public bool KeepRegistration { get; private set; } | 1239 | public RegistrationType RegistrationType { get; set; } |
1235 | } | 1240 | } |
1236 | 1241 | ||
1237 | /// <summary> | 1242 | /// <summary> |
@@ -1240,10 +1245,7 @@ namespace WixToolset.Mba.Core | |||
1240 | [Serializable] | 1245 | [Serializable] |
1241 | public class UnregisterCompleteEventArgs : StatusEventArgs | 1246 | public class UnregisterCompleteEventArgs : StatusEventArgs |
1242 | { | 1247 | { |
1243 | /// <summary> | 1248 | /// <summary /> |
1244 | /// | ||
1245 | /// </summary> | ||
1246 | /// <param name="hrStatus"></param> | ||
1247 | public UnregisterCompleteEventArgs(int hrStatus) | 1249 | public UnregisterCompleteEventArgs(int hrStatus) |
1248 | : base(hrStatus) | 1250 | : base(hrStatus) |
1249 | { | 1251 | { |
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs index 530fb1a9..e6e03906 100644 --- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs | |||
@@ -500,12 +500,12 @@ namespace WixToolset.Mba.Core | |||
500 | /// <summary> | 500 | /// <summary> |
501 | /// See <see cref="IDefaultBootstrapperApplication.RegisterBegin"/>. | 501 | /// See <see cref="IDefaultBootstrapperApplication.RegisterBegin"/>. |
502 | /// </summary> | 502 | /// </summary> |
503 | /// <param name="fCancel"></param> | ||
504 | /// <returns></returns> | ||
505 | [PreserveSig] | 503 | [PreserveSig] |
506 | [return: MarshalAs(UnmanagedType.I4)] | 504 | [return: MarshalAs(UnmanagedType.I4)] |
507 | int OnRegisterBegin( | 505 | int OnRegisterBegin( |
508 | [MarshalAs(UnmanagedType.Bool)] ref bool fCancel | 506 | [MarshalAs(UnmanagedType.I4)] RegistrationType recommendedRegistrationType, |
507 | [MarshalAs(UnmanagedType.Bool)] ref bool fCancel, | ||
508 | [MarshalAs(UnmanagedType.I4)] ref RegistrationType pRegistrationType | ||
509 | ); | 509 | ); |
510 | 510 | ||
511 | /// <summary> | 511 | /// <summary> |
@@ -820,14 +820,11 @@ namespace WixToolset.Mba.Core | |||
820 | /// <summary> | 820 | /// <summary> |
821 | /// See <see cref="IDefaultBootstrapperApplication.UnregisterBegin"/>. | 821 | /// See <see cref="IDefaultBootstrapperApplication.UnregisterBegin"/>. |
822 | /// </summary> | 822 | /// </summary> |
823 | /// <param name="fKeepRegistration"></param> | ||
824 | /// <param name="fForceKeepRegistration"></param> | ||
825 | /// <returns></returns> | ||
826 | [PreserveSig] | 823 | [PreserveSig] |
827 | [return: MarshalAs(UnmanagedType.I4)] | 824 | [return: MarshalAs(UnmanagedType.I4)] |
828 | int OnUnregisterBegin( | 825 | int OnUnregisterBegin( |
829 | [MarshalAs(UnmanagedType.Bool)] bool fKeepRegistration, | 826 | [MarshalAs(UnmanagedType.I4)] RegistrationType recommendedRegistrationType, |
830 | [MarshalAs(UnmanagedType.Bool)] ref bool fForceKeepRegistration | 827 | [MarshalAs(UnmanagedType.I4)] ref RegistrationType pRegistrationType |
831 | ); | 828 | ); |
832 | 829 | ||
833 | /// <summary> | 830 | /// <summary> |
@@ -1260,6 +1257,28 @@ namespace WixToolset.Mba.Core | |||
1260 | } | 1257 | } |
1261 | 1258 | ||
1262 | /// <summary> | 1259 | /// <summary> |
1260 | /// The display name to use when registering in Add/Remove Programs. | ||
1261 | /// </summary> | ||
1262 | public enum RegistrationType | ||
1263 | { | ||
1264 | /// <summary> | ||
1265 | /// No registration. | ||
1266 | /// The engine will ignore None if it recommended InProgress or Full. | ||
1267 | /// </summary> | ||
1268 | None, | ||
1269 | |||
1270 | /// <summary> | ||
1271 | /// The in-progress display name. | ||
1272 | /// </summary> | ||
1273 | InProgress, | ||
1274 | |||
1275 | /// <summary> | ||
1276 | /// The default display name. | ||
1277 | /// </summary> | ||
1278 | Full, | ||
1279 | } | ||
1280 | |||
1281 | /// <summary> | ||
1263 | /// Result codes (based on Dialog Box Command IDs from WinUser.h). | 1282 | /// Result codes (based on Dialog Box Command IDs from WinUser.h). |
1264 | /// </summary> | 1283 | /// </summary> |
1265 | public enum Result | 1284 | public enum Result |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h index ee2e452f..c5771efc 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h | |||
@@ -379,7 +379,9 @@ public: // IBootstrapperApplication | |||
379 | } | 379 | } |
380 | 380 | ||
381 | virtual STDMETHODIMP OnRegisterBegin( | 381 | virtual STDMETHODIMP OnRegisterBegin( |
382 | __inout BOOL* /*pfCancel*/ | 382 | __in BOOTSTRAPPER_REGISTRATION_TYPE /*recommendedRegistrationType*/, |
383 | __inout BOOL* /*pfCancel*/, | ||
384 | __inout BOOTSTRAPPER_REGISTRATION_TYPE* /*pRegistrationType*/ | ||
383 | ) | 385 | ) |
384 | { | 386 | { |
385 | return S_OK; | 387 | return S_OK; |
@@ -597,8 +599,8 @@ public: // IBootstrapperApplication | |||
597 | } | 599 | } |
598 | 600 | ||
599 | virtual STDMETHODIMP OnUnregisterBegin( | 601 | virtual STDMETHODIMP OnUnregisterBegin( |
600 | __in BOOL /*fKeepRegistration*/, | 602 | __in BOOTSTRAPPER_REGISTRATION_TYPE /*recommendedRegistrationType*/, |
601 | __inout BOOL* /*pfForceKeepRegistration*/ | 603 | __inout BOOTSTRAPPER_REGISTRATION_TYPE* /*pRegistrationType*/ |
602 | ) | 604 | ) |
603 | { | 605 | { |
604 | return S_OK; | 606 | return S_OK; |
diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h index bf21c4a5..393987ba 100644 --- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h | |||
@@ -435,7 +435,9 @@ public: // IBootstrapperApplication | |||
435 | } | 435 | } |
436 | 436 | ||
437 | virtual STDMETHODIMP OnRegisterBegin( | 437 | virtual STDMETHODIMP OnRegisterBegin( |
438 | __inout BOOL* pfCancel | 438 | __in BOOTSTRAPPER_REGISTRATION_TYPE /*recommendedRegistrationType*/, |
439 | __inout BOOL* pfCancel, | ||
440 | __inout BOOTSTRAPPER_REGISTRATION_TYPE* /*pRegistrationType*/ | ||
439 | ) | 441 | ) |
440 | { | 442 | { |
441 | *pfCancel |= CheckCanceled(); | 443 | *pfCancel |= CheckCanceled(); |
@@ -769,8 +771,8 @@ public: // IBootstrapperApplication | |||
769 | } | 771 | } |
770 | 772 | ||
771 | virtual STDMETHODIMP OnUnregisterBegin( | 773 | virtual STDMETHODIMP OnUnregisterBegin( |
772 | __in BOOL /*fKeepRegistration*/, | 774 | __in BOOTSTRAPPER_REGISTRATION_TYPE /*recommendedRegistrationType*/, |
773 | __inout BOOL* /*pfForceKeepRegistration*/ | 775 | __inout BOOTSTRAPPER_REGISTRATION_TYPE* /*pRegistrationType*/ |
774 | ) | 776 | ) |
775 | { | 777 | { |
776 | return S_OK; | 778 | return S_OK; |
diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h index 7fe3ffd8..69031d62 100644 --- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h +++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h | |||
@@ -263,11 +263,11 @@ static HRESULT BalBaseBAProcOnError( | |||
263 | 263 | ||
264 | static HRESULT BalBaseBAProcOnRegisterBegin( | 264 | static HRESULT BalBaseBAProcOnRegisterBegin( |
265 | __in IBootstrapperApplication* pBA, | 265 | __in IBootstrapperApplication* pBA, |
266 | __in BA_ONREGISTERBEGIN_ARGS* /*pArgs*/, | 266 | __in BA_ONREGISTERBEGIN_ARGS* pArgs, |
267 | __inout BA_ONREGISTERBEGIN_RESULTS* pResults | 267 | __inout BA_ONREGISTERBEGIN_RESULTS* pResults |
268 | ) | 268 | ) |
269 | { | 269 | { |
270 | return pBA->OnRegisterBegin(&pResults->fCancel); | 270 | return pBA->OnRegisterBegin(pArgs->recommendedRegistrationType, &pResults->fCancel, &pResults->registrationType); |
271 | } | 271 | } |
272 | 272 | ||
273 | static HRESULT BalBaseBAProcOnRegisterComplete( | 273 | static HRESULT BalBaseBAProcOnRegisterComplete( |
@@ -456,7 +456,7 @@ static HRESULT BalBaseBAProcOnUnregisterBegin( | |||
456 | __inout BA_ONUNREGISTERBEGIN_RESULTS* pResults | 456 | __inout BA_ONUNREGISTERBEGIN_RESULTS* pResults |
457 | ) | 457 | ) |
458 | { | 458 | { |
459 | return pBA->OnUnregisterBegin(pArgs->fKeepRegistration, &pResults->fForceKeepRegistration); | 459 | return pBA->OnUnregisterBegin(pArgs->recommendedRegistrationType, &pResults->registrationType); |
460 | } | 460 | } |
461 | 461 | ||
462 | static HRESULT BalBaseBAProcOnUnregisterComplete( | 462 | static HRESULT BalBaseBAProcOnUnregisterComplete( |
diff --git a/src/api/burn/balutil/inc/IBootstrapperApplication.h b/src/api/burn/balutil/inc/IBootstrapperApplication.h index c284cb49..98b88f44 100644 --- a/src/api/burn/balutil/inc/IBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/IBootstrapperApplication.h | |||
@@ -280,7 +280,9 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
280 | // OnRegisterBegin - called when the engine registers the bundle. | 280 | // OnRegisterBegin - called when the engine registers the bundle. |
281 | // | 281 | // |
282 | STDMETHOD(OnRegisterBegin)( | 282 | STDMETHOD(OnRegisterBegin)( |
283 | __inout BOOL* pfCancel | 283 | __in BOOTSTRAPPER_REGISTRATION_TYPE recommendedRegistrationType, |
284 | __inout BOOL* pfCancel, | ||
285 | __inout BOOTSTRAPPER_REGISTRATION_TYPE* pRegistrationType | ||
284 | ) = 0; | 286 | ) = 0; |
285 | 287 | ||
286 | // OnRegisterComplete - called when the engine registration is | 288 | // OnRegisterComplete - called when the engine registration is |
@@ -519,8 +521,8 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
519 | // OnUnregisterBegin - called when the engine unregisters the bundle. | 521 | // OnUnregisterBegin - called when the engine unregisters the bundle. |
520 | // | 522 | // |
521 | STDMETHOD(OnUnregisterBegin)( | 523 | STDMETHOD(OnUnregisterBegin)( |
522 | __in BOOL fKeepRegistration, | 524 | __in BOOTSTRAPPER_REGISTRATION_TYPE recommendedRegistrationType, |
523 | __inout BOOL* pfForceKeepRegistration | 525 | __inout BOOTSTRAPPER_REGISTRATION_TYPE* pRegistrationType |
524 | ) = 0; | 526 | ) = 0; |
525 | 527 | ||
526 | // OnUnregisterComplete - called when the engine unregistration is complete. | 528 | // OnUnregisterComplete - called when the engine unregistration is complete. |