Closed hypervtechnics closed 2 months ago
Rather than using events, I chose to use properties on the Configuration
object since Configuration
was already in place and let me keep all the logic there rather than adding more logic to SparkleUpdater
.
In the latest preview of NetSparkle
, you can now use Configuration.IsFirstRun
to see whether this is the first time the application has run. If you reload the configuration data by calling Configuration.Reload()
, this flag will be false
, even in the same run of the software, so...be forewarned if you reload data manually.
You can also now use Configuration.PreviousVersionOfSoftwareRan
to see what the user ran last. The same warnings about reloading configuration data apply. This property is ""
on the first run of the software.
Something like this should be helpful:
if (SparkleUpdater.Configuration.IsFirstRun)
// handle first run
else if (!string.IsNullOrWhiteSpace(SparkleUpdater.Configuration.PreviousVersionOfSoftwareRan)
&& SparkleUpdater.Configuration.PreviousVersionOfSoftwareRan != SparkleUpdater.Configuration.InstalledVersion)
// handle update by figuring out what needs to be updated or shown to the user or whatnot
I don't think we can properly handle Install or Uninstall events at this point since we don't control those events of the software at all.
What do you think about storing the previous version as Version?
(Nullable), so you don't have to parse it?
For the install (which is kind of first run) and uninstall I agree.
I'm sorry for forgetting to reply.
I would rather let the user parse the string themselves if they need to -- they might be storing the version in formats such as 2.0.0-beta2342
or some other incompatible-with-Version
format.
Calling this "done" for 2.0, but am open to further suggestions for 2.1+.
Hi, sorry had no time yet. I am trying to build a full stack prototype for the whole software update path using Avalonia for multiple platforms (Linux and Windows for now), Will look into it.
Oh, that's fine. I'm just wanting to wrap things up for a 2.0 release right now. There's no rush or pressure on you to do anything more (although contributions are always welcome). :)
Closing this as it's been several years and we even now support versions like 1.2.3-beta1
and such. Please re-open or open a new issue if there are more events that are desired.
It would be nice to receive events like with Squirrel to react to certain - who would have guessed - events.
Events:
Also cool to create a small framework to handle migrations to be run when certain versions are passed during an upgrade.