NetSparkle

NetSparkle is a C# cross-platform software update framework for .NET developers compatible with .NET 4.6.2/.NET 6+, WinForms, WPF, and Avalonia; uses Ed25519 or DSA signatures! View basic usage here in the README or visit our website for code docs.

MIT License

Stars
566
Committers
35

Bot releases are hidden (Show)

NetSparkle - NetSparkleUpdater 2.0.2

Published by Deadpikle over 3 years ago

  • Fixed bug where WebClientFileDownloader used its WebClient to download a file more than once
  • Updated Avalonia libs to 0.10.2 (from 0.10.0) for bug fixes
NetSparkle - NetSparkleUpdater 2.0.1

Published by Deadpikle over 3 years ago

  • Fixed bug where Unix systems didn't run the update shell script properly
NetSparkle - NetSparkleUpdater v2.0.0

Published by Deadpikle over 3 years ago

2.0.0 is a new version of NetSparkleUpdater (previously NetSparkle, NetSparkle.New) with new enhancements, more configuration ability, and lots of other great stuff!

If you used any prior version of NetSparkle, please make sure to test the 2.0 version of NetSparkleUpdater in your program, app, or other software after updating just to be safe. Lots of things have changed. Please ask questions here on GitHub or in our Gitter channel if you need help updating to 2.0!

The easiest way to install this is via NuGet (for the main library/UI) or the .NET CLI.

Package Use Case
NetSparkleUpdater.SparkleUpdater Core package; Use a 100% custom UI (nothing built-in)
WinForms UI (.NET Framework) NetSparkle with built-in WinForms UI
WinForms UI (.NET Core) NetSparkle with built-in WinForms UI
WPF UI (.NET Framework and Core) NetSparkle with built-in WPF UI
Avalonia UI NetSparkle with built-in Avalonia UI
App Cast Generator Tool netsparkle-generate-appcast CLI tool (incl. Ed25519 helpers)
DSA Helper Tool netsparkle-dsa CLI tool (DSA helpers)

