summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2018-04-23 21:21:20 +0100
committersr55 <[email protected]>2018-04-23 21:52:52 +0100
commit128041edb0a8183bb4b27d906e31df4e3dfc32f4 (patch)
treecfabbf8c5f27b12c29fd485fdcf66bd6eb3346db /win
parente845711c6fce01a393bde81541462903a63b749a (diff)
WinGui: Portable Mode: New option to disable startup update check.
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Services/UpdateService.cs5
-rw-r--r--win/CS/HandBrakeWPF/Utilities/Portable.cs16
-rw-r--r--win/CS/HandBrakeWPF/portable.ini.template4
3 files changed, 24 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/Services/UpdateService.cs b/win/CS/HandBrakeWPF/Services/UpdateService.cs
index b5213f05d..c0a1bcab6 100644
--- a/win/CS/HandBrakeWPF/Services/UpdateService.cs
+++ b/win/CS/HandBrakeWPF/Services/UpdateService.cs
@@ -68,6 +68,11 @@ namespace HandBrakeWPF.Services
return; // Disable Update checker if we are in a UWP container.
}
+ if (Portable.IsPortable() && !Portable.IsUpdateCheckEnabled())
+ {
+ return; // Disable Update Check for Portable Mode.
+ }
+
// Make sure it's running on the calling thread
if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UpdateStatus))
{
diff --git a/win/CS/HandBrakeWPF/Utilities/Portable.cs b/win/CS/HandBrakeWPF/Utilities/Portable.cs
index c2dcb6f3e..243f8e5f2 100644
--- a/win/CS/HandBrakeWPF/Utilities/Portable.cs
+++ b/win/CS/HandBrakeWPF/Utilities/Portable.cs
@@ -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>
diff --git a/win/CS/HandBrakeWPF/portable.ini.template b/win/CS/HandBrakeWPF/portable.ini.template
index 4c62e6e21..495a73441 100644
--- a/win/CS/HandBrakeWPF/portable.ini.template
+++ b/win/CS/HandBrakeWPF/portable.ini.template
@@ -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