Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…rkle into pr/630
  • Loading branch information
Deadpikle committed Nov 18, 2024
2 parents ecd5673 + a36fa87 commit c716e1a
Show file tree
Hide file tree
Showing 23 changed files with 145 additions and 62 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].2
- uses: nuget/setup-nuget@v2
with:
nuget-api-key: ${{secrets.NUGET_API_KEY}}
Expand All @@ -23,13 +23,14 @@ jobs:
uses: microsoft/[email protected]
if: matrix.os == 'windows-latest'

- name: Setup .NET 6.0, 7.0, 8.0 for tests
uses: actions/setup-dotnet@v4.0.1
- name: Setup .NET 6.0, 7.0, 8.0, 9.0 for tests
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: Run NetSparkle.Tests in .NET 4.6.2
run: dotnet test -f net462 ${{ github.workspace }}/src/NetSparkle.Tests/NetSparkle.Tests.csproj
Expand All @@ -53,12 +54,18 @@ jobs:
- name: Run NetSparkle.Tests.AppCastGenerator in .NET 8
run: dotnet test -f net8.0 ${{ github.workspace }}/src/NetSparkle.Tests.AppCastGenerator/NetSparkle.Tests.AppCastGenerator.csproj

- name: Run NetSparkle.Tests in .NET 9
run: dotnet test -f net9.0 ${{ github.workspace }}/src/NetSparkle.Tests/NetSparkle.Tests.csproj

- name: Run NetSparkle.Tests.AppCastGenerator in .NET 9
run: dotnet test -f net9.0 ${{ github.workspace }}/src/NetSparkle.Tests.AppCastGenerator/NetSparkle.Tests.AppCastGenerator.csproj

build:
name: Build all packages as smoke test
runs-on: windows-latest
needs: test
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].2
- uses: nuget/setup-nuget@v2
with:
nuget-api-key: ${{secrets.NUGET_API_KEY}}
Expand All @@ -67,13 +74,14 @@ jobs:
- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Setup .NET 6.0, 7.0, 8.0
uses: actions/setup-dotnet@v4.0.1
- name: Setup .NET 6.0, 7.0, 8.0, 9.0
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: Clean things to be safe
run: |
Expand Down Expand Up @@ -104,7 +112,7 @@ jobs:
needs: build
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/avalonia-preview' || github.ref == 'refs/heads/versions/2.x'
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].2
- uses: nuget/setup-nuget@v2
with:
nuget-api-key: ${{secrets.NUGET_API_KEY}}
Expand All @@ -113,13 +121,14 @@ jobs:
- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Setup .NET 6.0, 7.0, 8.0
uses: actions/setup-dotnet@v4.0.1
- name: Setup .NET 6.0, 7.0, 8.0, 9.0
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: Publish NetSparkleUpdater.SparkleUpdater on version change
uses: nitz/publish-nuget@60fd3adf9d9eecc3bbf8a98738734d3061347172
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<AvaloniaVersion>11.1.3</AvaloniaVersion>
<AvaloniaVersion>11.1.4</AvaloniaVersion>
</PropertyGroup>
</Project>
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ We are open to contributions that might make the overall install/update process

0. If you want a pre-built UI, install one of the UI NuGet packages. If not, install the core NuGet package.
1. Set up your project file as mentioned in the following section
2. Download the app cast generator CLI tool (requires .NET 6, 7, or 8 runtime): `dotnet tool install --global NetSparkleUpdater.Tools.AppCastGenerator`
2. Download the app cast generator CLI tool (requires .NET 6, 7, 8, or 9 runtime): `dotnet tool install --global NetSparkleUpdater.Tools.AppCastGenerator`
3. Create your ed25519 keys (save the generated keys somewhere for safe keeping!):
```bash
netsparkle-generate-appcast --generate-keys
Expand Down Expand Up @@ -233,13 +233,14 @@ The file that launches your downloaded update executable only waits for 90 secon
* Subclassing `JSONConfiguration` lets you quickly change the file path where data is saved via `GetSavePath`
* Subclass `AppCastHelper` if you want full control over the app cast downloading and parsing process. Note that you can probably do everything you need to do via the `AppCastHelper` properties (including `IAppCastFilter AppCastFilter`), but subclassing will give you full, absolute control over the whole process. To use the instance of your class, set `SparkleUpdater.AppCastHelper`.
* Subclass `ReleaseNotesGrabber` to control the release notes downloading (and therefore display) process. To use an instance of your class, set `UIFactory.ReleaseNotesGrabberOverride`.
* Override `WebFileDownloader` if you don't want to implement `IUpdateDownloader` yourself and just want to override a function or two such as `CreateHttpClient`. To use an instance of your class, set `SparkleUpdater.UpdateDownloader`.
* Override `WebFileDownloader` if you don't want to implement `IUpdateDownloader` yourself and just want to override a function or two such as `CreateHttpClient` or `RetreiveDestinationFileNameAsync`. To use an instance of your class, set `SparkleUpdater.UpdateDownloader`.
* Override `WebRequestAppCastDataDownloader` if you don't want to implement `IAppCastDataDownloader` and just want to override a function or two such as `CreateHttpClient`. To use an instance of your class, set `SparkleUpdater.AppCastDataDownloader`.
* Override `LogWriter` to implement the `PrintMessage` function; because `ILogger` is a pretty simple interface, you can probably just implement that interface yourself if your needs are complex. To use an instance of your class, set `SparkleUpdater.LogWriter`.
* Override `SparkleUpdater` to implement some different installation-related functions, including:
* `GetWindowsInstallerCommand`
* `GetInstallerCommand`
* `RunDownloadedInstaller`
* `GetDownloadPathForAppCastItem`
* Override `UIFactory` if you don't want to implement the entirety of the `IUIFactory` interface yourself and just want to configure a function or two. To use an instance of your class, set `SparkleUpdater.UIFactory`.

#### Using `IAppCastFilter`
Expand Down Expand Up @@ -270,7 +271,7 @@ We strongly recommend that you make use of the [netsparkle-generate-appcast](#in

### Install AppCast Generator Tool

1. This tool requires the .NET 6, 7, or 8 Desktop Runtime to be installed.
1. This tool requires the .NET 6, 7, 8, or 9 Desktop Runtime to be installed.
2. `dotnet tool install --global NetSparkleUpdater.Tools.AppCastGenerator`
3. The tool is now available on your command line as the `netsparkle-generate-appcast` command. You can use `netsparkle-generate-appcast --help` to see a full list of options for this tool.

Expand Down Expand Up @@ -344,7 +345,7 @@ _Note:_ the app cast generator tool creates both of these signatures for you whe

### Ed25519 Signatures

You can generate Ed25519 signatures using the `AppCastGenerator` tool (from [this NuGet package](https://www.nuget.org/packages/NetSparkleUpdater.Tools.AppCastGenerator/) or in the [source code here](https://github.com/NetSparkleUpdater/NetSparkle/tree/develop/src/NetSparkle.Tools.AppCastGenerator)). **This tool requires the .NET 6, 7, or 8 Desktop Runtime to be installed.** Please see below sections for options and examples on generating the Ed25519 keys and for using them when creating an app cast.
You can generate Ed25519 signatures using the `AppCastGenerator` tool (from [this NuGet package](https://www.nuget.org/packages/NetSparkleUpdater.Tools.AppCastGenerator/) or in the [source code here](https://github.com/NetSparkleUpdater/NetSparkle/tree/develop/src/NetSparkle.Tools.AppCastGenerator)). **This tool requires the .NET 6, 7, 8, or 9 Desktop Runtime to be installed.** Please see below sections for options and examples on generating the Ed25519 keys and for using them when creating an app cast.

### How can I make the app cast?

Expand Down
6 changes: 5 additions & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Summary of 3.x Changes

* Updated .NET and .NET Framework compatibility
* Updated .NET and .NET Framework compatibility (Bump minimum requirement to .NET 4.6.2, Add .NET 9)
* Built-in JSON app cast reading/writing instead of just XML
* Built-in ability to use different channels for your apps (e.g. beta, alpha, preview)
* Semver compatibility
Expand Down Expand Up @@ -137,6 +137,10 @@
* Add `TrustEverySSLConnection` to .NET Core `WebFileDownloader`
* Fix `WebFileDownloader` not setting up an `HttpClientHandler` (was always auto-redirect'ing before despite setting `RedirectHandler`; now behaves more similarly to `WebRequestAppCastDataDownloader`)
* Fixed `Unsafe` mode in DSA/ed25519 checkers still checking signatures if a signature existed
* Deprecated `SecurityProtocolType SecurityProtocolType` property in `SparkleUpdater` (deprecated in .NET 9 and you can easily override the pertinent `HttpClient` behavior yourself)
* `SparkleUpdater.GetDownloadPathForAppCastItem` is now marked `virtual`
* Added `TmpDownloadFileNameWithExtension` for controlling the download file name (use `TmpDownloadFilePath` to control the download file path)
* `WebFileDownloader.RetrieveDestinationFileNameAsync` is now marked `virtual`

## Updating from 0.X or 1.X to 2.X

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>NetSparkleUpdater.UI.WinForms.NetFramework</id>
<title>NetSparkleUpdater WinForms .NET Framework UI</title>
<version>3.0.0-preview20240915001</version>
<version>3.0.0-rc001</version>
<authors>Deadpikle, Dirk Eisenberg</authors>
<owners>Deadpikle</owners>
<readme>README.md</readme>
Expand All @@ -19,7 +19,7 @@
<releaseNotes>2.0: See https://github.com/NetSparkleUpdater/NetSparkle for all information and to file issues/pull requests for and ask questions about this project.</releaseNotes>
<dependencies>
<group targetFramework=".NETFramework4.6.2">
<dependency id="NetSparkleUpdater.SparkleUpdater" version="3.0.0-preview20240915001" exclude="Build,Analyzers" />
<dependency id="NetSparkleUpdater.SparkleUpdater" version="3.0.0-rc001" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Expand Down
12 changes: 9 additions & 3 deletions src/NetSparkle.Tests/NetSparkle.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ProjectGuid>{E50AC3A5-6C63-40D7-A4C4-9B359EFD5707}</ProjectGuid>
<RootNamespace>NetSparkleUnitTests</RootNamespace>
<AssemblyName>NetSparkleUnitTests</AssemblyName>
<TargetFrameworks>net8.0;net7.0;net6.0;net462</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462</TargetFrameworks>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
Expand Down Expand Up @@ -49,10 +49,16 @@
<DefineConstants>DEBUG;TRACE;NETCORE;NET7</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0|AnyCPU'">
<DefineConstants>TRACE;NETCORE;NET7</DefineConstants>
<DefineConstants>TRACE;NETCORE;NET8</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0|AnyCPU'">
<DefineConstants>DEBUG;TRACE;NETCORE;NET7</DefineConstants>
<DefineConstants>DEBUG;TRACE;NETCORE;NET8</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0|AnyCPU'">
<DefineConstants>TRACE;NETCORE;NET9</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0|AnyCPU'">
<DefineConstants>DEBUG;TRACE;NETCORE;NET9</DefineConstants>
</PropertyGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/NetSparkle.Tests/SparkleUpdaterFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using NetSparkleUpdater.AppCastHandlers;
using NetSparkleUpdater.Interfaces;
using Xunit;
#if (NETSTANDARD || NET5 || NET6 || NET7 || NET8)
#if (NETSTANDARD || NET5 || NET6 || NET7 || NET8 || NET9)
using System.Runtime.InteropServices;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/NetSparkle.Tests/appcast_with_beta_items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<sparkle:releaseNotesLink>
https://netsparkleupdater.github.io/NetSparkle/files/sample-app/2.1-release-notes.md
</sparkle:releaseNotesLink>
<pubDate>Fri, 28 Oct 2020 10:30:00 +0000</pubDate>
<pubDate>Wed, 28 Oct 2020 10:30:00 +0000</pubDate>
<enclosure url="https://netsparkleupdater.github.io/NetSparkle/files/sample-app/NetSparkleUpdate.exe"
sparkle:version="2.1"
sparkle:os="windows"
Expand Down
2 changes: 1 addition & 1 deletion src/NetSparkle.Tools.AppCastGenerator/AppCastMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ public string GetPathToAppCastOutput(string desiredOutputDirectory, string sourc
if (string.IsNullOrWhiteSpace(singleFileToAddToAppCast))
{
Console.WriteLine($"Searching: {sourceBinaryDirectory}", Color.LightBlue);
Console.WriteLine($"Found {binaries.Count()} {string.Join(",", dirFileSearches)} files(s)", Color.LightBlue);
Console.WriteLine($"Found {binaries.Count()} {string.Join(",", dirFileSearches)} file(s)", Color.LightBlue);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>NetSparkleUpdater.AppCastGenerator</RootNamespace>
<AssemblyName>NetSparkleUpdater.Tools.AppCastGenerator</AssemblyName>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>NetSparkleUpdater.DSAHelper</RootNamespace>
<AssemblyName>NetSparkleUpdater.Tools.DSAHelper</AssemblyName>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<AssemblyTitle>NetSparkle</AssemblyTitle>
<Product>NetSparkleUpdater.Tools.DSAHelper</Product>
<Description>Command line tool 'netsparkle-dsa' to generate and use DSA signatures. WARNING: DSA signatures are insecure. If possible, please use NetSparkleUpdater.Tools.AppCastGenerator instead to use ed25519 signatures. Use in conjunction with the NetSparkleUpdater library.</Description>
Expand Down
4 changes: 2 additions & 2 deletions src/NetSparkle.UI.Avalonia/NetSparkle.UI.Avalonia.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>NetSparkleUpdater.UI.Avalonia</PackageId>
<Version>3.0.0-preview20240921001</Version>
<Version>3.0.0-rc001</Version>
<Authors>Deadpikle</Authors>
<Company>Deadpikle</Company>
<Product>NetSparkleUpdater.UI.Avalonia</Product>
Expand Down
13 changes: 8 additions & 5 deletions src/NetSparkle.UI.WPF/NetSparkle.UI.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<ProjectGuid>{6915843C-7947-4268-B569-6F5684651DF4}</ProjectGuid>
<UseWPF>true</UseWPF>
<TargetFrameworks>net8.0-windows;net7.0-windows;net6.0-windows;net462</TargetFrameworks>
<TargetFrameworks>net9.0-windows;net8.0-windows;net7.0-windows;net6.0-windows;net462</TargetFrameworks>
<AssemblyTitle>NetSparkleUpdater.UI.WPF</AssemblyTitle>
<Product>NetSparkleUpdater.UI.WPF</Product>
<Copyright>Copyright © 2024</Copyright>
Expand All @@ -13,7 +13,7 @@
<PackageProjectUrl>https://github.com/NetSparkleUpdater/NetSparkle</PackageProjectUrl>
<RepositoryUrl>https://github.com/NetSparkleUpdater/NetSparkle.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>3.0.0-preview20240915001</Version>
<Version>3.0.0-rc001</Version>
<PackageIcon>software-update-available.png</PackageIcon>
<PackageIconUrl />
<Description>NetSparkleUpdater/NetSparkle app updater framework with built-in WPF .NET Core and .NET Framework UI. NetSparkleUpdater/NetSparkle is a C# .NET software update framework that allows you to easily download installer files and update your C# .NET Framework or .NET Core software. Built-in UIs are available for WinForms, WPF, and Avalonia. You provide, somewhere on the internet, an XML appcast with software version information along with release notes in Markdown or HTML format. The NetSparkle framework then checks for an update in the background, displays the release notes to the user, and lets users download or skip the software update. The framework can also perform silent downloads so that you can present all of the UI yourself or set up your own silent software update system, as allowed by your software architecture. It was inspired by the Sparkle (https://sparkle-project.org/) project for Cocoa developers and the WinSparkle (https://winsparkle.org/) project (a Win32 port).</Description>
Expand Down Expand Up @@ -52,13 +52,16 @@
<ProjectReference Include="..\NetSparkle\NetSparkle.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-windows'">
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-windows'">
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-windows'">
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
Expand Down
Loading

0 comments on commit c716e1a

Please sign in to comment.