ソースを参照

Server Updates can now be bypassed if required

frogsoftware 1 年間 前
コミット
c42f1be2ca
2 ファイル変更6 行追加5 行削除
  1. 1 1
      prs.server/Forms/Configuration.xaml.cs
  2. 5 4
      prs.shared/Update.cs

+ 1 - 1
prs.server/Forms/Configuration.xaml.cs

@@ -124,7 +124,7 @@ public partial class Configuration : ThemableWindow
 
     private bool CheckForUpdates()
     {
-        return Update.CheckForUpdates(GetUpdateLocation, GetLatestVersion, GetReleaseNotes, GetInstaller, BeforeUpdate, true, "PRSSetup.exe");
+        return Update.CheckForUpdates(GetUpdateLocation, GetLatestVersion, GetReleaseNotes, GetInstaller, BeforeUpdate, true, "PRSSetup.exe", true);
     }
 
     #endregion

+ 5 - 4
prs.shared/Update.cs

@@ -58,12 +58,12 @@ namespace PRS.Shared
             return string.Join('\n', display);
         }
 
-        private static bool? ShowReleaseNotes(string display, string latestVersion, string currentVersion)
+        private static bool? ShowReleaseNotes(string display, string latestVersion, string currentVersion, bool allowCancel = false)
         {
             var form = new NotesForm
             {
                 Caption = string.Format("Release {0} is available!", latestVersion),
-                CancelEnabled = false,
+                CancelEnabled = allowCancel,
                 Text = string.Format(
                     "The following changes and improvements have been made since your last update (v{0}). Please review and click [OK] to update your software.\n\n{1} ",
                     currentVersion,
@@ -88,7 +88,8 @@ namespace PRS.Shared
             Func<string, byte[]?>? getInstaller,
             Action? beforeUpdate,
             bool elevated,
-            string tempName)
+            string tempName,
+            bool allowCancel = false)
         {
 
             var display = "";
@@ -117,7 +118,7 @@ namespace PRS.Shared
 
             if (display.IsNullOrWhiteSpace()) return false;
 
-            if (ShowReleaseNotes(display, latestVersion, currentVersion) == true)
+            if (ShowReleaseNotes(display, latestVersion, currentVersion, allowCancel) == true)
             {
                 if (getInstaller == null)
                     return true;