diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-05-06 14:42:01 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-05-11 19:11:19 -0500 |
commit | a91c413750b354ba6975be9d427787b13664b750 (patch) | |
tree | 230c04174a3f01e15fbed26fc70a4101276c595f /src/test/burn/WixToolset.WixBA | |
parent | 8c27fbe1bc8a6d83859aead2105d6d528c307726 (diff) | |
download | wix-a91c413750b354ba6975be9d427787b13664b750.tar.gz wix-a91c413750b354ba6975be9d427787b13664b750.tar.bz2 wix-a91c413750b354ba6975be9d427787b13664b750.zip |
Add tests for WixBA.
Diffstat (limited to 'src/test/burn/WixToolset.WixBA')
-rw-r--r-- | src/test/burn/WixToolset.WixBA/InstallationViewModel.cs | 4 | ||||
-rw-r--r-- | src/test/burn/WixToolset.WixBA/RootView.xaml | 2 | ||||
-rw-r--r-- | src/test/burn/WixToolset.WixBA/Styles.xaml | 4 | ||||
-rw-r--r-- | src/test/burn/WixToolset.WixBA/UpdateViewModel.cs | 11 | ||||
-rw-r--r-- | src/test/burn/WixToolset.WixBA/WixBA.cs | 8 | ||||
-rw-r--r-- | src/test/burn/WixToolset.WixBA/WixToolset.WixBA.csproj | 30 | ||||
-rw-r--r-- | src/test/burn/WixToolset.WixBA/WixToolset.WixBA_x64.csproj | 40 |
7 files changed, 69 insertions, 30 deletions
diff --git a/src/test/burn/WixToolset.WixBA/InstallationViewModel.cs b/src/test/burn/WixToolset.WixBA/InstallationViewModel.cs index 2beebd02..410ab110 100644 --- a/src/test/burn/WixToolset.WixBA/InstallationViewModel.cs +++ b/src/test/burn/WixToolset.WixBA/InstallationViewModel.cs | |||
@@ -461,8 +461,8 @@ namespace WixToolset.WixBA | |||
461 | 461 | ||
462 | private void PlanPackageBegin(object sender, PlanPackageBeginEventArgs e) | 462 | private void PlanPackageBegin(object sender, PlanPackageBeginEventArgs e) |
463 | { | 463 | { |
464 | // If we're able to run our BA, we don't want to install the .NET Framework since the framework on the machine is already good enough. | 464 | // If we're able to run our BA, we don't want to install .NET since the one on the machine is already good enough. |
465 | if ( e.PackageId.StartsWith("NetFx4", StringComparison.OrdinalIgnoreCase)) | 465 | if (e.PackageId.StartsWith("NetFx4", StringComparison.OrdinalIgnoreCase) || e.PackageId.StartsWith("DesktopNetCoreRuntime", StringComparison.OrdinalIgnoreCase)) |
466 | { | 466 | { |
467 | e.State = RequestState.None; | 467 | e.State = RequestState.None; |
468 | } | 468 | } |
diff --git a/src/test/burn/WixToolset.WixBA/RootView.xaml b/src/test/burn/WixToolset.WixBA/RootView.xaml index b7d535d1..df638c4d 100644 --- a/src/test/burn/WixToolset.WixBA/RootView.xaml +++ b/src/test/burn/WixToolset.WixBA/RootView.xaml | |||
@@ -19,7 +19,7 @@ | |||
19 | <Window.Resources> | 19 | <Window.Resources> |
20 | <ResourceDictionary> | 20 | <ResourceDictionary> |
21 | <ResourceDictionary.MergedDictionaries> | 21 | <ResourceDictionary.MergedDictionaries> |
22 | <ResourceDictionary Source="pack://application:,,,/WixBA;component/Styles.xaml" /> | 22 | <ResourceDictionary Source="pack://application:,,,/WixToolset.WixBA;component/Styles.xaml" /> |
23 | </ResourceDictionary.MergedDictionaries> | 23 | </ResourceDictionary.MergedDictionaries> |
24 | </ResourceDictionary> | 24 | </ResourceDictionary> |
25 | </Window.Resources> | 25 | </Window.Resources> |
diff --git a/src/test/burn/WixToolset.WixBA/Styles.xaml b/src/test/burn/WixToolset.WixBA/Styles.xaml index fa0afc4f..4e0b21a8 100644 --- a/src/test/burn/WixToolset.WixBA/Styles.xaml +++ b/src/test/burn/WixToolset.WixBA/Styles.xaml | |||
@@ -18,8 +18,8 @@ | |||
18 | <System:Double x:Key="FontSizeButton">14</System:Double> | 18 | <System:Double x:Key="FontSizeButton">14</System:Double> |
19 | 19 | ||
20 | <!-- Images --> | 20 | <!-- Images --> |
21 | <BitmapImage x:Key="LogoOverLightBackground" UriSource="pack://application:,,,/WixBA;component/resources/logo-white-hollow.png" /> | 21 | <BitmapImage x:Key="LogoOverLightBackground" UriSource="pack://application:,,,/WixToolset.WixBA;component/resources/logo-white-hollow.png" /> |
22 | <BitmapImage x:Key="LogoOverDarkBackground" UriSource="pack://application:,,,/WixBA;component/resources/logo-black-hollow.png" /> | 22 | <BitmapImage x:Key="LogoOverDarkBackground" UriSource="pack://application:,,,/WixToolset.WixBA;component/resources/logo-black-hollow.png" /> |
23 | 23 | ||
24 | <!-- Colors --> | 24 | <!-- Colors --> |
25 | <Color x:Key="ProgressIndicatorColor">#FF1EF1E8</Color> | 25 | <Color x:Key="ProgressIndicatorColor">#FF1EF1E8</Color> |
diff --git a/src/test/burn/WixToolset.WixBA/UpdateViewModel.cs b/src/test/burn/WixToolset.WixBA/UpdateViewModel.cs index 80d894cb..dc98c858 100644 --- a/src/test/burn/WixToolset.WixBA/UpdateViewModel.cs +++ b/src/test/burn/WixToolset.WixBA/UpdateViewModel.cs | |||
@@ -38,6 +38,7 @@ namespace WixToolset.WixBA | |||
38 | WixBA.Model.Bootstrapper.DetectUpdateBegin += this.DetectUpdateBegin; | 38 | WixBA.Model.Bootstrapper.DetectUpdateBegin += this.DetectUpdateBegin; |
39 | WixBA.Model.Bootstrapper.DetectUpdate += this.DetectUpdate; | 39 | WixBA.Model.Bootstrapper.DetectUpdate += this.DetectUpdate; |
40 | WixBA.Model.Bootstrapper.DetectUpdateComplete += this.DetectUpdateComplete; | 40 | WixBA.Model.Bootstrapper.DetectUpdateComplete += this.DetectUpdateComplete; |
41 | WixBA.Model.Bootstrapper.DetectComplete += this.DetectComplete; | ||
41 | 42 | ||
42 | this.root.PropertyChanged += new PropertyChangedEventHandler(this.RootPropertyChanged); | 43 | this.root.PropertyChanged += new PropertyChangedEventHandler(this.RootPropertyChanged); |
43 | 44 | ||
@@ -201,7 +202,15 @@ namespace WixToolset.WixBA | |||
201 | else if ((LaunchAction.Uninstall == WixBA.Model.Command.Action) || (UpdateState.Initializing == this.State) || (UpdateState.Checking == this.State)) | 202 | else if ((LaunchAction.Uninstall == WixBA.Model.Command.Action) || (UpdateState.Initializing == this.State) || (UpdateState.Checking == this.State)) |
202 | { | 203 | { |
203 | this.State = UpdateState.Unknown; | 204 | this.State = UpdateState.Unknown; |
204 | } | 205 | } |
206 | } | ||
207 | |||
208 | private void DetectComplete(object sender, DetectCompleteEventArgs e) | ||
209 | { | ||
210 | if (this.State == UpdateState.Initializing || this.State == UpdateState.Checking) | ||
211 | { | ||
212 | this.State = UpdateState.Unknown; | ||
213 | } | ||
205 | } | 214 | } |
206 | } | 215 | } |
207 | } | 216 | } |
diff --git a/src/test/burn/WixToolset.WixBA/WixBA.cs b/src/test/burn/WixToolset.WixBA/WixBA.cs index 2d680c7e..68288f2d 100644 --- a/src/test/burn/WixToolset.WixBA/WixBA.cs +++ b/src/test/burn/WixToolset.WixBA/WixBA.cs | |||
@@ -163,19 +163,19 @@ namespace WixToolset.WixBA | |||
163 | WixBA.Model = new Model(this); | 163 | WixBA.Model = new Model(this); |
164 | WixBA.Dispatcher = Threading.Dispatcher.CurrentDispatcher; | 164 | WixBA.Dispatcher = Threading.Dispatcher.CurrentDispatcher; |
165 | RootViewModel viewModel = new RootViewModel(); | 165 | RootViewModel viewModel = new RootViewModel(); |
166 | 166 | WixBA.View = new RootView(viewModel); | |
167 | // Kick off detect which will populate the view models. | ||
168 | this.Engine.Detect(); | ||
169 | 167 | ||
170 | // Create a Window to show UI. | 168 | // Create a Window to show UI. |
171 | if (WixBA.Model.Command.Display == Display.Passive || | 169 | if (WixBA.Model.Command.Display == Display.Passive || |
172 | WixBA.Model.Command.Display == Display.Full) | 170 | WixBA.Model.Command.Display == Display.Full) |
173 | { | 171 | { |
174 | this.Engine.Log(LogLevel.Verbose, "Creating a UI."); | 172 | this.Engine.Log(LogLevel.Verbose, "Creating a UI."); |
175 | WixBA.View = new RootView(viewModel); | ||
176 | WixBA.View.Show(); | 173 | WixBA.View.Show(); |
177 | } | 174 | } |
178 | 175 | ||
176 | // Kick off detect which will populate the view models. | ||
177 | this.Engine.Detect(); | ||
178 | |||
179 | Threading.Dispatcher.Run(); | 179 | Threading.Dispatcher.Run(); |
180 | 180 | ||
181 | this.PostTelemetry(); | 181 | this.PostTelemetry(); |
diff --git a/src/test/burn/WixToolset.WixBA/WixToolset.WixBA.csproj b/src/test/burn/WixToolset.WixBA/WixToolset.WixBA.csproj index 72ef5795..2a2a0073 100644 --- a/src/test/burn/WixToolset.WixBA/WixToolset.WixBA.csproj +++ b/src/test/burn/WixToolset.WixBA/WixToolset.WixBA.csproj | |||
@@ -2,7 +2,7 @@ | |||
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 Sdk="Microsoft.NET.Sdk"> | 3 | <Project Sdk="Microsoft.NET.Sdk"> |
4 | <PropertyGroup> | 4 | <PropertyGroup> |
5 | <TargetFramework>net45</TargetFramework> | 5 | <TargetFrameworks>net45;net5.0-windows</TargetFrameworks> |
6 | <AssemblyName>WixToolset.WixBA</AssemblyName> | 6 | <AssemblyName>WixToolset.WixBA</AssemblyName> |
7 | <RootNamespace>WixToolset.WixBA</RootNamespace> | 7 | <RootNamespace>WixToolset.WixBA</RootNamespace> |
8 | <DebugType>embedded</DebugType> | 8 | <DebugType>embedded</DebugType> |
@@ -13,38 +13,28 @@ | |||
13 | <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> | 13 | <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
14 | <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute> | 14 | <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute> |
15 | <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> | 15 | <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
16 | <EnableDynamicLoading>true</EnableDynamicLoading> | ||
17 | <UseWPF>true</UseWPF> | ||
18 | <RollForward>Major</RollForward> | ||
19 | <!-- https://stackoverflow.com/questions/58844785/how-to-reference-system-windows-forms-in-net-core-3-0-for-wpf-apps --> | ||
20 | <UseWindowsForms>true</UseWindowsForms> | ||
16 | </PropertyGroup> | 21 | </PropertyGroup> |
17 | <ItemGroup> | 22 | <ItemGroup Condition="'$(TargetFramework)'=='net45'"> |
18 | <Page Include="Styles.xaml"> | 23 | <Content Include="WixBA.BootstrapperCore.config" CopyToOutputDirectory="PreserveNewest" /> |
19 | <Generator>MSBuild:Compile</Generator> | ||
20 | <SubType>Designer</SubType> | ||
21 | </Page> | ||
22 | <Page Include="RootView.xaml"> | ||
23 | <Generator>MSBuild:Compile</Generator> | ||
24 | <SubType>Designer</SubType> | ||
25 | </Page> | ||
26 | <None Include="WixBA.BootstrapperCore.config"> | ||
27 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
28 | <SubType>Designer</SubType> | ||
29 | </None> | ||
30 | </ItemGroup> | 24 | </ItemGroup> |
31 | <ItemGroup> | 25 | <ItemGroup> |
32 | <Resource Include="Resources\logo-white-hollow.png" /> | 26 | <Resource Include="Resources\logo-white-hollow.png" /> |
33 | <Resource Include="Resources\logo-black-hollow.png" /> | 27 | <Resource Include="Resources\logo-black-hollow.png" /> |
34 | </ItemGroup> | 28 | </ItemGroup> |
35 | <ItemGroup> | 29 | <ItemGroup Condition="'$(TargetFramework)'=='net45'"> |
36 | <Reference Include="PresentationCore" /> | 30 | <Reference Include="PresentationCore" /> |
37 | <Reference Include="PresentationFramework" /> | 31 | <Reference Include="PresentationFramework" /> |
38 | <Reference Include="System.Windows.Forms" /> | 32 | <Reference Include="System.Windows.Forms" /> |
39 | <Reference Include="System.Xaml" /> | 33 | <Reference Include="System.Xaml" /> |
40 | <Reference Include="WindowsBase" /> | 34 | <Reference Include="WindowsBase" /> |
41 | </ItemGroup> | 35 | </ItemGroup> |
42 | <ItemGroup> | ||
43 | <PackageReference Include="WixToolset.Mba.Core" Version="4.0.0-preview.0-build.0" /> | ||
44 | </ItemGroup> | ||
45 | 36 | ||
46 | <ItemGroup> | 37 | <ItemGroup> |
47 | <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> | 38 | <PackageReference Include="WixToolset.Mba.Core" /> |
48 | <PackageReference Include="GitInfo" Version="2.1.2" PrivateAssets="All" /> | ||
49 | </ItemGroup> | 39 | </ItemGroup> |
50 | </Project> \ No newline at end of file | 40 | </Project> \ No newline at end of file |
diff --git a/src/test/burn/WixToolset.WixBA/WixToolset.WixBA_x64.csproj b/src/test/burn/WixToolset.WixBA/WixToolset.WixBA_x64.csproj new file mode 100644 index 00000000..bc1aa7bf --- /dev/null +++ b/src/test/burn/WixToolset.WixBA/WixToolset.WixBA_x64.csproj | |||
@@ -0,0 +1,40 @@ | |||
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 | <Project Sdk="Microsoft.NET.Sdk"> | ||
4 | <PropertyGroup> | ||
5 | <TargetFrameworks>net45;net5.0-windows</TargetFrameworks> | ||
6 | <AssemblyName>WixToolset.WixBA</AssemblyName> | ||
7 | <RootNamespace>WixToolset.WixBA</RootNamespace> | ||
8 | <DebugType>embedded</DebugType> | ||
9 | <RuntimeIdentifier>win-x64</RuntimeIdentifier> | ||
10 | <AssemblyTitle>WixToolset.WixBA</AssemblyTitle> | ||
11 | <Description>WiX Bootstrapper Application</Description> | ||
12 | <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> | ||
13 | <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> | ||
14 | <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute> | ||
15 | <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> | ||
16 | <EnableDynamicLoading>true</EnableDynamicLoading> | ||
17 | <UseWPF>true</UseWPF> | ||
18 | <RollForward>Major</RollForward> | ||
19 | <!-- https://stackoverflow.com/questions/58844785/how-to-reference-system-windows-forms-in-net-core-3-0-for-wpf-apps --> | ||
20 | <UseWindowsForms>true</UseWindowsForms> | ||
21 | </PropertyGroup> | ||
22 | <ItemGroup Condition="'$(TargetFramework)'=='net45'"> | ||
23 | <Content Include="WixBA.BootstrapperCore.config" CopyToOutputDirectory="PreserveNewest" /> | ||
24 | </ItemGroup> | ||
25 | <ItemGroup> | ||
26 | <Resource Include="Resources\logo-white-hollow.png" /> | ||
27 | <Resource Include="Resources\logo-black-hollow.png" /> | ||
28 | </ItemGroup> | ||
29 | <ItemGroup Condition="'$(TargetFramework)'=='net45'"> | ||
30 | <Reference Include="PresentationCore" /> | ||
31 | <Reference Include="PresentationFramework" /> | ||
32 | <Reference Include="System.Windows.Forms" /> | ||
33 | <Reference Include="System.Xaml" /> | ||
34 | <Reference Include="WindowsBase" /> | ||
35 | </ItemGroup> | ||
36 | |||
37 | <ItemGroup> | ||
38 | <PackageReference Include="WixToolset.Mba.Core" /> | ||
39 | </ItemGroup> | ||
40 | </Project> \ No newline at end of file | ||