Here are some things that changed from 0.X and 1.X. Please let us know if we forgot something!

  • Minimum .NET Framework requirement, if running on .NET Framework, is now .NET Framework 4.5.2 instead of 4.5.1. Otherwise, the core library is .NET Standard 2.0 compatible, which means you can use it in your .NET Core and .NET 5+ projects.
  • Change of base namespace from NetSparkle to NetSparkleUpdater
  • Sparkle renamed to SparkleUpdater for clarity
  • More logs are now written via LogWriter to help you debug and figure out any issues that are going on
  • The default NetSparkleUpdater package (NetSparkleUpdater.SparkleUpdater) has no built-in UI. Please use one of the NetSparkleUpdater packages with a UI if you want a built-in UI that is provided for you.
    • Note that if you do not use a UIFactory, you must use the CloseApplication or CloseApplicationAsync events to close your application; otherwise, your downloaded update file will never be executed/read! The only exception to this is if you want to handle all aspects of installing the update package yourself.
  • XML docs are now properly shipped with the code for all public and protected methods rather than being here in this README file
    • Enabled build time warnings for functions that need documentation that don't have it
  • SparkleUpdater constructors now require an ISignatureVerifier in order to "force" you to choose your signature verification method
  • SecurityMode is a new enum that defines which signatures are required and which signatures are not required
    • Added SecurityMode.OnlyVerifySoftwareDownloads if you want to verify only software download signatures and don't care about verifying your app cast or release notes
  • UIs are now in different namespaces. If you want to use a UI, you must pass in a UIFactory that implements IUIFactory and handles showing/handling all user interface elements
    • NetSparkleUpdater offers basic, built-in UIs for WinForms, WPF, and Avalonia. Copy & paste these files to your project and modify them to make them work better in your project!
    • SparkleUpdater no longer holds its own Icon. This is now handled by the UIFactory object.
    • HideReleaseNotes, HideRemindMeLaterButton, and HideSkipButton are all handled by the UIFactory objects
  • Added built-in UIs for WPF and Avalonia 0.10.X.
  • Localization capabilities are now non-functional and are expected to come back in a later version. See this issue. (Contributions are welcome!)
  • Most SparkleUpdater elements are now configurable. For example, you can implement IAppCastHandler to implement your own app cast parsing and checking.
    • IAppCastDataDownloader to implement downloading of your app cast file
    • IUpdateDownloader to implement downloading of your actual binary/installer as well as getting file names from the server (if CheckServerFileName is true)
    • IAppCastHandler to implement your own app cast parsing
    • ISignatureVerifier to implement your own download/app cast signature checking. NetSparkleUpdater has built-in DSA and Ed25519 signature verifiers.
    • IUIFactory to implement your own UI
      • IUIFactory implementors must now have ReleaseNotesHTMLTemplate and AdditionalReleaseNotesHeaderHTML -- it's ok if these are string.Empty/""/null.
      • IUIFactory methods all now take a reference to the SparkleUpdater instance that called the method
    • ILogger to implement your own logger class (rather than being forced to subclass LogWriter like in previous versions)
    • Configuration subclasses now take an IAssemblyAccessor in their constructor(s) in order to define where assembly information is loaded from
    • Many SparkleUpdater functions are now virtual and thus more easily overridden for your specific use case
    • Several ReleaseNotesGrabber functions are now virtual as well.
  • Many delegates, events, and functions have been renamed, removed, and/or tweaked for clarity and better use
    • DownloadEvent now has the AppCastItem that is being downloaded rather than being just the download path
    • AboutToExitForInstallerRun/AboutToExitForInstallerRunAsync has been renamed to PreparingToExit/PreparingToExitAsync, respectively
    • The UserSkippedVersion event has been removed. Use UserRespondedToUpdate instead.
    • The RemindMeLaterSelected event has been removed. Use UserRespondedToUpdate instead.
    • The FinishedDownloading/DownloadedFileReady events have been removed. Use DownloadFinished instead.
    • The StartedDownloading event has been removed and replaced with DownloadStarted
    • The DownloadError event has been removed and replaced with DownloadHadError
    • Sparkle.RunUpdate no longer exists. Use SparkleUpdater.InstallUpdate instead.
    • Sparkle.DownloadPathForAppCastItem -> SparkleUpdater.GetDownloadPathForAppCastItem
    • AppCastItem.DownloadDSASignature -> AppCastItem.DownloadSignature
    • SilentModeTypes enum renamed to UserInteractionMode
    • Sparkle.SilentMode renamed to Sparkle.UserInteractionMode
    • UseSyncronizedForms renamed to ShowsUIOnMainThread
  • Samples have been updated and improved
    • Sample apps for Avalonia, WinForms, and WPF UIs
    • Sample app to demonstrate how to handle events yourself with your own, custom UI
  • By default, the app cast signature file now has a .signature extension. The app cast downloader will look for a file with the old .dsa signature if data is not available or found in a appcast.xml.signature on your server. You can change the extension using the signature-file-extension option in the app cast generator and via the XMLAppCast.SignatureFileExtension property.
  • sparkle:dsaSignature is now sparkle:signature instead. If no sparkle:signature is found, sparkle:dsaSignature will be used (if available). If sparkle:dsaSignature is not found, sparkle:edSignature will be used (if available). This is to give us as much compatibility with old versions of NetSparkle as well as the macOS Sparkle library.
  • An entirely new app cast generator tool is now available for use.
  • By default, the app cast generator tool now uses Ed25519 signatures. If you don't want to use files on disk to store your keys, set the SPARKLE_PRIVATE_KEY and SPARKLE_PUBLIC_KEY environment variables before running the app cast generator tool. You can also store these signatures in a custom location with the --key-path flag.
    • You can still use DSA signatures via the DSAHelper tool and the DSAChecker class. This is not recommended.
    • Ed25519Checker is the class responsible for handling Ed25519 signatures. DSAChecker sticks around for verifying DSA signatures if they're still used.
  • Removed AssemblyAccessor class in lieu of IAssemblyAccessor implementors
  • The server file name for each app cast download is now checked before doing any downloads or showing available updates to the client. To disable this behavior and use the name in the app cast, set SparkleUpdater.CheckServerFileName to false.
  • bool ignoreSkippedVersions = false has been added to CheckForUpdatesAtUserRequest, CheckForUpdatesQuietly, and GetUpdateStatus to make ignoring skipped versions easier.
  • The file name/path used by RelaunchAfterUpdate are controlled by RestartExecutableName and RestartExecutablePath, respectively. SparkleUpdater makes a best effort to figure these out for you; however, you can override them if you need to. NOTE: The way these parameters are fetched has CHANGED in recent previews (as of 2021-04-18) -- YOU HAVE BEEN WARNED!!
  • Breaking change: CheckForUpdatesQuietly now shows no UI ever. It could show a UI before, which didn't make a lot of sense based on the function name. Make sure that if you use this function that you handle showing a UI yourself if necessary. (See the HandleEventsYourself sample if you want help.) You can always trigger the built-in SparkleUpdater by calling _sparkle.ShowUpdateNeededUI(updateInfo.Updates).
  • Breaking change: DLL assembly names for .NET Framework WinForms UI dlls changed from NetSparkle.UI.WinForms to NetSparkleUpdater.UI.WinForms.
  • Breaking change: DLL assembly names for Avalonia UI dlls changed from NetSparkle.UI.Avalonia to NetSparkleUpdater.UI.Avalonia.
  • We now rely on Portable.BouncyCastle (BouncyCastle.Crypto.dll) for the ed25519 implementation. This means there is another DLL to reference when you use NetSparkle!
  • We now rely on System.Text.Json (netstandard2.0) OR Newtonsoft.Json (.NET Framework 4.5.2) for the JSON items. This means there is another DLL to reference when you use NetSparkle, and it will change depending on if the System.Text.Json or Newtonsoft.Json item is used!
