Repository navigation
NetSparkleUpdater v2.0.0
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
NetSparkletoNetSparkleUpdater Sparklerenamed toSparkleUpdaterfor clarity- More logs are now written via
LogWriterto help you debug and figure out any issues that are going on - The default
NetSparkleUpdaterpackage (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 theCloseApplicationorCloseApplicationAsyncevents 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.
- Note that if you do not use a
- 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
SparkleUpdaterconstructors now require anISignatureVerifierin order to "force" you to choose your signature verification methodSecurityModeis a new enum that defines which signatures are required and which signatures are not required- Added
SecurityMode.OnlyVerifySoftwareDownloadsif you want to verify only software download signatures and don't care about verifying your app cast or release notes
- Added
- UIs are now in different namespaces. If you want to use a UI, you must pass in a
UIFactorythat implementsIUIFactoryand handles showing/handling all user interface elementsNetSparkleUpdateroffers 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!SparkleUpdaterno longer holds its ownIcon. This is now handled by theUIFactoryobject.HideReleaseNotes,HideRemindMeLaterButton, andHideSkipButtonare all handled by theUIFactoryobjects
- 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
SparkleUpdaterelements are now configurable. For example, you can implementIAppCastHandlerto implement your own app cast parsing and checking.IAppCastDataDownloaderto implement downloading of your app cast fileIUpdateDownloaderto implement downloading of your actual binary/installer as well as getting file names from the server (ifCheckServerFileNameistrue)IAppCastHandlerto implement your own app cast parsingISignatureVerifierto implement your own download/app cast signature checking. NetSparkleUpdater has built-in DSA and Ed25519 signature verifiers.IUIFactoryto implement your own UIIUIFactoryimplementors must now haveReleaseNotesHTMLTemplateandAdditionalReleaseNotesHeaderHTML-- it's ok if these arestring.Empty/""/null.IUIFactorymethods all now take a reference to theSparkleUpdaterinstance that called the method
ILoggerto implement your own logger class (rather than being forced to subclassLogWriterlike in previous versions)Configurationsubclasses now take anIAssemblyAccessorin their constructor(s) in order to define where assembly information is loaded from- Many
SparkleUpdaterfunctions are now virtual and thus more easily overridden for your specific use case - Several
ReleaseNotesGrabberfunctions are now virtual as well.
- Many delegates, events, and functions have been renamed, removed, and/or tweaked for clarity and better use
DownloadEventnow has theAppCastItemthat is being downloaded rather than being just the download pathAboutToExitForInstallerRun/AboutToExitForInstallerRunAsynchas been renamed toPreparingToExit/PreparingToExitAsync, respectively- The
UserSkippedVersionevent has been removed. UseUserRespondedToUpdateinstead. - The
RemindMeLaterSelectedevent has been removed. UseUserRespondedToUpdateinstead. - The
FinishedDownloading/DownloadedFileReadyevents have been removed. UseDownloadFinishedinstead. - The
StartedDownloadingevent has been removed and replaced withDownloadStarted - The
DownloadErrorevent has been removed and replaced withDownloadHadError Sparkle.RunUpdateno longer exists. UseSparkleUpdater.InstallUpdateinstead.Sparkle.DownloadPathForAppCastItem->SparkleUpdater.GetDownloadPathForAppCastItemAppCastItem.DownloadDSASignature->AppCastItem.DownloadSignatureSilentModeTypesenum renamed toUserInteractionModeSparkle.SilentModerenamed toSparkle.UserInteractionModeUseSyncronizedFormsrenamed toShowsUIOnMainThread
- 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
.signatureextension. The app cast downloader will look for a file with the old.dsasignature if data is not available or found in aappcast.xml.signatureon your server. You can change the extension using thesignature-file-extensionoption in the app cast generator and via theXMLAppCast.SignatureFileExtensionproperty. sparkle:dsaSignatureis nowsparkle:signatureinstead. If nosparkle:signatureis found,sparkle:dsaSignaturewill be used (if available). Ifsparkle:dsaSignatureis not found,sparkle:edSignaturewill be used (if available). This is to give us as much compatibility with old versions ofNetSparkleas well as the macOSSparklelibrary.- 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_KEYandSPARKLE_PUBLIC_KEYenvironment variables before running the app cast generator tool. You can also store these signatures in a custom location with the--key-pathflag.- You can still use DSA signatures via the DSAHelper tool and the
DSACheckerclass. This is not recommended. Ed25519Checkeris the class responsible for handling Ed25519 signatures.DSACheckersticks around for verifying DSA signatures if they're still used.
- You can still use DSA signatures via the DSAHelper tool and the
- Removed
AssemblyAccessorclass in lieu ofIAssemblyAccessorimplementors - 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.CheckServerFileNametofalse. bool ignoreSkippedVersions = falsehas been added toCheckForUpdatesAtUserRequest,CheckForUpdatesQuietly, andGetUpdateStatusto make ignoring skipped versions easier.- The file name/path used by
RelaunchAfterUpdateare controlled byRestartExecutableNameandRestartExecutablePath, respectively.SparkleUpdatermakes 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:
CheckForUpdatesQuietlynow 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-inSparkleUpdaterby calling_sparkle.ShowUpdateNeededUI(updateInfo.Updates). - Breaking change: DLL assembly names for .NET Framework WinForms UI dlls changed from
NetSparkle.UI.WinFormstoNetSparkleUpdater.UI.WinForms. - Breaking change: DLL assembly names for Avalonia UI dlls changed from
NetSparkle.UI.AvaloniatoNetSparkleUpdater.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.JsonorNewtonsoft.Jsonitem is used!