NetSparkleUpdater / NetSparkle

NetSparkle is a C#, cross-platform, highly-configurable software update framework with pre-built UI for .NET developers compatible with .NET 4.6.2/.NET 6+, WinForms, WPF, and Avalonia; uses Ed25519 signatures. View basic usage here in the README and try the samples for yourself.
https://netsparkleupdater.github.io/NetSparkle/
MIT License
606 stars 84 forks source link

Unable to save key in custom path #458

Closed huangkai1994 closed 1 year ago

huangkai1994 commented 1 year ago

I tried to generate the token in the custom path by using the following command, but it didn't work. netsparkle-generate-appcast --generate-keys --key-path D:\Test\ I am generating the key in the default path,Then copy the file to a custom directory, specifying the path with the --key-path parameter,Am I using it the wrong way?

huangkai1994 commented 1 year ago

_sparkleUpdateDetector.StartLoop(true, true, TimeSpan.FromMinutes(1)); I have another question that I would like to ask you. When there is an update, how to pass the event notification without the update prompt window popping up. I am now binding UpdateDetected events, by setting the attribute e.N extAction = NetSparkleUpdater. Enums. NextUpdateAction.ProhibitUpdate; But when I use _sparkle CheckForUpdatesAtUserRequest (); Method, two update prompt Windows will pop up. So I had to use the following code to avoid the two update Windows popping up var result = await _sparkleUpdateDetector.CheckForUpdatesQuietly(); if (result.Status == NetSparkleUpdater.Enums.UpdateStatus.UpdateAvailable) { // if update(s) are found, then we have to trigger the UI to show it gracefully _sparkleUpdateDetector.ShowUpdateNeededUI(); }

christophwille commented 1 year ago

I was about to open exactly that same issue:

PS D:\Demos\NetsparkleTest> netsparkle-generate-appcast --generate-keys --key-path ./signingkeys
NetSparkleUpdaterAppCastGenerator 2.2.1
Copyright c ndreisg 2019, Deadpikle 2020-2022

ERROR(S):
Option: 'key-path' is not compatible with: 'generate-keys'.
Option: 'generate-keys' is not compatible with: 'key-path'.
Deadpikle commented 1 year ago

Thanks for the reports. This has been broken for an embarrassingly long time. Unit tests didn't catch this (even though they use this feature) since it hooks into the function calls directly without testing the command line param groups.

It's fixed locally on my machine and I'll be pushing a new version once I parse some of the other filed issues.

Thank you again.

@huangkai1994 Please keep distinct, unrelated issues separate and don't file multiple questions/problems in the same GitHub issue so that things can be tracked easily for everyone. I'm not sure what you're asking, apologies. You can use startLoop(false, false, TimeSpan.FromMinutes(1)) if you don't want the initial check to happen. If you don't want the update window to pop open at all, then make use of events and CheckForUpdatesQuietly to not show the UI as you've noted or use your own IUIFactory tweaked to your needs.