diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 6ccf2a46c043ede176af60243211c481406631cb..c33afa3deb1e96e008997687d0a811f3e643b62e 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -79,6 +79,7 @@ bool opt_start_virtualcam = false; bool opt_minimize_tray = false; bool opt_allow_opengl = false; bool opt_always_on_top = false; +bool opt_disable_updater = false; string opt_starting_collection; string opt_starting_profile; string opt_starting_scene; @@ -1424,6 +1425,11 @@ bool OBSApp::IsPortableMode() return portable_mode; } +bool OBSApp::IsUpdaterDisabled() +{ + return opt_disable_updater; +} + #ifdef __APPLE__ #define INPUT_AUDIO_SOURCE "coreaudio_input_capture" #define OUTPUT_AUDIO_SOURCE "coreaudio_output_capture" @@ -2450,6 +2456,9 @@ int main(int argc, char *argv[]) } else if (arg_is(argv[i], "--allow-opengl", nullptr)) { opt_allow_opengl = true; + } else if (arg_is(argv[i], "--disable-updater", nullptr)) { + opt_disable_updater = true; + } else if (arg_is(argv[i], "--help", "-h")) { std::string help = "--help, -h: Get list of available commands.\n\n" @@ -2467,7 +2476,8 @@ int main(int argc, char *argv[]) "--multi, -m: Don't warn when launching multiple instances.\n\n" "--verbose: Make log more verbose.\n" "--always-on-top: Start in 'always on top' mode.\n\n" - "--unfiltered_log: Make log unfiltered.\n\n"; + "--unfiltered_log: Make log unfiltered.\n\n" + "--disable-updater: Disable built-in updater (Windows/Mac only)\n\n"; #ifdef _WIN32 MessageBoxA(NULL, help.c_str(), "Help", @@ -2493,6 +2503,12 @@ int main(int argc, char *argv[]) os_file_exists(BASE_PATH "/portable_mode.txt") || os_file_exists(BASE_PATH "/obs_portable_mode.txt"); } + + if (!opt_disable_updater) { + opt_disable_updater = + os_file_exists(BASE_PATH "/disable_updater") || + os_file_exists(BASE_PATH "/disable_updater.txt"); + } #endif upgrade_settings(); diff --git a/UI/obs-app.hpp b/UI/obs-app.hpp index 506a154c4ea9c787b23509da4a1091e98e0b307a..3fbff32a1f0b4887bdd30daebbb1c113563d26d5 100644 --- a/UI/obs-app.hpp +++ b/UI/obs-app.hpp @@ -144,6 +144,7 @@ public: std::string GetVersionString() const; bool IsPortableMode(); + bool IsUpdaterDisabled(); const char *InputAudioSource() const; const char *OutputAudioSource() const; diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index bb123166471482dff6e9e9071b17387b630b9768..d8ff95b3920b4ba4e53a6070b6fe57b76e2ff56e 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1894,6 +1894,9 @@ void OBSBasic::OBSInit() ui->actionUploadLastCrashLog = nullptr; ui->menuCrashLogs = nullptr; ui->actionCheckForUpdates = nullptr; +#elif _WIN32 || __APPLE__ + if (App()->IsUpdaterDisabled()) + ui->actionCheckForUpdates->setEnabled(false); #endif OnFirstLoad(); @@ -3248,6 +3251,8 @@ void trigger_sparkle_update(); void OBSBasic::TimedCheckForUpdates() { + if (App()->IsUpdaterDisabled()) + return; if (!config_get_bool(App()->GlobalConfig(), "General", "EnableAutoUpdates")) return;