Don't report related operation in OnDetectRelatedBundle.
#5796
Sean Hall committed
Dec 30, 2021 at 15:32 UTC
8dfadd0c9068965af138949b630ef8496b4f7bbb
20 files changed
+94
-108
src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h
-1
@@ -725,7 +725,6 @@ struct BA_ONDETECTRELATEDBUNDLE_ARGS
725
LPCWSTR wzBundleTag;
726
BOOL fPerMachine;
727
LPCWSTR wzVersion;
728
- BOOTSTRAPPER_RELATED_OPERATION operation;
728
BOOL fMissingFromCache;
729
};
730
src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs
+2
-2
@@ -1345,9 +1345,9 @@ namespace WixToolset.Mba.Core
1345
return args.HResult;
1346
}
1347
1348
- int IBootstrapperApplication.OnDetectRelatedBundle(string wzProductCode, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, RelatedOperation operation, bool fMissingFromCache, ref bool fCancel)
1348
+ int IBootstrapperApplication.OnDetectRelatedBundle(string wzProductCode, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, bool fMissingFromCache, ref bool fCancel)
1349
{
1350
- DetectRelatedBundleEventArgs args = new DetectRelatedBundleEventArgs(wzProductCode, relationType, wzBundleTag, fPerMachine, wzVersion, operation, fMissingFromCache, fCancel);
1350
+ DetectRelatedBundleEventArgs args = new DetectRelatedBundleEventArgs(wzProductCode, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, fCancel);
1351
this.OnDetectRelatedBundle(args);
1352
1353
fCancel = args.Cancel;
src/api/burn/WixToolset.Mba.Core/EventArgs.cs
+1
-7
@@ -434,7 +434,7 @@ namespace WixToolset.Mba.Core
434
public class DetectRelatedBundleEventArgs : CancellableHResultEventArgs
435
{
436
/// <summary />
437
- public DetectRelatedBundleEventArgs(string productCode, RelationType relationType, string bundleTag, bool perMachine, string version, RelatedOperation operation, bool missingFromCache, bool cancelRecommendation)
437
+ public DetectRelatedBundleEventArgs(string productCode, RelationType relationType, string bundleTag, bool perMachine, string version, bool missingFromCache, bool cancelRecommendation)
438
: base(cancelRecommendation)
439
{
440
this.ProductCode = productCode;
@@ -442,7 +442,6 @@ namespace WixToolset.Mba.Core
442
this.BundleTag = bundleTag;
443
this.PerMachine = perMachine;
444
this.Version = version;
445
- this.Operation = operation;
445
this.MissingFromCache = missingFromCache;
446
}
447
@@ -471,11 +470,6 @@ namespace WixToolset.Mba.Core
470
/// </summary>
471
public string Version { get; private set; }
472
474
- /// <summary>
475
- /// Gets the operation that will be taken on the detected bundle.
476
- /// </summary>
477
- public RelatedOperation Operation { get; private set; }
478
-
473
/// <summary>
474
/// Whether the related bundle is missing from the package cache.
475
/// </summary>
src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs
-15
@@ -156,15 +156,6 @@ namespace WixToolset.Mba.Core
156
/// <summary>
157
/// See <see cref="IDefaultBootstrapperApplication.DetectRelatedBundle"/>.
158
/// </summary>
159
- /// <param name="wzBundleId"></param>
160
- /// <param name="relationType"></param>
161
- /// <param name="wzBundleTag"></param>
162
- /// <param name="fPerMachine"></param>
163
- /// <param name="wzVersion"></param>
164
- /// <param name="operation"></param>
165
- /// <param name="fMissingFromCache"></param>
166
- /// <param name="fCancel"></param>
167
- /// <returns></returns>
159
[PreserveSig]
160
[return: MarshalAs(UnmanagedType.I4)]
161
int OnDetectRelatedBundle(
@@ -173,7 +164,6 @@ namespace WixToolset.Mba.Core
164
[MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
165
[MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
166
[MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
176
- [MarshalAs(UnmanagedType.U4)] RelatedOperation operation,
167
[MarshalAs(UnmanagedType.Bool)] bool fMissingFromCache,
168
[MarshalAs(UnmanagedType.Bool)] ref bool fCancel
169
);
@@ -289,11 +279,6 @@ namespace WixToolset.Mba.Core
279
/// <summary>
280
/// See <see cref="IDefaultBootstrapperApplication.PlanRelatedBundle"/>.
281
/// </summary>
292
- /// <param name="wzBundleId"></param>
293
- /// <param name="recommendedState"></param>
294
- /// <param name="pRequestedState"></param>
295
- /// <param name="fCancel"></param>
296
- /// <returns></returns>
282
[PreserveSig]
283
[return: MarshalAs(UnmanagedType.I4)]
284
int OnPlanRelatedBundle(
src/api/burn/balutil/inc/BalBaseBAFunctions.h
-1
@@ -167,7 +167,6 @@ public: // IBootstrapperApplication
167
__in_z LPCWSTR /*wzBundleTag*/,
168
__in BOOL /*fPerMachine*/,
169
__in LPCWSTR /*wzVersion*/,
170
- __in BOOTSTRAPPER_RELATED_OPERATION /*operation*/,
170
__in BOOL /*fMissingFromCache*/,
171
__inout BOOL* /*pfCancel*/
172
)
src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h
-1
@@ -172,7 +172,6 @@ public: // IBootstrapperApplication
172
__in_z LPCWSTR /*wzBundleTag*/,
173
__in BOOL /*fPerMachine*/,
174
__in LPCWSTR /*wzVersion*/,
175
- __in BOOTSTRAPPER_RELATED_OPERATION /*operation*/,
175
__in BOOL /*fMissingFromCache*/,
176
__inout BOOL* pfCancel
177
)
src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h
+1
-1
@@ -114,7 +114,7 @@ static HRESULT BalBaseBAProcOnDetectRelatedBundle(
114
__inout BA_ONDETECTRELATEDBUNDLE_RESULTS* pResults
115
)
116
{
117
- return pBA->OnDetectRelatedBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->operation, pArgs->fMissingFromCache, &pResults->fCancel);
117
+ return pBA->OnDetectRelatedBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->fMissingFromCache, &pResults->fCancel);
118
}
119
120
static HRESULT BalBaseBAProcOnDetectPackageBegin(
src/api/burn/balutil/inc/IBootstrapperApplication.h
-1
@@ -91,7 +91,6 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
91
__in_z LPCWSTR wzBundleTag,
92
__in BOOL fPerMachine,
93
__in_z LPCWSTR wzVersion,
94
- __in BOOTSTRAPPER_RELATED_OPERATION operation,
94
__in BOOL fMissingFromCache,
95
__inout BOOL* pfCancel
96
) = 0;
src/burn/engine/core.cpp
+1
-1
@@ -359,7 +359,7 @@ extern "C" HRESULT CoreDetect(
359
ExitOnFailure(hr, "Failed to detect provider key bundle id.");
360
361
// Report the related bundles.
362
- hr = DetectReportRelatedBundles(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, pEngineState->command.action, &pEngineState->registration.fEligibleForCleanup);
362
+ hr = DetectReportRelatedBundles(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->registration.fEligibleForCleanup);
363
ExitOnFailure(hr, "Failed to report detected related bundles.");
364
365
// Do update detection.
src/burn/engine/detect.cpp
+2
-50
@@ -154,68 +154,20 @@ extern "C" HRESULT DetectReportRelatedBundles(
154
__in BURN_USER_EXPERIENCE* pUX,
155
__in BURN_REGISTRATION* pRegistration,
156
__in BOOTSTRAPPER_RELATION_TYPE relationType,
157
- __in BOOTSTRAPPER_ACTION action,
157
__out BOOL* pfEligibleForCleanup
158
)
159
{
160
HRESULT hr = S_OK;
162
- int nCompareResult = 0;
161
BOOTSTRAPPER_REQUEST_STATE uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE;
162
*pfEligibleForCleanup = pRegistration->fInstalled || pRegistration->fCached;
163
164
for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle)
165
{
166
const BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle;
169
- BOOTSTRAPPER_RELATED_OPERATION operation = BOOTSTRAPPER_RELATED_OPERATION_NONE;
170
-
171
- switch (pRelatedBundle->relationType)
172
- {
173
- case BOOTSTRAPPER_RELATION_UPGRADE:
174
- if (BOOTSTRAPPER_RELATION_UPGRADE != relationType && BOOTSTRAPPER_ACTION_UNINSTALL < action)
175
- {
176
- hr = VerCompareParsedVersions(pRegistration->pVersion, pRelatedBundle->pVersion, &nCompareResult);
177
- ExitOnFailure(hr, "Failed to compare bundle version '%ls' to related bundle version '%ls'", pRegistration->pVersion->sczVersion, pRelatedBundle->pVersion->sczVersion);
178
-
179
- if (nCompareResult < 0)
180
- {
181
- operation = BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE;
182
- }
183
- else
184
- {
185
- operation = BOOTSTRAPPER_RELATED_OPERATION_MAJOR_UPGRADE;
186
- }
187
- }
188
- break;
189
-
190
- case BOOTSTRAPPER_RELATION_PATCH: __fallthrough;
191
- case BOOTSTRAPPER_RELATION_ADDON:
192
- if (BOOTSTRAPPER_ACTION_UNINSTALL == action)
193
- {
194
- operation = BOOTSTRAPPER_RELATED_OPERATION_REMOVE;
195
- }
196
- else if (BOOTSTRAPPER_ACTION_INSTALL == action || BOOTSTRAPPER_ACTION_MODIFY == action)
197
- {
198
- operation = BOOTSTRAPPER_RELATED_OPERATION_INSTALL;
199
- }
200
- else if (BOOTSTRAPPER_ACTION_REPAIR == action)
201
- {
202
- operation = BOOTSTRAPPER_RELATED_OPERATION_REPAIR;
203
- }
204
- break;
205
-
206
- case BOOTSTRAPPER_RELATION_DETECT: __fallthrough;
207
- case BOOTSTRAPPER_RELATION_DEPENDENT:
208
- break;
209
-
210
- default:
211
- hr = E_FAIL;
212
- ExitOnRootFailure(hr, "Unexpected relation type encountered: %d", pRelatedBundle->relationType);
213
- break;
214
- }
167
216
- LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingRelatedOperationToString(operation), LoggingBoolToString(pRelatedBundle->package.fCached));
168
+ LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRelatedBundle->package.fCached));
169
218
- hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, operation, !pRelatedBundle->package.fCached);
170
+ hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, !pRelatedBundle->package.fCached);
171
ExitOnRootFailure(hr, "BA aborted detect related bundle.");
172
173
// For now, if any related bundles will be executed during uninstall by default then never automatically clean up the bundle.
src/burn/engine/detect.h
-1
@@ -29,7 +29,6 @@ HRESULT DetectReportRelatedBundles(
29
__in BURN_USER_EXPERIENCE* pUX,
30
__in BURN_REGISTRATION* pRegistration,
31
__in BOOTSTRAPPER_RELATION_TYPE relationType,
32
- __in BOOTSTRAPPER_ACTION action,
32
__out BOOL* pfEligibleForCleanup
33
);
34
src/burn/engine/engine.mc
+1
-1
@@ -223,7 +223,7 @@ MessageId=102
223
Severity=Success
224
SymbolicName=MSG_DETECTED_RELATED_BUNDLE
225
Language=English
226
-Detected related bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, operation: %5!hs!, cached: %6!hs!
226
+Detected related bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, cached: %5!hs!
227
.
228
229
MessageId=103
src/burn/engine/userexperience.cpp
+1
-3
@@ -104,7 +104,7 @@ extern "C" HRESULT UserExperienceLoad(
104
args.pCommand = pCommand;
105
args.pfnBootstrapperEngineProc = EngineForApplicationProc;
106
args.pvBootstrapperEngineProcContext = pEngineContext;
107
- args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 12, 7, 0);
107
+ args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 12, 30, 0);
108
109
results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS);
110
@@ -1164,7 +1164,6 @@ EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle(
1164
__in_z LPCWSTR wzBundleTag,
1165
__in BOOL fPerMachine,
1166
__in VERUTIL_VERSION* pVersion,
1167
- __in BOOTSTRAPPER_RELATED_OPERATION operation,
1167
__in BOOL fMissingFromCache
1168
)
1169
{
@@ -1178,7 +1177,6 @@ EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle(
1177
args.wzBundleTag = wzBundleTag;
1178
args.fPerMachine = fPerMachine;
1179
args.wzVersion = pVersion->sczVersion;
1181
- args.operation = operation;
1180
args.fMissingFromCache = fMissingFromCache;
1181
1182
results.cbSize = sizeof(results);
src/burn/engine/userexperience.h
-1
@@ -286,7 +286,6 @@ BAAPI UserExperienceOnDetectRelatedBundle(
286
__in_z LPCWSTR wzBundleTag,
287
__in BOOL fPerMachine,
288
__in VERUTIL_VERSION* pVersion,
289
- __in BOOTSTRAPPER_RELATED_OPERATION operation,
289
__in BOOL fMissingFromCache
290
);
291
BAAPI UserExperienceOnDetectRelatedMsiPackage(
src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
+9
-4
@@ -246,12 +246,12 @@ public: // IBootstrapperApplication
246
__in LPCWSTR wzBundleTag,
247
__in BOOL fPerMachine,
248
__in LPCWSTR wzVersion,
249
- __in BOOTSTRAPPER_RELATED_OPERATION operation,
249
__in BOOL fMissingFromCache,
250
__inout BOOL* pfCancel
251
)
252
{
253
BAL_INFO_PACKAGE* pPackage = NULL;
254
+ int nCompare = 0;
255
256
if (!fMissingFromCache)
257
{
@@ -261,14 +261,15 @@ public: // IBootstrapperApplication
261
}
262
263
// If we're not doing a prerequisite install, remember when our bundle would cause a downgrade.
264
- if (!m_fPrereq && BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE == operation)
264
+ if (!m_fPrereq && BOOTSTRAPPER_RELATION_UPGRADE == relationType &&
265
+ SUCCEEDED(m_pEngine->CompareVersions(m_sczBundleVersion, wzVersion, &nCompare)) && 0 > nCompare)
266
{
267
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "A newer version (v%ls) of this product is installed.", wzVersion);
268
m_fDowngrading = TRUE;
269
}
270
}
271
271
- return CBalBaseBootstrapperApplication::OnDetectRelatedBundle(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, operation, fMissingFromCache, pfCancel);
272
+ return CBalBaseBootstrapperApplication::OnDetectRelatedBundle(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, pfCancel);
273
}
274
275
@@ -2091,7 +2092,8 @@ public: //CBalBaseBootstrapperApplication
2092
}
2093
}
2094
2094
- hr = S_OK;
2095
+ hr = BalGetStringVariable(L"WixBundleVersion", &m_sczBundleVersion);
2096
+ BalExitOnFailure(hr, "CWixStandardBootstrapperApplication initialization failed.");
2097
2098
LExit:
2099
return hr;
@@ -4129,6 +4131,7 @@ public:
4131
m_plannedAction = BOOTSTRAPPER_ACTION_UNKNOWN;
4132
4133
m_sczAfterForcedRestartPackage = NULL;
4134
+ m_sczBundleVersion = NULL;
4135
4136
m_pWixLoc = NULL;
4137
m_Bundle = { };
@@ -4367,6 +4370,7 @@ public:
4370
ReleaseStr(m_sczLanguage);
4371
ReleaseStr(m_sczLicenseFile);
4372
ReleaseStr(m_sczLicenseUrl);
4373
+ ReleaseStr(m_sczBundleVersion);
4374
ReleaseStr(m_sczAfterForcedRestartPackage);
4375
ReleaseNullObject(m_pEngine);
4376
@@ -4391,6 +4395,7 @@ private:
4395
BOOTSTRAPPER_ACTION m_plannedAction;
4396
4397
LPWSTR m_sczAfterForcedRestartPackage;
4398
+ LPWSTR m_sczBundleVersion;
4399
4400
WIX_LOCALIZATION* m_pWixLoc;
4401
BAL_INFO_BUNDLE m_Bundle;
src/test/burn/TestData/WixStdBaTests/BundleA_v10/BundleA_v10.wixproj
new
+20
@@ -0,0 +1,20 @@
1
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
+<Project Sdk="WixToolset.Sdk">
3
+ <PropertyGroup>
4
+ <OutputType>Bundle</OutputType>
5
+ <BA>hyperlinkLicense</BA>
6
+ <UpgradeCode>{7D977157-06C9-4176-A931-AC16E18AAB51}</UpgradeCode>
7
+ <DefineConstants>$(DefineConstants);Version=1.0</DefineConstants>
8
+ <OutputName>WixStdBaTest1_v10</OutputName>
9
+ </PropertyGroup>
10
+ <ItemGroup>
11
+ <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
12
+ <Compile Include="..\BundleA\BundleA.wxs" Link="BundleA.wxs" />
13
+ </ItemGroup>
14
+ <ItemGroup>
15
+ <ProjectReference Include="..\PackageA\PackageA.wixproj" />
16
+ </ItemGroup>
17
+ <ItemGroup>
18
+ <PackageReference Include="WixToolset.Bal.wixext" />
19
+ </ItemGroup>
20
+</Project>
\ No newline at end of file
src/test/burn/WixToolset.WixBA/InstallationViewModel.cs
+31
-16
@@ -19,6 +19,18 @@ namespace WixToolset.WixBA
19
{
20
Absent,
21
Present,
22
+ }
23
+
24
+ /// <summary>
25
+ /// The states of upgrade detection.
26
+ /// </summary>
27
+ public enum UpgradeDetectionState
28
+ {
29
+ // There are no Upgrade related bundles installed.
30
+ None,
31
+ // All Upgrade related bundles that are installed are older than or the same version as this bundle.
32
+ Older,
33
+ // At least one Upgrade related bundle is installed that is newer than this bundle.
34
Newer,
35
}
36
@@ -90,7 +102,7 @@ namespace WixToolset.WixBA
102
103
void RootPropertyChanged(object sender, PropertyChangedEventArgs e)
104
{
93
- if (("DetectState" == e.PropertyName) || ("InstallState" == e.PropertyName))
105
+ if (("DetectState" == e.PropertyName) || ("UpgradeDetectState" == e.PropertyName) || ("InstallState" == e.PropertyName))
106
{
107
base.OnPropertyChanged("RepairEnabled");
108
base.OnPropertyChanged("InstallEnabled");
@@ -276,7 +288,9 @@ namespace WixToolset.WixBA
288
{
289
if (this.installCommand == null)
290
{
279
- this.installCommand = new RelayCommand(param => WixBA.Plan(LaunchAction.Install), param => this.root.DetectState == DetectionState.Absent && this.root.InstallState == InstallationState.Waiting);
291
+ this.installCommand = new RelayCommand(
292
+ param => WixBA.Plan(LaunchAction.Install),
293
+ param => this.root.DetectState == DetectionState.Absent && this.root.UpgradeDetectState != UpgradeDetectionState.Newer && this.root.InstallState == InstallationState.Waiting);
294
}
295
296
return this.installCommand;
@@ -399,9 +413,19 @@ namespace WixToolset.WixBA
413
414
private void DetectedRelatedBundle(object sender, DetectRelatedBundleEventArgs e)
415
{
402
- if (e.Operation == RelatedOperation.Downgrade)
416
+ if (e.RelationType == RelationType.Upgrade)
417
{
404
- this.Downgrade = true;
418
+ if (WixBA.Model.Engine.CompareVersions(this.Version, e.Version) > 0)
419
+ {
420
+ if (this.root.UpgradeDetectState == UpgradeDetectionState.None)
421
+ {
422
+ this.root.UpgradeDetectState = UpgradeDetectionState.Older;
423
+ }
424
+ }
425
+ else
426
+ {
427
+ this.root.UpgradeDetectState = UpgradeDetectionState.Newer;
428
+ }
429
}
430
431
if (!WixBA.Model.BAManifest.Bundle.Packages.ContainsKey(e.ProductCode))
@@ -432,19 +456,10 @@ namespace WixToolset.WixBA
456
}
457
else if (Hresult.Succeeded(e.Status))
458
{
435
- if (this.Downgrade)
459
+ if (this.root.UpgradeDetectState == UpgradeDetectionState.Newer)
460
{
437
- this.root.DetectState = DetectionState.Newer;
438
- var relatedPackages = WixBA.Model.BAManifest.Bundle.Packages.Values.Where(p => p.Type == PackageType.UpgradeBundle);
439
- var installedVersion = relatedPackages.Any() ? new Version(relatedPackages.Max(p => p.Version)) : null;
440
- if (installedVersion != null && installedVersion < new Version(4, 1) && installedVersion.Build > 10)
441
- {
442
- this.DowngradeMessage = "You must uninstall WiX v" + installedVersion + " before you can install this.";
443
- }
444
- else
445
- {
446
- this.DowngradeMessage = "There is already a newer version of WiX installed on this machine.";
447
- }
461
+ this.Downgrade = true;
462
+ this.DowngradeMessage = "There is already a newer version of WiX installed on this machine.";
463
}
464
465
if (LaunchAction.Layout == WixBA.Model.Command.Action)
src/test/burn/WixToolset.WixBA/RootViewModel.cs
+23
@@ -27,6 +27,7 @@ namespace WixToolset.WixBA
27
private bool canceled;
28
private InstallationState installState;
29
private DetectionState detectState;
30
+ private UpgradeDetectionState upgradeDetectState;
31
32
/// <summary>
33
/// Creates a new model of the root view.
@@ -119,6 +120,28 @@ namespace WixToolset.WixBA
120
}
121
}
122
123
+ /// <summary>
124
+ /// Gets and sets the upgrade detect state of the view's model.
125
+ /// </summary>
126
+ public UpgradeDetectionState UpgradeDetectState
127
+ {
128
+ get
129
+ {
130
+ return this.upgradeDetectState;
131
+ }
132
+
133
+ set
134
+ {
135
+ if (this.upgradeDetectState != value)
136
+ {
137
+ this.upgradeDetectState = value;
138
+
139
+ // Notify all the properties derived from the state that the state changed.
140
+ base.OnPropertyChanged("UpgradeDetectState");
141
+ }
142
+ }
143
+ }
144
+
145
/// <summary>
146
/// Gets and sets the installation state of the view's model.
147
/// </summary>
src/test/burn/WixToolsetTest.BurnE2E/DependencyTests.cs
+1
-1
@@ -596,7 +596,7 @@ namespace WixToolsetTest.BurnE2E
596
packageDv2.VerifyInstalled(true);
597
598
Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv2InstallLogFilePath, @"Skipping cross-scope dependency registration on package: PackageA, bundle scope: PerUser, package scope: PerMachine"));
599
- Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerUser, version: 1\.0\.0\.0, operation: MajorUpgrade, cached: Yes"));
599
+ Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerUser, version: 1\.0\.0\.0, cached: Yes"));
600
601
bundleHv2.Uninstall();
602
bundleHv2.VerifyUnregisteredAndRemovedFromPackageCache();
src/test/burn/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs
+1
-1
@@ -30,7 +30,7 @@ namespace WixToolsetTest.BurnE2E
30
bundleAv2.VerifyRegisteredAndInPackageCache();
31
32
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2InstallLogFilePath, @"OnDetectRelatedBundle\(\) - id: \{[0-9A-Za-z\-]{36}\}, missing from cache: True"));
33
- Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerMachine, version: 1\.0\.0\.0, operation: MajorUpgrade, cached: No"));
33
+ Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerMachine, version: 1\.0\.0\.0, cached: No"));
34
}
35
}
36
}