Skip to content

Commit

Permalink
fix: it was impossible to go back from beta to release
Browse files Browse the repository at this point in the history
  • Loading branch information
PocketMiner82 committed Apr 10, 2024
1 parent 91b345d commit 3fd18b0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pseudocodeIdeUpdater/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ static void Main(string[] args)

Version assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;

if (assemblyVersion.Revision > 0)
{
// beta release
AutoUpdater.InstalledVersion = new Version($"{assemblyVersion.Major}.{assemblyVersion.Minor}.{assemblyVersion.Build}.{assemblyVersion.Revision}");
}
else if (assemblyVersion.Revision > 0 && !beta)
if (assemblyVersion.Revision > 0 && !beta && !firstRun)
{
// hack to allow to go back to stable release, as the last version tag (pre release count) will be missing
// without this hack, the AutoUpdater would think that the new release is a lower version than this
AutoUpdater.InstalledVersion = new Version($"{assemblyVersion.Major - 1}.{assemblyVersion.Minor}.{assemblyVersion.Build}");
AutoUpdater.InstalledVersion = new Version($"0.0.0");
}
else if (assemblyVersion.Revision > 0)
{
// beta release
AutoUpdater.InstalledVersion = new Version($"{assemblyVersion.Major}.{assemblyVersion.Minor}.{assemblyVersion.Build}.{assemblyVersion.Revision}");
}
else
{
Expand Down

0 comments on commit 3fd18b0

Please sign in to comment.