From dd40005b0cc376410cd931c9790bdd69551e9aa1 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 15 Feb 2019 18:53:49 -0600 Subject: Integrate into latest v4 (2019/02/15). --- src/WixToolset.WixBA/BrowserProperties.cs | 2 +- src/WixToolset.WixBA/Hresult.cs | 2 +- src/WixToolset.WixBA/InstallationViewModel.cs | 8 +- src/WixToolset.WixBA/Model.cs | 8 +- src/WixToolset.WixBA/NewsItem.cs | 2 +- src/WixToolset.WixBA/ProgressViewModel.cs | 4 +- src/WixToolset.WixBA/Properties/AssemblyInfo.cs | 10 +- src/WixToolset.WixBA/PropertyNotifyBase.cs | 2 +- src/WixToolset.WixBA/RelayCommand.cs | 2 +- src/WixToolset.WixBA/RootView.xaml | 6 +- src/WixToolset.WixBA/RootView.xaml.cs | 2 +- src/WixToolset.WixBA/RootViewModel.cs | 4 +- src/WixToolset.WixBA/Styles.xaml | 4 +- src/WixToolset.WixBA/UpdateViewModel.cs | 10 +- src/WixToolset.WixBA/WindowProperties.cs | 2 +- src/WixToolset.WixBA/WixBA.BootstrapperCore.config | 6 +- src/WixToolset.WixBA/WixBA.cs | 6 +- src/WixToolset.WixBA/WixBA.csproj | 64 ----------- src/WixToolset.WixBA/WixDistribution.cs | 118 +++++++++++++++++++++ src/WixToolset.WixBA/WixToolset.WixBA.csproj | 76 +++++++++++++ src/WixToolset.WixBA/packages.config | 5 + 21 files changed, 239 insertions(+), 104 deletions(-) delete mode 100644 src/WixToolset.WixBA/WixBA.csproj create mode 100644 src/WixToolset.WixBA/WixDistribution.cs create mode 100644 src/WixToolset.WixBA/WixToolset.WixBA.csproj create mode 100644 src/WixToolset.WixBA/packages.config diff --git a/src/WixToolset.WixBA/BrowserProperties.cs b/src/WixToolset.WixBA/BrowserProperties.cs index f40d4ed9..c8fb6177 100644 --- a/src/WixToolset.WixBA/BrowserProperties.cs +++ b/src/WixToolset.WixBA/BrowserProperties.cs @@ -1,6 +1,6 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System.Windows; using System.Windows.Controls; diff --git a/src/WixToolset.WixBA/Hresult.cs b/src/WixToolset.WixBA/Hresult.cs index 68b4c5ea..a5e552ac 100644 --- a/src/WixToolset.WixBA/Hresult.cs +++ b/src/WixToolset.WixBA/Hresult.cs @@ -1,6 +1,6 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; diff --git a/src/WixToolset.WixBA/InstallationViewModel.cs b/src/WixToolset.WixBA/InstallationViewModel.cs index 6bec427a..35510db4 100644 --- a/src/WixToolset.WixBA/InstallationViewModel.cs +++ b/src/WixToolset.WixBA/InstallationViewModel.cs @@ -1,6 +1,6 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; using System.Collections.Generic; @@ -10,7 +10,7 @@ namespace WixToolset.UX using System.Windows; using System.Windows.Input; using IO = System.IO; - using WixToolset.Bootstrapper; + using WixToolset.BootstrapperCore; /// /// The states of detection. @@ -606,10 +606,10 @@ namespace WixToolset.UX } // If we're not in Full UI mode, we need to alert the dispatcher to stop and close the window for passive. - if (Bootstrapper.Display.Full != WixBA.Model.Command.Display) + if (Display.Full != WixBA.Model.Command.Display) { // If its passive, send a message to the window to close. - if (Bootstrapper.Display.Passive == WixBA.Model.Command.Display) + if (Display.Passive == WixBA.Model.Command.Display) { WixBA.Model.Engine.Log(LogLevel.Verbose, "Automatically closing the window for non-interactive install"); WixBA.Dispatcher.BeginInvoke(new Action(WixBA.View.Close)); diff --git a/src/WixToolset.WixBA/Model.cs b/src/WixToolset.WixBA/Model.cs index 9f03e95b..25415e0f 100644 --- a/src/WixToolset.WixBA/Model.cs +++ b/src/WixToolset.WixBA/Model.cs @@ -1,11 +1,11 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; using System.Collections.Generic; using System.Net; - using WixToolset.Bootstrapper; + using WixToolset.BootstrapperCore; /// /// The model. @@ -17,9 +17,9 @@ namespace WixToolset.UX private const string BurnBundleVersionVariable = "WixBundleVersion"; /// - /// Creates a new model for the UX. + /// Creates a new model for the BA. /// - /// Bootstrapper hosting the UX. + /// The BA. public Model(BootstrapperApplication bootstrapper) { this.Bootstrapper = bootstrapper; diff --git a/src/WixToolset.WixBA/NewsItem.cs b/src/WixToolset.WixBA/NewsItem.cs index a8350104..f8bf7aed 100644 --- a/src/WixToolset.WixBA/NewsItem.cs +++ b/src/WixToolset.WixBA/NewsItem.cs @@ -1,6 +1,6 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; diff --git a/src/WixToolset.WixBA/ProgressViewModel.cs b/src/WixToolset.WixBA/ProgressViewModel.cs index 30aee5f1..bc0fecd0 100644 --- a/src/WixToolset.WixBA/ProgressViewModel.cs +++ b/src/WixToolset.WixBA/ProgressViewModel.cs @@ -5,9 +5,9 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Text.RegularExpressions; -using WixToolset.Bootstrapper; +using WixToolset.BootstrapperCore; -namespace WixToolset.UX +namespace WixToolset.WixBA { public class ProgressViewModel : PropertyNotifyBase { diff --git a/src/WixToolset.WixBA/Properties/AssemblyInfo.cs b/src/WixToolset.WixBA/Properties/AssemblyInfo.cs index 58d88046..566bc9f2 100644 --- a/src/WixToolset.WixBA/Properties/AssemblyInfo.cs +++ b/src/WixToolset.WixBA/Properties/AssemblyInfo.cs @@ -3,12 +3,12 @@ using System; using System.Reflection; using System.Runtime.InteropServices; -using WixToolset.Bootstrapper; -using WixToolset.UX; +using WixToolset.BootstrapperCore; +using WixToolset.WixBA; -[assembly: AssemblyTitle("WixBA")] -[assembly: AssemblyDescription("WiX User Experience")] +[assembly: AssemblyTitle("WixToolset.WixBA")] +[assembly: AssemblyDescription("WiX Bootstrapper Application")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -17,6 +17,6 @@ using WixToolset.UX; [assembly: Guid("0ffc4944-9295-40b7-adac-3a6864b5219b")] [assembly: CLSCompliantAttribute(true)] -// Identifies the class that derives from UserExperience and is the UX class that gets +// Identifies the class that derives from BootstrapperApplication and is the BA class that gets // instantiated by the interop layer [assembly: BootstrapperApplication(typeof(WixBA))] diff --git a/src/WixToolset.WixBA/PropertyNotifyBase.cs b/src/WixToolset.WixBA/PropertyNotifyBase.cs index 03174306..f8264614 100644 --- a/src/WixToolset.WixBA/PropertyNotifyBase.cs +++ b/src/WixToolset.WixBA/PropertyNotifyBase.cs @@ -1,6 +1,6 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; using System.ComponentModel; diff --git a/src/WixToolset.WixBA/RelayCommand.cs b/src/WixToolset.WixBA/RelayCommand.cs index ecc482da..d3ab2d7a 100644 --- a/src/WixToolset.WixBA/RelayCommand.cs +++ b/src/WixToolset.WixBA/RelayCommand.cs @@ -1,6 +1,6 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; using System.Diagnostics; diff --git a/src/WixToolset.WixBA/RootView.xaml b/src/WixToolset.WixBA/RootView.xaml index bbf2f9f2..b7d535d1 100644 --- a/src/WixToolset.WixBA/RootView.xaml +++ b/src/WixToolset.WixBA/RootView.xaml @@ -1,10 +1,10 @@  - + wixba:BrowserProperties.HtmlDoc="{Binding UpdateChanges}" /> /// The errors returned from the engine diff --git a/src/WixToolset.WixBA/Styles.xaml b/src/WixToolset.WixBA/Styles.xaml index 89ccd2ea..fa0afc4f 100644 --- a/src/WixToolset.WixBA/Styles.xaml +++ b/src/WixToolset.WixBA/Styles.xaml @@ -6,7 +6,7 @@ xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework" - xmlns:ux="clr-namespace:WixToolset.UX"> + xmlns:wixba="clr-namespace:WixToolset.WixBA"> @@ -173,7 +173,7 @@ - + diff --git a/src/WixToolset.WixBA/UpdateViewModel.cs b/src/WixToolset.WixBA/UpdateViewModel.cs index 6b60112c..cb6c0ad9 100644 --- a/src/WixToolset.WixBA/UpdateViewModel.cs +++ b/src/WixToolset.WixBA/UpdateViewModel.cs @@ -1,11 +1,11 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; using System.ComponentModel; using System.Windows.Input; - using WixToolset.Bootstrapper; + using WixToolset.BootstrapperCore; /// /// The states of the update view model. @@ -151,7 +151,7 @@ namespace WixToolset.UX } } - private void DetectUpdateBegin(object sender, Bootstrapper.DetectUpdateBeginEventArgs e) + private void DetectUpdateBegin(object sender, DetectUpdateBeginEventArgs e) { // Don't check for updates if: // the first check failed (no retry) @@ -164,7 +164,7 @@ namespace WixToolset.UX } } - private void DetectUpdate(object sender, Bootstrapper.DetectUpdateEventArgs e) + private void DetectUpdate(object sender, DetectUpdateEventArgs e) { // The list of updates is sorted in descending version, so the first callback should be the largest update available. // This update should be either larger than ours (so we are out of date), the same as ours (so we are current) @@ -186,7 +186,7 @@ namespace WixToolset.UX e.StopProcessingUpdates = true; } - private void DetectUpdateComplete(object sender, Bootstrapper.DetectUpdateCompleteEventArgs e) + private void DetectUpdateComplete(object sender, DetectUpdateCompleteEventArgs e) { // Failed to process an update, allow the existing bundle to still install. if ((UpdateState.Failed != this.State) && !Hresult.Succeeded(e.Status)) diff --git a/src/WixToolset.WixBA/WindowProperties.cs b/src/WixToolset.WixBA/WindowProperties.cs index bead5cc1..6d1e273c 100644 --- a/src/WixToolset.WixBA/WindowProperties.cs +++ b/src/WixToolset.WixBA/WindowProperties.cs @@ -1,6 +1,6 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; using System.Windows; diff --git a/src/WixToolset.WixBA/WixBA.BootstrapperCore.config b/src/WixToolset.WixBA/WixBA.BootstrapperCore.config index 8e1d4729..d8439232 100644 --- a/src/WixToolset.WixBA/WixBA.BootstrapperCore.config +++ b/src/WixToolset.WixBA/WixBA.BootstrapperCore.config @@ -3,14 +3,14 @@ - -
+ +
- + diff --git a/src/WixToolset.WixBA/WixBA.cs b/src/WixToolset.WixBA/WixBA.cs index fb69a346..e0444f06 100644 --- a/src/WixToolset.WixBA/WixBA.cs +++ b/src/WixToolset.WixBA/WixBA.cs @@ -1,6 +1,6 @@ // 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 WixToolset.UX +namespace WixToolset.WixBA { using System; using System.Collections.Generic; @@ -12,7 +12,7 @@ namespace WixToolset.UX using Threading = System.Windows.Threading; using WinForms = System.Windows.Forms; - using WixToolset.Bootstrapper; + using WixToolset.BootstrapperCore; /// /// The WiX toolset user experience. @@ -142,7 +142,7 @@ namespace WixToolset.UX } /// - /// Thread entry point for WiX Toolset UX. + /// Thread entry point for WiX Toolset Bootstrapper Application. /// protected override void Run() { diff --git a/src/WixToolset.WixBA/WixBA.csproj b/src/WixToolset.WixBA/WixBA.csproj deleted file mode 100644 index 6858b172..00000000 --- a/src/WixToolset.WixBA/WixBA.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - - {7C27518B-84AD-4679-8EF4-29DF552CF1AC} - WixBA - Library - WixToolset.UX - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - RootView.xaml - - - - - - - - PreserveNewest - Designer - - - - - - - - - - False - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/WixToolset.WixBA/WixDistribution.cs b/src/WixToolset.WixBA/WixDistribution.cs new file mode 100644 index 00000000..6b7ed4f0 --- /dev/null +++ b/src/WixToolset.WixBA/WixDistribution.cs @@ -0,0 +1,118 @@ +// 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. + +using System; +using System.Diagnostics; +using System.Reflection; +using System.Resources; + +[assembly: AssemblyCompany(".NET Foundation")] +[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and contributors. All rights reserved.")] +[assembly: AssemblyProduct("WiX Toolset")] + +#if DEBUG + [assembly: AssemblyConfiguration("DEBUG")] +#else + [assembly: AssemblyConfiguration("")] +#endif +[assembly: NeutralResourcesLanguage("en-US")] + +namespace WixToolset +{ + /// + /// Distribution specific strings. + /// + internal static class WixDistribution + { + /// + /// News URL for the distribution. + /// + public static string NewsUrl = "http://wixtoolset.org/news/"; + + /// + /// Short product name for the distribution. + /// + public static string ShortProduct = "WiX Toolset"; + + /// + /// Support URL for the distribution. + /// + public static string SupportUrl = "http://wixtoolset.org/"; + + /// + /// Telemetry URL format for the distribution. + /// + public static string TelemetryUrlFormat = "http://wixtoolset.org/telemetry/v{0}/?r={1}"; + + /// + /// VS Extensions Landing page Url for the distribution. + /// + public static string VSExtensionsLandingUrl = "http://wixtoolset.org/releases/"; + + public static string ReplacePlaceholders(string original, Assembly assembly) + { + if (null != assembly) + { + FileVersionInfo fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location); + + original = original.Replace("[FileComments]", fileVersion.Comments); + original = original.Replace("[FileCopyright]", fileVersion.LegalCopyright); + original = original.Replace("[FileProductName]", fileVersion.ProductName); + original = original.Replace("[FileVersion]", fileVersion.FileVersion); + + if (original.Contains("[FileVersionMajorMinor]")) + { + Version version = new Version(fileVersion.FileVersion); + original = original.Replace("[FileVersionMajorMinor]", String.Concat(version.Major, ".", version.Minor)); + } + + AssemblyCompanyAttribute company; + if (WixDistribution.TryGetAttribute(assembly, out company)) + { + original = original.Replace("[AssemblyCompany]", company.Company); + } + + AssemblyCopyrightAttribute copyright; + if (WixDistribution.TryGetAttribute(assembly, out copyright)) + { + original = original.Replace("[AssemblyCopyright]", copyright.Copyright); + } + + AssemblyDescriptionAttribute description; + if (WixDistribution.TryGetAttribute(assembly, out description)) + { + original = original.Replace("[AssemblyDescription]", description.Description); + } + + AssemblyProductAttribute product; + if (WixDistribution.TryGetAttribute(assembly, out product)) + { + original = original.Replace("[AssemblyProduct]", product.Product); + } + + AssemblyTitleAttribute title; + if (WixDistribution.TryGetAttribute(assembly, out title)) + { + original = original.Replace("[AssemblyTitle]", title.Title); + } + } + + original = original.Replace("[NewsUrl]", WixDistribution.NewsUrl); + original = original.Replace("[ShortProduct]", WixDistribution.ShortProduct); + original = original.Replace("[SupportUrl]", WixDistribution.SupportUrl); + return original; + } + + private static bool TryGetAttribute(Assembly assembly, out T attribute) where T : Attribute + { + attribute = null; + + object[] customAttributes = assembly.GetCustomAttributes(typeof(T), false); + if (null != customAttributes && 0 < customAttributes.Length) + { + attribute = customAttributes[0] as T; + } + + return null != attribute; + } + } +} diff --git a/src/WixToolset.WixBA/WixToolset.WixBA.csproj b/src/WixToolset.WixBA/WixToolset.WixBA.csproj new file mode 100644 index 00000000..4ce98a03 --- /dev/null +++ b/src/WixToolset.WixBA/WixToolset.WixBA.csproj @@ -0,0 +1,76 @@ + + + + + {7C27518B-84AD-4679-8EF4-29DF552CF1AC} + WixToolset.WixBA + Library + WixToolset.WixBA + v4.5 + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + RootView.xaml + + + + + + + + PreserveNewest + Designer + + + + + + + + + + + False + + + + + + + + + ..\..\packages\WixToolset.BootstrapperCore.4.0.3\lib\net20\WixToolset.BootstrapperCore.dll + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/src/WixToolset.WixBA/packages.config b/src/WixToolset.WixBA/packages.config new file mode 100644 index 00000000..e1757432 --- /dev/null +++ b/src/WixToolset.WixBA/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb