Skip to content

Commit

Permalink
Always use AssemblyDiagnosticsAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadpikle committed Sep 25, 2024
1 parent bce0643 commit afabe0e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ In your project file, make sure you set up a few things so that the library can
<PropertyGroup>
<Version>1.0.2-beta1</Version> <!-- accepts semver -->
<AssemblyVersion>1.0.2</AssemblyVersion> <!-- only accepts Major.Minor.Patch.Revision -->
<AssemblyTitle>My Best App</AssemblyTitle>
<AssemblyTitle>My Best App</AssemblyTitle>
<!-- When using AssemblyDiagnosticsAccessor, accessor.AssemblyTitle is actually the
<Product> information due to limitations with the way the diagnostics access works -->
<Description>My app is cool (not required)</Description>
<Company>My Company Name (required unless you set the IAssemblyAccessor save path yourself)</Company>
<Product>My Product (required unless you set the IAssemblyAccessor save path yourself; set to product name e.g. MyBestApp)</Product>
Expand Down
3 changes: 1 addition & 2 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* `WebFileDownloader` now deletes files on cancellation of a download like `LocalFileDownloader` did already (1cd2284c41bbe85d41566915965ad2acdb1a61f5)
* `WebFileDownloader` does not call `PrepareToDownloadFile()` in its constructor anymore. Now, it is called after the object is fully created. (420f961dfa9c9071332e2e0737b0f287d2cfa5dc)
* NOTE: If you update to .NET 8+ in your own app, the location of `JSONConfiguration` save data, by default, will CHANGE due to a change in .NET 8 for `Environment.SpecialFolder.ApplicationData`. See: https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/8.0/getfolderpath-unix. This may cause user's "skipped version" or other data to be lost unless you migrate this data yourself. For most users who are using the defaults, this is likely only a minor (if any) inconvenience at all, but it is worth noting. SparkleUpdater makes no attempt to account for this change at this time.
* `AssemblyReflectionAccessor` has been deprecated. Please use `AsmResolverAccessor` instead. (#587) NOTE: This may be removed in lieu of always using `AssemblyDiagnosticsAccessor`; this will be decided before 3.0 release.
* `AssemblyReflectionAccessor` has been deprecated. Please use `AssemblyDiagnosticsAccessor` instead. (#587)
* `AssemblyDiagnosticAccessor.AssemblyVersion` now returns `FileVersionInfo.GetVersionInfo(assemblyName).ProductVersion` rather than `FileVersionInfo.GetVersionInfo(assemblyName).FileVersion` so we can get semver versioning information
* For ed25519 use, changed from `BouncyCastle` to a custom fork of `Chaos.NaCl` (large file size savings and we don't need all of BouncyCastle's features). You can verify its use and code online here: https://github.com/NetSparkleUpdater/Chaos.NaCl. Additionally, this package is available on NuGet for your own projects under the package name `NetSparkleUpdater.Chaos.NaCl`.
* `LogWriter` has undergone several changes:
Expand Down Expand Up @@ -112,7 +112,6 @@
* `WebFileDownloader.PrepareToDownloadFile` is now `virtual` (84df81122cfae9309de4f5b79489e46287bf3a62)
* The app cast maker now expects at least `Major.Minor` for version numbers and no longer accepts single digits as version numbers (this fixes things like "My Super App Version 2.exe" having 2 being detected as the version number when the version number is in a prior folder name, and also ensures that the right number is being read)
* If `JSONConfiguration` cannot save data, `SparkleUpdater` now uses the `DefaultConfiguration` class, which basically has no information set on it and will always check for updates for the user. (a33266ac99b3eed83ff481ee7ef06cc5a0b1ab40)
* Added `AsmResolverAccessor` class for assembly loading information without reflection (replaces `AssemblyReflectionAccessor`) (#587) NOTE: This may be removed in lieu of always using `AssemblyDiagnosticsAccessor`; this will be decided before 3.0 release.
* Fixed Avalonia message window close button not working properly (394841d47c8b6739ca0ebcec87303529b81da904)
* Fixed `AssemblyReflectionEditor` not loading in a way that allowed for proper file closing of the DLL (fixes a unit testing issue)
* Avalonia UI now uses `CompiledBinding`
Expand Down
4 changes: 3 additions & 1 deletion src/NetSparkle.Tests/NetSparkle.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NetSparkle\NetSparkle.csproj" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="AsmResolver.DotNet" Version="5.5.1" />
</ItemGroup>
<ItemGroup>
<None Update="appcast_with_beta_items.xml">
Expand All @@ -73,5 +74,6 @@
<None Update="appcast_simple.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="..\NetSparkle.Unused\AsmResolverAccessor.cs" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace NetSparkleUpdater.AssemblyAccessors
/// An assembly accessor that uses reflection to learn information
/// on an assembly with a given name.
/// </summary>
[Obsolete("Uses assembly-based reflection and is not trimmable; Use AsmResolverAccessor instead")]
[Obsolete("Uses assembly-based reflection and is not trimmable; Use AssemblyDiagnosticsAccessor instead")]
public class AssemblyReflectionAccessor : IAssemblyAccessor
{
private List<Attribute> _assemblyAttributes = new List<Attribute>();
Expand Down
1 change: 0 additions & 1 deletion src/NetSparkle/NetSparkle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AsmResolver.DotNet" Version="5.5.1" />
<PackageReference Include="NetSparkleUpdater.Chaos.NaCl" Version="0.9.2" />
</ItemGroup>
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/NetSparkle/SparkleUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,19 @@ public Configuration Configuration
#if NETSTANDARD || NET6 || NET7 || NET8
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
_configuration = new RegistryConfiguration(new AsmResolverAccessor(_appReferenceAssembly));
_configuration = new RegistryConfiguration(new AssemblyDiagnosticsAccessor(_appReferenceAssembly));
}
else
{
try {
_configuration = new JSONConfiguration(new AsmResolverAccessor(_appReferenceAssembly));
_configuration = new JSONConfiguration(new AssemblyDiagnosticsAccessor(_appReferenceAssembly));
} catch (Exception e) {
LogWriter?.PrintMessage("Unable to create JSONConfiguration object: {0}", e.Message);
_configuration = new DefaultConfiguration(new AsmResolverAccessor(_appReferenceAssembly));
_configuration = new DefaultConfiguration(new AssemblyDiagnosticsAccessor(_appReferenceAssembly));
}
}
#else
_configuration = new RegistryConfiguration(new AsmResolverAccessor(_appReferenceAssembly));
_configuration = new RegistryConfiguration(new AssemblyDiagnosticsAccessor(_appReferenceAssembly));
#endif
}
return _configuration;
Expand Down

0 comments on commit afabe0e

Please sign in to comment.