Skip to content

Commit

Permalink
Update packages. Moved to .NET 8.0. Updated about box and license list.
Browse files Browse the repository at this point in the history
  • Loading branch information
ww898 committed Jun 15, 2024
1 parent 35452e1 commit 1cf76d3
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 38 deletions.
3 changes: 1 addition & 2 deletions JetBrains.Etw.HostService.Updater/src/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows;
using JetBrains.Annotations;
Expand All @@ -20,7 +19,7 @@ private void OnStartup(object sender, StartupEventArgs e)
{
var logDir = Path.Combine(Path.GetTempPath(), "JetLogs", "EtwHost");
Directory.CreateDirectory(logDir);

var combine = Path.Combine(logDir, typeof(App).Namespace + $"_{DateTime.Now:yyyyMMdd_HHmmss}.log");
var logFile = File.CreateText(combine);
logFile.AutoFlush = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net462;net7.0-windows</TargetFrameworks>
<TargetFrameworks>net462;net8.0-windows</TargetFrameworks>
<RootNamespace>JetBrains.Etw.HostService.Updater</RootNamespace>
<AssemblyName>EtwHostServiceUpdater</AssemblyName>
<UseWPF>true</UseWPF>
Expand All @@ -14,17 +14,17 @@
<Company>JetBrains s.r.o.</Company>
<Copyright>Copyright © 2021-$([System.DateTime]::Now.ToString('yyyy')) JetBrains s.r.o.</Copyright>
<Authors>Mikhail Pilin</Authors>
<Version>16.1.1</Version>
<Version>16.1.2</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
<PackageReference Include="HtmlSanitizer" Version="8.0.645" />
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="All" />
<PackageReference Include="JetBrains.DownloadPgpVerifier" Version="1.0.0" />
<PackageReference Include="JetBrains.HabitatDetector" Version="1.0.2" />
<PackageReference Include="HtmlSanitizer" Version="8.0.865" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="JetBrains.DownloadPgpVerifier" Version="1.0.1" />
<PackageReference Include="JetBrains.HabitatDetector" Version="1.4.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="7.0.2" />
<PackageReference Include="WixToolset.Dtf.WindowsInstaller" Version="4.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="WixToolset.Dtf.WindowsInstaller" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<Resource Include="EtwHostService.ico" />
Expand Down
17 changes: 9 additions & 8 deletions JetBrains.Etw.HostService.Updater/src/Util/UpdateChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ namespace JetBrains.Etw.HostService.Updater.Util
internal static class UpdateChecker
{
[Flags]
[System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")]
public enum Channels
{
Release = 0x1,
Rc = 0x2,
Eap = 0x4
RTM = 0x1,
RC = 0x2,
EAP = 0x4
}

public static readonly TimeSpan DefaultCheckInterval = TimeSpan.FromDays(1);
Expand All @@ -31,7 +32,7 @@ public static UpdateRequest Check(
[NotNull] string productCode,
[NotNull] Version productVersion,
Guid anonymousPermanentUserId,
Channels channels = Channels.Release)
Channels channels = Channels.RTM)
{
if (logger == null) throw new ArgumentNullException(nameof(logger));
if (baseUri == null) throw new ArgumentNullException(nameof(baseUri));
Expand Down Expand Up @@ -106,7 +107,7 @@ public static UpdateRequest Check(
var whatsNewHtml = releaseElement.GetStringPropertyEx("whatsnew");
logger.Info($"{loggerContext} res=found version={version} size={size}\n\tlink={link}\n\tchecksumLink={checksumLink}\n\tsignedChecksumLink={signedChecksumLink}");
return new UpdateRequest
{
Version = version,
Expand Down Expand Up @@ -148,9 +149,9 @@ private static string GetOsName()
private static IReadOnlyCollection<string> GetReleaseTypes(Channels channels)
{
var res = new List<string>();
if ((channels & Channels.Release) != 0) res.Add("release");
if ((channels & Channels.Rc) != 0) res.Add("rc");
if ((channels & Channels.Eap) != 0) res.Add("eap");
if ((channels & Channels.RTM) != 0) res.Add("release");
if ((channels & Channels.RC) != 0) res.Add("rc");
if ((channels & Channels.EAP) != 0) res.Add("eap");
return res;
}

Expand Down
34 changes: 23 additions & 11 deletions JetBrains.Etw.HostService.Updater/src/ViewModel/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,30 @@ internal sealed class AboutViewModel : INotifyPropertyChanged
public string ToolVersion => App.ToolVersion;
public string ProcessArchitecture => HabitatInfo.ProcessArchitecture.ToPresentableString();

public IEnumerable<LicenseItemViewModel> Licenses => new LicenseItemViewModel[]
public IEnumerable<LicenseItemViewModel> Licenses
{
get
{
// @formatter:off
new("Hardcodet.NotifyIcon.Wpf" , "1.1.0" , "Code Project Open License 1.02" , new Uri("https://spdx.org/licenses/CPOL-1.02.html")),
new("HtmlSanitizer" , "8.0.645", "MIT License (Michael Ganss and Contributors)", new Uri("https://spdx.org/licenses/MIT.html")),
new("JetBrains.DownloadPgpVerifier" , "1.0.0" , "Apache License 2.0" , new Uri("https://spdx.org/licenses/Apache-2.0.html")),
new("JetBrains.FormatRipper" , "2.0.1" , "Apache License 2.0" , new Uri("https://spdx.org/licenses/Apache-2.0.html")),
new("JetBrains.HabitatDetector" , "1.0.2" , "Apache License 2.0" , new Uri("https://spdx.org/licenses/Apache-2.0.html")),
new("System.Text.Json" , "7.0.2" , "MIT License (Microsoft Corporation)" , new Uri("https://spdx.org/licenses/MIT.html")),
new("WixToolset.Dtf.WindowsInstaller", "4.0.0" , "Microsoft Reciprocal License" , new Uri("https://spdx.org/licenses/MS-RL.html")),
// @formatter:on
};
const string mitName = "MIT License";
const string apache20Name = "Apache License 2.0";
var mitUri = new Uri("https://spdx.org/licenses/MIT.html");
var apache20Uri = new Uri("https://spdx.org/licenses/Apache-2.0.html");
return new LicenseItemViewModel[]
{
// @formatter:off
new("BouncyCastle.Cryptography" , "2.4.0" , "MIT License (2000-2024 Legion of the Bouncy Castle Inc.)", mitUri),
new("Hardcodet.NotifyIcon.Wpf" , "1.1.0" , "Code Project Open License 1.02" , new Uri("https://spdx.org/licenses/CPOL-1.02.html")),
new("HtmlSanitizer" , "8.0.865" , mitName + " (2013-2024 Michael Ganss)" , mitUri),
new("JetBrains.Annotations" , "2023.3.0", mitName + " (2016-2024 JetBrains s.r.o.)" , mitUri),
new("JetBrains.DownloadPgpVerifier" , "1.0.0" , apache20Name , apache20Uri),
new("JetBrains.FormatRipper" , "2.2.1" , apache20Name , apache20Uri),
new("JetBrains.HabitatDetector" , "1.4.1" , apache20Name , apache20Uri),
new("System.Text.Json" , "8.0.3" , mitName + " (Microsoft Corporation)" , mitUri),
new("WixToolset.Dtf.WindowsInstaller", "5.0.0" , "Microsoft Reciprocal License" , new Uri("https://spdx.org/licenses/MS-RL.html")),
// @formatter:on
};
}
}

public string YearRange
{
Expand Down
8 changes: 4 additions & 4 deletions JetBrains.Etw.HostService.Updater/src/Views/AboutWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SizeToContent="Height"
ResizeMode="NoResize"
x:ClassModifier="internal"
Height="Auto" Width="500"
Height="Auto" Width="550"
Background="#F7F7F7">

<Window.DataContext>
Expand Down Expand Up @@ -45,8 +45,8 @@
</LinearGradientBrush.Transform>
</LinearGradientBrush>
</Viewbox.Resources>
<Canvas Height="70" Width="498">
<Rectangle Width="498" Height="70" Fill="{StaticResource TitleBackgroundLinear}" />
<Canvas Height="70" Width="548">
<Rectangle Width="548" Height="70" Fill="{StaticResource TitleBackgroundLinear}" />
<Path Data="M56.9609 37H46.5703V17.3945H56.5234V19.4727H48.8672V25.9941H55.9492V28.0586H48.8672V34.9219H56.9609V37Z" Fill="white" />
<Path Data="M71.5428 19.4727H65.8827V37H63.5858V19.4727H57.9393V17.3945H71.5428V19.4727Z" Fill="white" />
<Path Data="M97.5817 17.3945L92.0446 37H89.3512L85.318 22.6719C85.1449 22.0612 85.0401 21.3958 85.0036 20.6758H84.9489C84.8942 21.3503 84.7757 22.0065 84.5934 22.6445L80.5329 37H77.8669L72.1247 17.3945H74.654L78.8239 32.4336C78.9971 33.0625 79.1065 33.7188 79.152 34.4023H79.2204C79.266 33.9193 79.4072 33.263 79.6442 32.4336L83.9782 17.3945H86.1794L90.3356 32.543C90.4815 33.0625 90.5908 33.6732 90.6637 34.375H90.7184C90.7549 33.901 90.8779 33.2721 91.0876 32.4883L95.0934 17.3945H97.5817Z" Fill="white" />
Expand Down Expand Up @@ -114,7 +114,7 @@
<ColumnDefinition Width="*" SharedSizeGroup="License" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="0,0,5,0" Text="{Binding PackageId}" />
<TextBlock Grid.Column="1" Margin="0,0,5,0" Text="{Binding PackageVersion}" />
<TextBlock Grid.Column="1" Margin="0,0,5,0" Text="{Binding PackageVersion}" HorizontalAlignment="Center" />
<TextBlock Grid.Column="2">
<Hyperlink RequestNavigate="OnRequestNavigate" NavigateUri="{Binding LicenseUri}">
<TextBlock Text="{Binding LicenseName}"></TextBlock>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using JetBrains.Etw.HostService.Updater.Progress;
using JetBrains.Etw.HostService.Updater.Util;
using JetBrains.Etw.HostService.Updater.ViewModel;
using ILogger = JetBrains.Etw.HostService.Updater.Util.ILogger;

namespace JetBrains.Etw.HostService.Updater.Views
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net7.0-windows</TargetFrameworks>
<TargetFrameworks>net462;net8.0-windows</TargetFrameworks>
<RootNamespace>JetBrains.Etw.HostService.Updater.Tests</RootNamespace>
<LangVersion>10</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 1cf76d3

Please sign in to comment.