Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion UI/obs-app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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();
Expand Down
1 change: 1 addition & 0 deletions UI/obs-app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class OBSApp : public QApplication {

std::string GetVersionString() const;
bool IsPortableMode();
bool IsUpdaterDisabled();

const char *InputAudioSource() const;
const char *OutputAudioSource() const;
Expand Down
5 changes: 5 additions & 0 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -3248,6 +3251,8 @@ void trigger_sparkle_update();

void OBSBasic::TimedCheckForUpdates()
{
if (App()->IsUpdaterDisabled())
return;
if (!config_get_bool(App()->GlobalConfig(), "General",
"EnableAutoUpdates"))
return;
Expand Down