فهرست منبع

Updater improvements

flabbet 2 سال پیش
والد
کامیت
c50098d87d

+ 1 - 1
src/Installer/installer-setup-x64-light.iss

@@ -10,7 +10,7 @@
 
 // custom setup info
 #define MyAppName "PixiEditor"
-#define MyAppVersion GetFileVersion("..\Builds\PixiEditor-x64-light\PixiEditor\PixiEditor.exe")     ;Not perfect solution, it's enviroment dependend
+#define MyAppVersion GetFileVersion("..\..\Builds\PixiEditor-x64-light\PixiEditor\PixiEditor.exe")     ;Not perfect solution, it's enviroment dependend
 #define MyAppPublisher "PixiEditor"
 #define MyAppURL "https://github.com/PixiEditor/PixiEditor"
 #define MyAppExeName "PixiEditor.exe"

+ 1 - 1
src/Installer/installer-setup-x86-light.iss

@@ -10,7 +10,7 @@
 
 // custom setup info
 #define MyAppName "PixiEditor"
-#define MyAppVersion GetFileVersion("..\Builds\PixiEditor-x86-light\PixiEditor\PixiEditor.exe")     ;Not perfect solution, it's enviroment dependend
+#define MyAppVersion GetFileVersion("..\..\Builds\PixiEditor-x86-light\PixiEditor\PixiEditor.exe")     ;Not perfect solution, it's enviroment dependend
 #define MyAppPublisher "PixiEditor"
 #define MyAppURL "https://github.com/PixiEditor/PixiEditor"
 #define MyAppExeName "PixiEditor.exe"

+ 8 - 2
src/PixiEditor/ViewModels/SubViewModels/Main/UpdateViewModel.cs

@@ -43,7 +43,7 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
             RaisePropertyChanged(nameof(UpdateReadyToInstall));
             if (value)
             {
-                VersionText = $"to install update (current {VersionHelpers.GetCurrentAssemblyVersionString()})"; // Button shows "Restart" before this text
+                VersionText = $"to install update ({UpdateChecker.LatestReleaseInfo.TagName})"; // Button shows "Restart" before this text
             }
         }
     }
@@ -105,7 +105,13 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
                     $"update-{UpdateChecker.LatestReleaseInfo.TagName}.exe");
 
                 bool updateExeExists = File.Exists(exePath);
-                
+
+                if (updateExeExists && !UpdateChecker.VersionDifferent(UpdateChecker.LatestReleaseInfo.TagName, UpdateChecker.CurrentVersionTag))
+                {
+                    File.Delete(exePath);
+                    updateExeExists = false;
+                }
+
                 string updaterPath = Path.Join(dir, "PixiEditor.UpdateInstaller.exe");
 
                 if (updateFileExists || updateExeExists)