aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2019-02-15 22:01:57 -0600
committerSean Hall <r.sean.hall@gmail.com>2021-05-11 19:11:19 -0500
commitbfd0eeddbbdec0348f43e47c36dedf4a23e9a927 (patch)
tree9a46b6085cf508a4f87c4967771871452604e333
parent22263a6a6ca49222d9c46acf8e99a68ffc699a54 (diff)
downloadwix-bfd0eeddbbdec0348f43e47c36dedf4a23e9a927.tar.gz
wix-bfd0eeddbbdec0348f43e47c36dedf4a23e9a927.tar.bz2
wix-bfd0eeddbbdec0348f43e47c36dedf4a23e9a927.zip
WIXFEAT:3815 - use interfaces added in BootstrapperCore.
-rw-r--r--src/WixToolset.WixBA/InstallationViewModel.cs10
-rw-r--r--src/WixToolset.WixBA/Model.cs17
-rw-r--r--src/WixToolset.WixBA/WixBA.cs19
-rw-r--r--src/WixToolset.WixBA/WixBAFactory.cs2
-rw-r--r--src/WixToolset.WixBA/WixToolset.WixBA.csproj4
-rw-r--r--src/WixToolset.WixBA/packages.config2
6 files changed, 32 insertions, 22 deletions
diff --git a/src/WixToolset.WixBA/InstallationViewModel.cs b/src/WixToolset.WixBA/InstallationViewModel.cs
index 35510db4..33b14810 100644
--- a/src/WixToolset.WixBA/InstallationViewModel.cs
+++ b/src/WixToolset.WixBA/InstallationViewModel.cs
@@ -403,9 +403,9 @@ namespace WixToolset.WixBA
403 this.Downgrade = true; 403 this.Downgrade = true;
404 } 404 }
405 405
406 if (!WixBA.Model.Bootstrapper.BAManifest.Bundle.Packages.ContainsKey(e.ProductCode)) 406 if (!WixBA.Model.BAManifest.Bundle.Packages.ContainsKey(e.ProductCode))
407 { 407 {
408 WixBA.Model.Bootstrapper.BAManifest.Bundle.AddRelatedBundleAsPackage(e); 408 WixBA.Model.BAManifest.Bundle.AddRelatedBundleAsPackage(e);
409 } 409 }
410 } 410 }
411 411
@@ -426,8 +426,8 @@ namespace WixToolset.WixBA
426 if (this.Downgrade) 426 if (this.Downgrade)
427 { 427 {
428 this.root.DetectState = DetectionState.Newer; 428 this.root.DetectState = DetectionState.Newer;
429 IEnumerable<PackageInfo> relatedPackages = WixBA.Model.Bootstrapper.BAManifest.Bundle.Packages.Values.Where(p => p.Type == PackageType.UpgradeBundle); 429 var relatedPackages = WixBA.Model.BAManifest.Bundle.Packages.Values.Where(p => p.Type == PackageType.UpgradeBundle);
430 Version installedVersion = relatedPackages.Any() ? new Version(relatedPackages.Max(p => p.Version)) : null; 430 var installedVersion = relatedPackages.Any() ? new Version(relatedPackages.Max(p => p.Version)) : null;
431 if (installedVersion != null && installedVersion < new Version(4, 1) && installedVersion.Build > 10) 431 if (installedVersion != null && installedVersion < new Version(4, 1) && installedVersion.Build > 10)
432 { 432 {
433 this.DowngradeMessage = "You must uninstall WiX v" + installedVersion + " before you can install this."; 433 this.DowngradeMessage = "You must uninstall WiX v" + installedVersion + " before you can install this.";
@@ -641,7 +641,7 @@ namespace WixToolset.WixBA
641 private void ParseCommandLine() 641 private void ParseCommandLine()
642 { 642 {
643 // Get array of arguments based on the system parsing algorithm. 643 // Get array of arguments based on the system parsing algorithm.
644 string[] args = WixBA.Model.Command.GetCommandLineArgs(); 644 string[] args = WixBA.Model.Command.CommandLineArgs;
645 for (int i = 0; i < args.Length; ++i) 645 for (int i = 0; i < args.Length; ++i)
646 { 646 {
647 if (args[i].StartsWith("InstallFolder=", StringComparison.InvariantCultureIgnoreCase)) 647 if (args[i].StartsWith("InstallFolder=", StringComparison.InvariantCultureIgnoreCase))
diff --git a/src/WixToolset.WixBA/Model.cs b/src/WixToolset.WixBA/Model.cs
index 25415e0f..fda8eab2 100644
--- a/src/WixToolset.WixBA/Model.cs
+++ b/src/WixToolset.WixBA/Model.cs
@@ -20,27 +20,32 @@ namespace WixToolset.WixBA
20 /// Creates a new model for the BA. 20 /// Creates a new model for the BA.
21 /// </summary> 21 /// </summary>
22 /// <param name="bootstrapper">The BA.</param> 22 /// <param name="bootstrapper">The BA.</param>
23 public Model(BootstrapperApplication bootstrapper) 23 public Model(WixBA bootstrapper)
24 { 24 {
25 this.BAManifest = bootstrapper.BAManifest;
25 this.Bootstrapper = bootstrapper; 26 this.Bootstrapper = bootstrapper;
27 this.Command = bootstrapper.Command;
28 this.Engine = bootstrapper.Engine;
26 this.Telemetry = new List<KeyValuePair<string, string>>(); 29 this.Telemetry = new List<KeyValuePair<string, string>>();
27 this.Version = this.Engine.VersionVariables[BurnBundleVersionVariable]; 30 this.Version = this.Engine.VersionVariables[BurnBundleVersionVariable];
28 } 31 }
29 32
33 public IBootstrapperApplicationData BAManifest { get; }
34
30 /// <summary> 35 /// <summary>
31 /// Gets the bootstrapper. 36 /// Gets the bootstrapper.
32 /// </summary> 37 /// </summary>
33 public BootstrapperApplication Bootstrapper { get; private set; } 38 public IDefaultBootstrapperApplication Bootstrapper { get; }
34 39
35 /// <summary> 40 /// <summary>
36 /// Gets the bootstrapper command-line. 41 /// Gets the bootstrapper command-line.
37 /// </summary> 42 /// </summary>
38 public Command Command { get { return this.Bootstrapper.Command; } } 43 public IBootstrapperCommand Command { get; }
39 44
40 /// <summary> 45 /// <summary>
41 /// Gets the bootstrapper engine. 46 /// Gets the bootstrapper engine.
42 /// </summary> 47 /// </summary>
43 public Engine Engine { get { return this.Bootstrapper.Engine; } } 48 public IEngine Engine { get; }
44 49
45 /// <summary> 50 /// <summary>
46 /// Gets the key/value pairs used in telemetry. 51 /// Gets the key/value pairs used in telemetry.
@@ -121,9 +126,7 @@ namespace WixToolset.WixBA
121 /// <returns>Display name of the package if found or the package id if not.</returns> 126 /// <returns>Display name of the package if found or the package id if not.</returns>
122 public string GetPackageName(string packageId) 127 public string GetPackageName(string packageId)
123 { 128 {
124 PackageInfo package; 129 return this.BAManifest.Bundle.Packages.TryGetValue(packageId, out var package) ? package.DisplayName : packageId;
125
126 return this.Bootstrapper.BAManifest.Bundle.Packages.TryGetValue(packageId, out package) ? package.DisplayName : packageId;
127 } 130 }
128 } 131 }
129} 132}
diff --git a/src/WixToolset.WixBA/WixBA.cs b/src/WixToolset.WixBA/WixBA.cs
index 6b64b252..b82a86ae 100644
--- a/src/WixToolset.WixBA/WixBA.cs
+++ b/src/WixToolset.WixBA/WixBA.cs
@@ -8,23 +8,30 @@ namespace WixToolset.WixBA
8 using System.IO; 8 using System.IO;
9 using System.Net; 9 using System.Net;
10 using System.Text; 10 using System.Text;
11 using System.Windows.Input; 11 using WixToolset.BootstrapperCore;
12
12 using Threading = System.Windows.Threading; 13 using Threading = System.Windows.Threading;
13 using WinForms = System.Windows.Forms; 14 using WinForms = System.Windows.Forms;
14 15
15 using WixToolset.BootstrapperCore;
16
17 /// <summary> 16 /// <summary>
18 /// The WiX toolset user experience. 17 /// The WiX toolset bootstrapper application.
19 /// </summary> 18 /// </summary>
20 public class WixBA : BootstrapperApplication 19 public class WixBA : BootstrapperApplication
21 { 20 {
22 public WixBA(Engine engine, Command command) 21 public WixBA(IEngine engine, IBootstrapperCommand command)
23 : base(engine, command) 22 : base(engine)
24 { 23 {
24 this.Command = command;
25 25
26 this.BAManifest = new BootstrapperApplicationData();
26 } 27 }
27 28
29 internal IBootstrapperApplicationData BAManifest { get; }
30
31 internal IBootstrapperCommand Command { get; }
32
33 internal IEngine Engine => this.engine;
34
28 /// <summary> 35 /// <summary>
29 /// Gets the global model. 36 /// Gets the global model.
30 /// </summary> 37 /// </summary>
diff --git a/src/WixToolset.WixBA/WixBAFactory.cs b/src/WixToolset.WixBA/WixBAFactory.cs
index 66012521..0c219f17 100644
--- a/src/WixToolset.WixBA/WixBAFactory.cs
+++ b/src/WixToolset.WixBA/WixBAFactory.cs
@@ -6,7 +6,7 @@ namespace WixToolset.WixBA
6 6
7 public class WixBAFactory : BaseBootstrapperApplicationFactory 7 public class WixBAFactory : BaseBootstrapperApplicationFactory
8 { 8 {
9 protected override IBootstrapperApplication Create(Engine engine, ref Command command) 9 protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand command)
10 { 10 {
11 return new WixBA(engine, command); 11 return new WixBA(engine, command);
12 } 12 }
diff --git a/src/WixToolset.WixBA/WixToolset.WixBA.csproj b/src/WixToolset.WixBA/WixToolset.WixBA.csproj
index 083d4e6e..881996e4 100644
--- a/src/WixToolset.WixBA/WixToolset.WixBA.csproj
+++ b/src/WixToolset.WixBA/WixToolset.WixBA.csproj
@@ -1,4 +1,4 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0"> 3<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
4 <PropertyGroup> 4 <PropertyGroup>
@@ -57,7 +57,7 @@
57 <Reference Include="System.Xaml" /> 57 <Reference Include="System.Xaml" />
58 <Reference Include="WindowsBase" /> 58 <Reference Include="WindowsBase" />
59 <Reference Include="WixToolset.BootstrapperCore"> 59 <Reference Include="WixToolset.BootstrapperCore">
60 <HintPath>..\..\packages\WixToolset.BootstrapperCore.4.0.4\lib\net20\WixToolset.BootstrapperCore.dll</HintPath> 60 <HintPath>..\..\packages\WixToolset.BootstrapperCore.4.0.5\lib\net20\WixToolset.BootstrapperCore.dll</HintPath>
61 </Reference> 61 </Reference>
62 </ItemGroup> 62 </ItemGroup>
63 <ItemGroup> 63 <ItemGroup>
diff --git a/src/WixToolset.WixBA/packages.config b/src/WixToolset.WixBA/packages.config
index 3ca82077..24cbf46f 100644
--- a/src/WixToolset.WixBA/packages.config
+++ b/src/WixToolset.WixBA/packages.config
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<packages> 2<packages>
3 <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="net45" developmentDependency="true" /> 3 <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="net45" developmentDependency="true" />
4 <package id="WixToolset.BootstrapperCore" version="4.0.4" targetFramework="net45" /> 4 <package id="WixToolset.BootstrapperCore" version="4.0.5" targetFramework="net45" />
5</packages> \ No newline at end of file 5</packages> \ No newline at end of file