NetSparkle - NetSparkle 0.18.0

Published by Deadpikle almost 5 years ago

Changed

  • RegistryConfiguration.BuildRegistryInfo() is now public virtual rather than private
NetSparkle - NetSparkle 0.17.0

Published by Deadpikle almost 5 years ago

Added

  • NetSparkle now handles the ddd, dd MMM yyyy HH:mm:ss Z and ddd, dd MMM yyyy HH:mm:ss date formats when parsing an app cast file (@Mostlypyjamas)

Changed

  • [Breaking Change] NetSparkle defaults to using the server's file name as the download file name rather than the app cast file name (@Mostlypyjamas)
  • Many buttons use AutoSize = true to alleviate some concerns outlined in #44
NetSparkle - NetSparkle 0.16.2

Published by Deadpikle almost 5 years ago

Fixed

  • Fixed a bug where release notes were downloaded incorrectly
  • Fixed a bug where the update form window wasn't closed properly
NetSparkle - NetSparkle 0.16.1

Published by Deadpikle over 5 years ago

0.16.1

Added

  • Appcast download links can now be relative (this change may be removed in a future X.0 version of NetSparkle as it does not follow the RSS spec). This change was made to be consistent with how release notes are downloaded.

Changed

  • NetSparkleUtilities namespace renamed to just NetSparkle.
NetSparkle - NetSparkle 0.16.0

Published by Deadpikle over 5 years ago

0.16.0

Added

  • We now offer a generate_appcast.exe tool in the NetSparkle.New.Tools NuGet! This works very similarly to macOS Sparkle's generate_appcast tool and is due to the work by @ndreisg.
  • Started to work on adding formal unit tests for the project. Lots to do here, still.
NetSparkle - 0.15.0

Published by Deadpikle over 6 years ago

0.15.0

Changed

  • AppCastItem is now marked serializable
  • If using SecurityMode.Unsafe, files are always redownloaded because the library has no good way of knowing whether or not the file that is on disk is the file that is actually on the server (@rolikoff)
  • Fixed a bug where if you cancel the download process or if an error occurs during download, the update file stays in the same directory (@rolikoff)
  • Fixed a bug where the DownloadCanceled event was fired twice (@rolikoff)
