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
Bot releases are hidden (Show)
Published by Deadpikle over 3 years ago
WebClientFileDownloader
used its WebClient
to download a file more than onceAvalonia
libs to 0.10.2
(from 0.10.0
) for bug fixesPublished by Deadpikle over 3 years ago
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!
NetSparkle
to NetSparkleUpdater
Sparkle
renamed to SparkleUpdater
for clarityLogWriter
to help you debug and figure out any issues that are going onNetSparkleUpdater
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.
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.SparkleUpdater
constructors now require an ISignatureVerifier
in order to "force" you to choose your signature verification methodSecurityMode
is a new enum that defines which signatures are required and which signatures are not required
SecurityMode.OnlyVerifySoftwareDownloads
if you want to verify only software download signatures and don't care about verifying your app cast or release notesUIFactory
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
objectsSparkleUpdater
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 fileIUpdateDownloader
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 parsingISignatureVerifier
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 methodILogger
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 fromSparkleUpdater
functions are now virtual and thus more easily overridden for your specific use caseReleaseNotesGrabber
functions are now virtual as well.DownloadEvent
now has the AppCastItem
that is being downloaded rather than being just the download pathAboutToExitForInstallerRun
/AboutToExitForInstallerRunAsync
has been renamed to PreparingToExit
/PreparingToExitAsync
, respectivelyUserSkippedVersion
event has been removed. Use UserRespondedToUpdate
instead.RemindMeLaterSelected
event has been removed. Use UserRespondedToUpdate
instead.FinishedDownloading
/DownloadedFileReady
events have been removed. Use DownloadFinished
instead.StartedDownloading
event has been removed and replaced with DownloadStarted
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
.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.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.
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.AssemblyAccessor
class in lieu of IAssemblyAccessor
implementorsSparkleUpdater.CheckServerFileName
to false
.bool ignoreSkippedVersions = false
has been added to CheckForUpdatesAtUserRequest
, CheckForUpdatesQuietly
, and GetUpdateStatus
to make ignoring skipped versions easier.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!!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)
.NetSparkle.UI.WinForms
to NetSparkleUpdater.UI.WinForms
.NetSparkle.UI.Avalonia
to NetSparkleUpdater.UI.Avalonia
.System.Text.Json
or Newtonsoft.Json
item is used!Published by Deadpikle almost 5 years ago
RegistryConfiguration.BuildRegistryInfo()
is now public virtual
rather than private
Published by Deadpikle almost 5 years ago
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)AutoSize = true
to alleviate some concerns outlined in #44Published by Deadpikle almost 5 years ago
Published by Deadpikle over 5 years ago
NetSparkle
as it does not follow the RSS spec). This change was made to be consistent with how release notes are downloaded.NetSparkleUtilities
namespace renamed to just NetSparkle
.Published by Deadpikle over 5 years ago
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.Published by Deadpikle over 6 years ago
AppCastItem
is now marked serializableSecurityMode.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)DownloadCanceled
event was fired twice (@rolikoff)Published by Deadpikle over 6 years ago
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.
OperatingSystemString
(default "windows") and bool IsWindowsUpdate
to AppCastItem
AppCast.GetUpdates()
no longer returns non-Windows updatesenclosure
tag can now be either enclosure
or sparkle:enclosure
AppCastItem.MIMEType
to read the <enclosure type="">
attribute if they want to (#15). Defaults to application/octet-stream
.UpdateDetectedEventArgs.AppCastItems
if you want to look at all available app cast itemsDownloadPathForAppCastItem(AppCastItem item)
to easily grab the download path for a given downloadable appcast itemRunUpdate(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!NetSparkle.UpdateSystemProfileInformation
is now privateAppCast
no longer takes a Sparkle object and instead takes only those parameters that it needs to operateNextUpdateAction
is now in its own file in the NetSparkle.Enums
namespacePublished by Deadpikle almost 7 years ago
HideRemindMeLaterButton()
to IUpdateAvailable
HideSkipButton()
to IUpdateAvailable
HideRemindMeLaterButton
to the NetSparkle
class. Defaults to false. Set to true to make NetSparkle
call HideRemindMeLaterButton()
when showing the update window.HideSkipButton
to the NetSparkle
class. Defaults to false. Set to true to make NetSparkle
call HideSkipButton()
when showing the update window.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)ValidationResult.Unchecked
was not returned properly from OnDownloadFinished
if download file signature is null (@keithclanton)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)Published by Deadpikle about 7 years ago
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!)!UpdateStatus
enum to NetSparkle.Enums
UpdateInfo
class to its own fileConfiguration.cs
where a few values were not set properly in the constructor due to InitWithDefaultValues
being called at the wrong time (@devstudiosoft)AssemblyDiagnosticsAccessor
where AssemblyProduct
returned the assembly version and not the assembly name (@devstudiosoft)public void NetSparkle.ReportDiagnosticMessage
in lieu of new LogWriter
class.Published by Deadpikle over 7 years ago
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.
Published by Deadpikle over 7 years ago
QuitApplication()
functionRunDownloadedInstaller()
is now virtual and protectedSecurityMode
and ValidationResult
enums to the NetSparkle.Enums
namespacePublished by Deadpikle over 7 years ago
Sparkle
class documentation to the readmeMuch thanks to @stephenwade for his contributions to 0.10.0
NetSparkleAppCast
to AppCast
, NetSparkleConfiguration
to Configuration
, etc.) (@stephenwade)UseSyncronizedForms
to ShowsUIOnMainThread
to better represent what it does (@stephenwade)CloseWPFSoftware
and CloseWPFSoftwareAsync
to CloseApplication
and CloseApplicationAsync
(@stephenwade)
RunningFromWPF
)DSAVerificator
to DSAChecker
(@stephenwade)EnableSilentMode
RunningFromWPF
Published by Deadpikle over 7 years ago
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.EnableSilentMode
(not sure how I never came across this!)Published by Deadpikle over 7 years ago
UpdateSize
to NetSparkleAppCastItem
=> analogous to the length
field within the <enclosure>
tagIsCriticalUpdate
to NetSparkleAppCastItem
=> to use, add sparkle:criticalUpdate="true"
as an attribute to the <enclosure>
tag
Sparkle.LatestAppCastItems
or Sparkle.UpdateMarkedCritical
to see if an update in the list of updates that the user needs is criticalPublished by Deadpikle over 7 years ago
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.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.EnableSilentMode
in lieu of SilentMode
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.