1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
// 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.
namespace WixToolsetTest.BurnE2E
{
using System;
using System.IO;
using WixTestTools;
using Xunit;
using Xunit.Abstractions;
public class UpgradeRelatedBundleTests : BurnE2ETests
{
public UpgradeRelatedBundleTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
[RuntimeFact]
public void ReinstallsOlderBundleAfterFailure()
{
var packageAv2 = this.CreatePackageInstaller("PackageAv2");
var packageAv3 = this.CreatePackageInstaller("PackageAv3");
var bundleAv2 = this.CreateBundleInstaller("BundleAv2");
var bundleAv3 = this.CreateBundleInstaller("BundleAv3");
packageAv2.VerifyInstalled(false);
packageAv3.VerifyInstalled(false);
bundleAv2.Install();
bundleAv2.VerifyRegisteredAndInPackageCache();
packageAv2.VerifyInstalled(true);
packageAv3.VerifyInstalled(false);
// Verify https://github.com/wixtoolset/issues/issues/3421
var bundleAv3InstallLogFilePath = bundleAv3.Install((int)MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE);
bundleAv3.VerifyUnregisteredAndRemovedFromPackageCache();
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv3InstallLogFilePath, @"Applied execute package: PackageA, result: 0x0, restart: None"));
packageAv2.VerifyInstalled(true);
packageAv3.VerifyInstalled(false);
}
[RuntimeFact]
public void ReinstallsOlderBundleAfterFailureWixstdba()
{
var packageAv2 = this.CreatePackageInstaller("PackageAv2");
var packageAv3 = this.CreatePackageInstaller("PackageAv3");
var bundleAv2 = this.CreateBundleInstaller("BundleAv2wixstdba");
var bundleAv3 = this.CreateBundleInstaller("BundleAv3wixstdba");
packageAv2.VerifyInstalled(false);
packageAv3.VerifyInstalled(false);
bundleAv2.Install();
bundleAv2.VerifyRegisteredAndInPackageCache();
packageAv2.VerifyInstalled(true);
packageAv3.VerifyInstalled(false);
// Verify https://github.com/wixtoolset/issues/issues/3421
var bundleAv3InstallLogFilePath = bundleAv3.Install((int)MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE);
bundleAv3.VerifyUnregisteredAndRemovedFromPackageCache();
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv3InstallLogFilePath, @"Applied execute package: PackageA, result: 0x0, restart: None"));
packageAv2.VerifyInstalled(true);
packageAv3.VerifyInstalled(false);
}
[RuntimeFact]
public void ReportsRelatedBundleMissingFromCache()
{
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
var packageAv2 = this.CreatePackageInstaller("PackageAv2");
var bundleAv1 = this.CreateBundleInstaller("BundleAv1");
var bundleAv2 = this.CreateBundleInstaller("BundleAv2");
bundleAv1.Install();
bundleAv1.VerifyRegisteredAndInPackageCache();
bundleAv1.ManuallyUncache();
// Verify https://github.com/wixtoolset/issues/issues/4991
var bundleAv2InstallLogFilePath = bundleAv2.Install();
bundleAv2.VerifyRegisteredAndInPackageCache();
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2InstallLogFilePath, @"OnDetectRelatedBundle\(\) - id: \{[0-9A-Za-z\-]{36}\}, missing from cache: True"));
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerMachine, version: 1\.0\.0\.0, cached: No"));
}
[RuntimeFact]
public void Bundle64UpgradesBundle32()
{
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
var packageAv2 = this.CreatePackageInstaller("PackageAv2");
var bundleAv1 = this.CreateBundleInstaller("BundleAv1");
var bundleAv2x64 = this.CreateBundleInstaller("BundleAv2x64");
bundleAv1.Install();
bundleAv1.VerifyRegisteredAndInPackageCache();
var bundleAv2x64InstallLogFilePath = bundleAv2x64.Install();
bundleAv2x64.VerifyRegisteredAndInPackageCache();
bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache();
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2x64InstallLogFilePath, @"Detected related package: \{[0-9A-Za-z\-]{36}\}, scope: PerMachine, version: 1.0.0.0, language: 1033 operation: MajorUpgrade"));
}
[RuntimeFact]
public void Bundle32UpgradesBundle64()
{
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
var packageAv2 = this.CreatePackageInstaller("PackageAv2");
var bundleAv1x64 = this.CreateBundleInstaller("BundleAv1x64");
var bundleAv2 = this.CreateBundleInstaller("BundleAv2");
bundleAv1x64.Install();
bundleAv1x64.VerifyRegisteredAndInPackageCache();
bundleAv2.Install();
bundleAv2.VerifyRegisteredAndInPackageCache();
bundleAv1x64.VerifyUnregisteredAndRemovedFromPackageCache();
}
[RuntimeFact]
public void DncBABundleUpgradesDncBABundle()
{
var bundleDv2 = this.CreateBundleInstaller("BundleD_x64_v2");
var bundleDv3 = this.CreateBundleInstaller("BundleD_x64_v3");
bundleDv2.Install();
bundleDv2.VerifyRegisteredAndInPackageCache();
bundleDv3.Install();
bundleDv3.VerifyRegisteredAndInPackageCache();
bundleDv2.VerifyUnregisteredAndRemovedFromPackageCache();
}
}
}
|