NetSparkle - 0.14.0

Published by Deadpikle over 6 years ago

0.14.0

Added

  • NetSparkle now supports the sparkle:os attribute (#17). If this is not present, an update is assumed to be a Windows update. Valid types for Windows are "win" or "windows". The operating system string check is a case-insensitive check.
    • Added OperatingSystemString (default "windows") and bool IsWindowsUpdate to AppCastItem
    • AppCast.GetUpdates() no longer returns non-Windows updates
  • To increase compatibility with the main macOS Sparkle project, the enclosure tag can now be either enclosure or sparkle:enclosure
  • Added AppCastItem.MIMEType to read the <enclosure type=""> attribute if they want to (#15). Defaults to application/octet-stream.
  • Added UpdateDetectedEventArgs.AppCastItems if you want to look at all available app cast items
  • Added DownloadPathForAppCastItem(AppCastItem item) to easily grab the download path for a given downloadable appcast item
  • Added RunUpdate(AppCastItem item) to allow you to run an update without waiting for the latest version to download. The DSA signature of the file is still checked!

Changed

  • NetSparkle.UpdateSystemProfileInformation is now private
  • AppCast no longer takes a Sparkle object and instead takes only those parameters that it needs to operate
  • NextUpdateAction is now in its own file in the NetSparkle.Enums namespace
NetSparkle - 0.13.0

Published by Deadpikle almost 7 years ago

0.13.0

Added

  • BREAKING CHANGE | Added HideRemindMeLaterButton() to IUpdateAvailable
  • BREAKING CHANGE | Added HideSkipButton() to IUpdateAvailable
  • Added HideRemindMeLaterButton to the NetSparkle class. Defaults to false. Set to true to make NetSparkle call HideRemindMeLaterButton() when showing the update window.
  • Added HideSkipButton to the NetSparkle class. Defaults to false. Set to true to make NetSparkle call HideSkipButton() when showing the update window.
  • Added RemindMeLaterSelected to the NetSparkle class. Defaults to null. Use this event to be notified when the user has clicked the Remind Me Later button in the update window. (@enscope)

Changed

  • Release notes are now downloaded asynchronously, which should speed up the time it takes to show the download window
  • Release note date is now Date.ToString("D") instead of "dd MMM yyyy" so that release notes show localized date strings
  • POTENTIALLY BREAKING CHANGE | Fixed bug where ValidationResult.Unchecked was not returned properly from OnDownloadFinished if download file signature is null (@keithclanton)
  • BREAKING CHANGE | IUpdateAvailable now has a Result of type UpdateAvailableResult rather than DialogResult in order to remove a dependency on WinForms. Use DefaultUIFactory.ConvertDialogResultToUpdateAvailableResult to convert from DialogResult to UpdateAvailableResult if needed. (@enscope)
NetSparkle - 0.12.0

Published by Deadpikle about 7 years ago

NetSparkle 0.12.0

Added

  • Added new LogWriter class for printing diagnostic messages to the console. You can now create your own child class that inherits from LogWriter to customize how information is logged to the console (or file, or wherever else you want diagnostic messages sent!)!
  • Added .gitattributes file for line ending consistency for all developers (@stephenwade)

Changed

  • Moved UpdateStatus enum to NetSparkle.Enums
  • Moved UpdateInfo class to its own file
  • Fixed bug in Configuration.cs where a few values were not set properly in the constructor due to InitWithDefaultValues being called at the wrong time (@devstudiosoft)
  • BREAKING CHANGE Fixed bug in AssemblyDiagnosticsAccessor where AssemblyProduct returned the assembly version and not the assembly name (@devstudiosoft)

Removed

  • BREAKING CHANGE Removed public void NetSparkle.ReportDiagnosticMessage in lieu of new LogWriter class.
NetSparkle - 0.11.2

Published by Deadpikle over 7 years ago

NetSparkle 0.11.2

Forgot to actually set the assembly version in 0.11.0 and subsequently forgot to actually rebuild when publishing 0.11.1 to NuGet. It's fixed now.

NetSparkle - 0.11.0

Published by Deadpikle over 7 years ago

NetSparkle 0.11.0

Added

  • Refactored logic to quit application to a separate QuitApplication() function

Changed

  • RunDownloadedInstaller() is now virtual and protected
  • Renamed some files and variables
  • Moved SecurityMode and ValidationResult enums to the NetSparkle.Enums namespace
NetSparkle - 0.10.0

Published by Deadpikle over 7 years ago

NetSparkle 0.10.0

Added

  • This changelog
  • Sparkle class documentation to the readme
  • Section about how the appcast works to the readme

Changed

Much thanks to @stephenwade for his contributions to 0.10.0

  • Cleaned up and added documentation comments throughout the code (@stephenwade)
  • Renamed lots of identifiers throughout the project to remove "NetSparkle" (i.e., NetSparkleAppCast to AppCast, NetSparkleConfiguration to Configuration, etc.) (@stephenwade)
  • Renamed property UseSyncronizedForms to ShowsUIOnMainThread to better represent what it does (@stephenwade)
  • Renamed events CloseWPFSoftware and CloseWPFSoftwareAsync to CloseApplication and CloseApplicationAsync (@stephenwade)
    • These events are now always run, if present (instead of only on RunningFromWPF)
    • If one of these events is set, it will be run instead of quitting your app (to allow you a custom quit procedure), so these events should take care of quitting your app.
  • Renamed DSAVerificator to DSAChecker (@stephenwade)
  • Folder output changed to be more organized
  • Updated LICENSE file
  • Update NuGet package items

Removed

  • deprecated property EnableSilentMode
  • property RunningFromWPF
NetSparkle - 0.9.1.1

Published by Deadpikle over 7 years ago

NetSparkle 0.9.1.1

  • Added ClearOldInstallers Action that you can implement on your own to remove old installers. Use this if you download installers to a custom folder and need to erase them later.
  • Fixed compilation issue with EnableSilentMode (not sure how I never came across this!)
NetSparkle - 0.9.1

Published by Deadpikle over 7 years ago

NetSparkle 0.9.1

  • Added UpdateSize to NetSparkleAppCastItem => analogous to the length field within the <enclosure> tag
  • Added IsCriticalUpdate to NetSparkleAppCastItem => to use, add sparkle:criticalUpdate="true" as an attribute to the <enclosure> tag
    • When any update that the user needs is marked as critical, the skip and remind me later buttons are disabled
    • When an update is marked as critical, the release notes for that version state that the update is critical
    • To do something about a critical update in your own software, check Sparkle.LatestAppCastItems or Sparkle.UpdateMarkedCritical to see if an update in the list of updates that the user needs is critical
NetSparkle - 0.9

Published by Deadpikle over 7 years ago

NetSparkle 0.9

  • Added several more diagnostic messages for debugging on the console
  • New SilentMode option to allow for the "normal" update process (NotSilent), completely silent updates (DownloadAndInstall), or silent downloads that you as the developer initiate the start of the update manually (DownloadNoInstall)
    • DownloadAndInstall may be quite jarring to your users if you don't tell them the software is about to quit to restart. Use AboutToExitForInstallerRun or AboutToExitForInstallerRunAsync to monitor for these events.
    • For proper DownloadNoInstall use, monitor the DownloadedFileReady event to know when things are ready. At some later time, call _sparkle.ShowUpdateNeededUI(true); to show the software update window. You may want to monitor other events as well to keep your user from performing another update check while a software update is downloading.
  • Deprecated EnableSilentMode in lieu of SilentMode
  • Added TmpDownloadFilePath to redirect the download location. This should be a folder, not a full path. Note that you still need to manually delete files that are downloaded here.
  • Stopped the software from redownloading the installer if it already exists on disk (saves bandwidth and time on the user's part)
    • Note that NetSparkle does not perform resumable downloads in between software instances
  • Fixed potential infinite software update download loop if the software keeps downloading corrupted files (corrupt files or ones that don't pass the DSA check).
Badges
Extracted from project README
NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet NuGet
Related Projects