]> granicus.if.org Git - handbrake/commitdiff
WinGui: Portable Mode: New option to disable startup update check.
authorsr55 <sr55.hb@outlook.com>
Mon, 23 Apr 2018 20:21:20 +0000 (21:21 +0100)
committersr55 <sr55.hb@outlook.com>
Mon, 23 Apr 2018 20:52:52 +0000 (21:52 +0100)
win/CS/HandBrakeWPF/Services/UpdateService.cs
win/CS/HandBrakeWPF/Utilities/Portable.cs
win/CS/HandBrakeWPF/portable.ini.template

index b5213f05dcf569d7001ec945e72b7bb70bde5310..c0a1bcab6b2033e997eaa4a698f580c659fbfebc 100644 (file)
@@ -68,6 +68,11 @@ namespace HandBrakeWPF.Services
                 return; // Disable Update checker if we are in a UWP container.\r
             }\r
 \r
+            if (Portable.IsPortable() && !Portable.IsUpdateCheckEnabled())\r
+            {\r
+                return; // Disable Update Check for Portable Mode.\r
+            }\r
+\r
             // Make sure it's running on the calling thread\r
             if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UpdateStatus))\r
             {\r
index c2dcb6f3ee99a0f6ee2fbf892df3456024e9c91f..243f8e5f22015c6afb511bdb6c57f626195e0998 100644 (file)
@@ -117,6 +117,22 @@ namespace HandBrakeWPF.Utilities
             return storagePath;
         }
 
+        public static bool IsUpdateCheckEnabled()
+        {
+            if (keyPairs.ContainsKey("update.check"))
+            {
+                string updateCheckEnabled = keyPairs["update.check"];
+                if (!string.IsNullOrEmpty(updateCheckEnabled) && updateCheckEnabled.Trim() == "true")
+                {
+                    return true;
+                }
+
+                return false;
+            }
+
+            return true;
+        }
+
         /// <summary>
         /// The get temp directory.
         /// </summary>
index 4c62e6e218a7e9504e545b014bde2ac35f666429..495a73441467e7cb5aa6d23c82765fc1b7dc0789 100644 (file)
@@ -5,10 +5,12 @@
 # - Rename this file to portable.ini to activate feature.
 # - storage.dir => Stores Presets, Settings and Log Files.
 # - tmp.dir => temporary files only. (i.e Preview images)
+# - update.check =>  true | false   (enabled / disabled, default disabled for portable)
 #     
 # Set to 'cwd' to use the current applications directory. It will automatically create "storage" and "tmp" folders in this instance.
 # Leave blank to use the system "TMP" directory and the "AppData" user profile folder.
 #################################
 
 storage.dir = cwd
-tmp.dir = cwd
\ No newline at end of file
+tmp.dir = cwd
+update.check = false
\ No newline at end of file