From 3fd18b0b13ea86d12706d10b6090bd595f89c342 Mon Sep 17 00:00:00 2001 From: PocketMiner82 Date: Wed, 10 Apr 2024 15:04:21 +0200 Subject: [PATCH] fix: it was impossible to go back from beta to release --- pseudocodeIdeUpdater/Program.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pseudocodeIdeUpdater/Program.cs b/pseudocodeIdeUpdater/Program.cs index 12d4650..6c5f9f8 100644 --- a/pseudocodeIdeUpdater/Program.cs +++ b/pseudocodeIdeUpdater/Program.cs @@ -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 {