Integrate into latest v4 (2019/02/15).
Sean Hall committed
Feb 15, 2019 at 18:53 UTC
dd40005b0cc376410cd931c9790bdd69551e9aa1
20 files changed
+179
-44
src/WixToolset.WixBA/BrowserProperties.cs
+1
-1
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System.Windows;
6
using System.Windows.Controls;
src/WixToolset.WixBA/Hresult.cs
+1
-1
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
src/WixToolset.WixBA/InstallationViewModel.cs
+4
-4
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
using System.Collections.Generic;
@@ -10,7 +10,7 @@ namespace WixToolset.UX
10
using System.Windows;
11
using System.Windows.Input;
12
using IO = System.IO;
13
- using WixToolset.Bootstrapper;
13
+ using WixToolset.BootstrapperCore;
14
15
/// <summary>
16
/// The states of detection.
@@ -606,10 +606,10 @@ namespace WixToolset.UX
606
}
607
608
// If we're not in Full UI mode, we need to alert the dispatcher to stop and close the window for passive.
609
- if (Bootstrapper.Display.Full != WixBA.Model.Command.Display)
609
+ if (Display.Full != WixBA.Model.Command.Display)
610
{
611
// If its passive, send a message to the window to close.
612
- if (Bootstrapper.Display.Passive == WixBA.Model.Command.Display)
612
+ if (Display.Passive == WixBA.Model.Command.Display)
613
{
614
WixBA.Model.Engine.Log(LogLevel.Verbose, "Automatically closing the window for non-interactive install");
615
WixBA.Dispatcher.BeginInvoke(new Action(WixBA.View.Close));
src/WixToolset.WixBA/Model.cs
+4
-4
@@ -1,11 +1,11 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
using System.Collections.Generic;
7
using System.Net;
8
- using WixToolset.Bootstrapper;
8
+ using WixToolset.BootstrapperCore;
9
10
/// <summary>
11
/// The model.
@@ -17,9 +17,9 @@ namespace WixToolset.UX
17
private const string BurnBundleVersionVariable = "WixBundleVersion";
18
19
/// <summary>
20
- /// Creates a new model for the UX.
20
+ /// Creates a new model for the BA.
21
/// </summary>
22
- /// <param name="bootstrapper">Bootstrapper hosting the UX.</param>
22
+ /// <param name="bootstrapper">The BA.</param>
23
public Model(BootstrapperApplication bootstrapper)
24
{
25
this.Bootstrapper = bootstrapper;
src/WixToolset.WixBA/NewsItem.cs
+1
-1
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
src/WixToolset.WixBA/ProgressViewModel.cs
+2
-2
@@ -5,9 +5,9 @@ using System.Collections.Generic;
5
using System.ComponentModel;
6
using System.Diagnostics;
7
using System.Text.RegularExpressions;
8
-using WixToolset.Bootstrapper;
8
+using WixToolset.BootstrapperCore;
9
10
-namespace WixToolset.UX
10
+namespace WixToolset.WixBA
11
{
12
public class ProgressViewModel : PropertyNotifyBase
13
{
src/WixToolset.WixBA/Properties/AssemblyInfo.cs
+5
-5
@@ -3,12 +3,12 @@
3
using System;
4
using System.Reflection;
5
using System.Runtime.InteropServices;
6
-using WixToolset.Bootstrapper;
7
-using WixToolset.UX;
6
+using WixToolset.BootstrapperCore;
7
+using WixToolset.WixBA;
8
9
10
-[assembly: AssemblyTitle("WixBA")]
11
-[assembly: AssemblyDescription("WiX User Experience")]
10
+[assembly: AssemblyTitle("WixToolset.WixBA")]
11
+[assembly: AssemblyDescription("WiX Bootstrapper Application")]
12
13
// Setting ComVisible to false makes the types in this assembly not visible
14
// to COM components. If you need to access a type in this assembly from
@@ -17,6 +17,6 @@ using WixToolset.UX;
17
[assembly: Guid("0ffc4944-9295-40b7-adac-3a6864b5219b")]
18
[assembly: CLSCompliantAttribute(true)]
19
20
-// Identifies the class that derives from UserExperience and is the UX class that gets
20
+// Identifies the class that derives from BootstrapperApplication and is the BA class that gets
21
// instantiated by the interop layer
22
[assembly: BootstrapperApplication(typeof(WixBA))]
src/WixToolset.WixBA/PropertyNotifyBase.cs
+1
-1
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
using System.ComponentModel;
src/WixToolset.WixBA/RelayCommand.cs
+1
-1
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
using System.Diagnostics;
src/WixToolset.WixBA/RootView.xaml
+3
-3
@@ -1,10 +1,10 @@
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. -->
3
4
-<Window x:Class="WixToolset.UX.RootView"
4
+<Window x:Class="WixToolset.WixBA.RootView"
5
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
6
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
7
- xmlns:ux="clr-namespace:WixToolset.UX"
7
+ xmlns:wixba="clr-namespace:WixToolset.WixBA"
8
MinWidth="550"
9
MinHeight="400"
10
Width="750"
@@ -402,7 +402,7 @@
402
</Grid>
403
404
<WebBrowser DockPanel.Dock="Bottom"
405
- ux:BrowserProperties.HtmlDoc="{Binding UpdateChanges}" />
405
+ wixba:BrowserProperties.HtmlDoc="{Binding UpdateChanges}" />
406
</DockPanel>
407
408
<TextBlock x:Name="DowngradeMessageTextBlk"
src/WixToolset.WixBA/RootView.xaml.cs
+1
-1
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System.ComponentModel;
6
using System.Windows;
src/WixToolset.WixBA/RootViewModel.cs
+2
-2
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
using System.Diagnostics;
@@ -8,7 +8,7 @@ namespace WixToolset.UX
8
using System.Windows;
9
using System.Windows.Input;
10
using System.Windows.Threading;
11
- using WixToolset.Bootstrapper;
11
+ using WixToolset.BootstrapperCore;
12
13
/// <summary>
14
/// The errors returned from the engine
src/WixToolset.WixBA/Styles.xaml
+2
-2
@@ -6,7 +6,7 @@
6
xmlns:System="clr-namespace:System;assembly=mscorlib"
7
xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
8
xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
9
- xmlns:ux="clr-namespace:WixToolset.UX">
9
+ xmlns:wixba="clr-namespace:WixToolset.WixBA">
10
11
<!-- Converters -->
12
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
@@ -173,7 +173,7 @@
173
<Setter Property="IsHitTestVisible" Value="False" />
174
<Setter Property="Source" Value="{DynamicResource LogoOverLightBackground}" />
175
<Style.Triggers>
176
- <DataTrigger Binding="{Binding Path=IsLightBackground, Source={x:Static ux:WindowProperties.Instance}}" Value="false">
176
+ <DataTrigger Binding="{Binding Path=IsLightBackground, Source={x:Static wixba:WindowProperties.Instance}}" Value="false">
177
<Setter Property="Source" Value="{DynamicResource LogoOverDarkBackground}" />
178
</DataTrigger>
179
</Style.Triggers>
src/WixToolset.WixBA/UpdateViewModel.cs
+5
-5
@@ -1,11 +1,11 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
using System.ComponentModel;
7
using System.Windows.Input;
8
- using WixToolset.Bootstrapper;
8
+ using WixToolset.BootstrapperCore;
9
10
/// <summary>
11
/// The states of the update view model.
@@ -151,7 +151,7 @@ namespace WixToolset.UX
151
}
152
}
153
154
- private void DetectUpdateBegin(object sender, Bootstrapper.DetectUpdateBeginEventArgs e)
154
+ private void DetectUpdateBegin(object sender, DetectUpdateBeginEventArgs e)
155
{
156
// Don't check for updates if:
157
// the first check failed (no retry)
@@ -164,7 +164,7 @@ namespace WixToolset.UX
164
}
165
}
166
167
- private void DetectUpdate(object sender, Bootstrapper.DetectUpdateEventArgs e)
167
+ private void DetectUpdate(object sender, DetectUpdateEventArgs e)
168
{
169
// The list of updates is sorted in descending version, so the first callback should be the largest update available.
170
// 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
186
e.StopProcessingUpdates = true;
187
}
188
189
- private void DetectUpdateComplete(object sender, Bootstrapper.DetectUpdateCompleteEventArgs e)
189
+ private void DetectUpdateComplete(object sender, DetectUpdateCompleteEventArgs e)
190
{
191
// Failed to process an update, allow the existing bundle to still install.
192
if ((UpdateState.Failed != this.State) && !Hresult.Succeeded(e.Status))
src/WixToolset.WixBA/WindowProperties.cs
+1
-1
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
using System.Windows;
src/WixToolset.WixBA/WixBA.BootstrapperCore.config
+3
-3
@@ -3,14 +3,14 @@
3
4
<configuration>
5
<configSections>
6
- <sectionGroup name="wix.bootstrapper" type="WixToolset.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
7
- <section name="host" type="WixToolset.Bootstrapper.HostSection, BootstrapperCore" />
6
+ <sectionGroup name="wix.bootstrapper" type="WixToolset.BootstrapperCore.BootstrapperSectionGroup, WixToolset.BootstrapperCore">
7
+ <section name="host" type="WixToolset.BootstrapperCore.HostSection, WixToolset.BootstrapperCore" />
8
</sectionGroup>
9
</configSections>
10
<startup useLegacyV2RuntimeActivationPolicy="true">
11
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
12
</startup>
13
<wix.bootstrapper>
14
- <host assemblyName="WixBA" />
14
+ <host assemblyName="WixToolset.WixBA" />
15
</wix.bootstrapper>
16
</configuration>
src/WixToolset.WixBA/WixBA.cs
+3
-3
@@ -1,6 +1,6 @@
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
3
-namespace WixToolset.UX
3
+namespace WixToolset.WixBA
4
{
5
using System;
6
using System.Collections.Generic;
@@ -12,7 +12,7 @@ namespace WixToolset.UX
12
using Threading = System.Windows.Threading;
13
using WinForms = System.Windows.Forms;
14
15
- using WixToolset.Bootstrapper;
15
+ using WixToolset.BootstrapperCore;
16
17
/// <summary>
18
/// The WiX toolset user experience.
@@ -142,7 +142,7 @@ namespace WixToolset.UX
142
}
143
144
/// <summary>
145
- /// Thread entry point for WiX Toolset UX.
145
+ /// Thread entry point for WiX Toolset Bootstrapper Application.
146
/// </summary>
147
protected override void Run()
148
{
src/WixToolset.WixBA/WixDistribution.cs
new
+118
@@ -0,0 +1,118 @@
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
+
3
+using System;
4
+using System.Diagnostics;
5
+using System.Reflection;
6
+using System.Resources;
7
+
8
+[assembly: AssemblyCompany(".NET Foundation")]
9
+[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and contributors. All rights reserved.")]
10
+[assembly: AssemblyProduct("WiX Toolset")]
11
+
12
+#if DEBUG
13
+ [assembly: AssemblyConfiguration("DEBUG")]
14
+#else
15
+ [assembly: AssemblyConfiguration("")]
16
+#endif
17
+[assembly: NeutralResourcesLanguage("en-US")]
18
+
19
+namespace WixToolset
20
+{
21
+ /// <summary>
22
+ /// Distribution specific strings.
23
+ /// </summary>
24
+ internal static class WixDistribution
25
+ {
26
+ /// <summary>
27
+ /// News URL for the distribution.
28
+ /// </summary>
29
+ public static string NewsUrl = "http://wixtoolset.org/news/";
30
+
31
+ /// <summary>
32
+ /// Short product name for the distribution.
33
+ /// </summary>
34
+ public static string ShortProduct = "WiX Toolset";
35
+
36
+ /// <summary>
37
+ /// Support URL for the distribution.
38
+ /// </summary>
39
+ public static string SupportUrl = "http://wixtoolset.org/";
40
+
41
+ /// <summary>
42
+ /// Telemetry URL format for the distribution.
43
+ /// </summary>
44
+ public static string TelemetryUrlFormat = "http://wixtoolset.org/telemetry/v{0}/?r={1}";
45
+
46
+ /// <summary>
47
+ /// VS Extensions Landing page Url for the distribution.
48
+ /// </summary>
49
+ public static string VSExtensionsLandingUrl = "http://wixtoolset.org/releases/";
50
+
51
+ public static string ReplacePlaceholders(string original, Assembly assembly)
52
+ {
53
+ if (null != assembly)
54
+ {
55
+ FileVersionInfo fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);
56
+
57
+ original = original.Replace("[FileComments]", fileVersion.Comments);
58
+ original = original.Replace("[FileCopyright]", fileVersion.LegalCopyright);
59
+ original = original.Replace("[FileProductName]", fileVersion.ProductName);
60
+ original = original.Replace("[FileVersion]", fileVersion.FileVersion);
61
+
62
+ if (original.Contains("[FileVersionMajorMinor]"))
63
+ {
64
+ Version version = new Version(fileVersion.FileVersion);
65
+ original = original.Replace("[FileVersionMajorMinor]", String.Concat(version.Major, ".", version.Minor));
66
+ }
67
+
68
+ AssemblyCompanyAttribute company;
69
+ if (WixDistribution.TryGetAttribute(assembly, out company))
70
+ {
71
+ original = original.Replace("[AssemblyCompany]", company.Company);
72
+ }
73
+
74
+ AssemblyCopyrightAttribute copyright;
75
+ if (WixDistribution.TryGetAttribute(assembly, out copyright))
76
+ {
77
+ original = original.Replace("[AssemblyCopyright]", copyright.Copyright);
78
+ }
79
+
80
+ AssemblyDescriptionAttribute description;
81
+ if (WixDistribution.TryGetAttribute(assembly, out description))
82
+ {
83
+ original = original.Replace("[AssemblyDescription]", description.Description);
84
+ }
85
+
86
+ AssemblyProductAttribute product;
87
+ if (WixDistribution.TryGetAttribute(assembly, out product))
88
+ {
89
+ original = original.Replace("[AssemblyProduct]", product.Product);
90
+ }
91
+
92
+ AssemblyTitleAttribute title;
93
+ if (WixDistribution.TryGetAttribute(assembly, out title))
94
+ {
95
+ original = original.Replace("[AssemblyTitle]", title.Title);
96
+ }
97
+ }
98
+
99
+ original = original.Replace("[NewsUrl]", WixDistribution.NewsUrl);
100
+ original = original.Replace("[ShortProduct]", WixDistribution.ShortProduct);
101
+ original = original.Replace("[SupportUrl]", WixDistribution.SupportUrl);
102
+ return original;
103
+ }
104
+
105
+ private static bool TryGetAttribute<T>(Assembly assembly, out T attribute) where T : Attribute
106
+ {
107
+ attribute = null;
108
+
109
+ object[] customAttributes = assembly.GetCustomAttributes(typeof(T), false);
110
+ if (null != customAttributes && 0 < customAttributes.Length)
111
+ {
112
+ attribute = customAttributes[0] as T;
113
+ }
114
+
115
+ return null != attribute;
116
+ }
117
+ }
118
+}
src/WixToolset.WixBA/WixToolset.WixBA.csproj
renamed
+16
-4
@@ -3,9 +3,10 @@
3
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
4
<PropertyGroup>
5
<ProjectGuid>{7C27518B-84AD-4679-8EF4-29DF552CF1AC}</ProjectGuid>
6
- <AssemblyName>WixBA</AssemblyName>
6
+ <AssemblyName>WixToolset.WixBA</AssemblyName>
7
<OutputType>Library</OutputType>
8
- <RootNamespace>WixToolset.UX</RootNamespace>
8
+ <RootNamespace>WixToolset.WixBA</RootNamespace>
9
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
10
</PropertyGroup>
11
<ItemGroup>
12
<Compile Include="Hresult.cs" />
@@ -15,6 +16,7 @@
16
<Compile Include="ProgressViewModel.cs" />
17
<Compile Include="RelayCommand.cs" />
18
<Compile Include="InstallationViewModel.cs" />
19
+ <Compile Include="WixDistribution.cs" />
20
<Page Include="Styles.xaml">
21
<Generator>MSBuild:Compile</Generator>
22
<SubType>Designer</SubType>
@@ -36,6 +38,7 @@
38
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
39
<SubType>Designer</SubType>
40
</None>
41
+ <None Include="packages.config" />
42
</ItemGroup>
43
<ItemGroup>
44
<Reference Include="PresentationCore" />
@@ -52,7 +55,9 @@
55
<Reference Include="System.Xml" />
56
<Reference Include="System.Xaml" />
57
<Reference Include="WindowsBase" />
55
- <ProjectReference Include="..\..\ext\BalExtension\mba\core\core.csproj" />
58
+ <Reference Include="WixToolset.BootstrapperCore">
59
+ <HintPath>..\..\packages\WixToolset.BootstrapperCore.4.0.3\lib\net20\WixToolset.BootstrapperCore.dll</HintPath>
60
+ </Reference>
61
</ItemGroup>
62
<ItemGroup>
63
<Resource Include="Resources\logo-white-hollow.png" />
@@ -60,5 +65,12 @@
65
<ItemGroup>
66
<Resource Include="Resources\logo-black-hollow.png" />
67
</ItemGroup>
63
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
68
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
69
+ <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" />
70
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
71
+ <PropertyGroup>
72
+ <ErrorText>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}.</ErrorText>
73
+ </PropertyGroup>
74
+ <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
75
+ </Target>
76
</Project>
\ No newline at end of file
src/WixToolset.WixBA/packages.config
new
+5
@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+ <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="net45" developmentDependency="true" />
4
+ <package id="WixToolset.BootstrapperCore" version="4.0.3" targetFramework="net45" />
5
+</packages>
\ No newline at end of file