From 6711bddc4c343ecc94c2e2a9cbff3a19259e9b67 Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Thu, 21 Sep 2023 15:44:28 -0700 Subject: [PATCH] launch browser instead of maintenancetool from offline builds --- gpt4all-chat/CMakeLists.txt | 1 - gpt4all-chat/llm.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gpt4all-chat/CMakeLists.txt b/gpt4all-chat/CMakeLists.txt index cc17b592..108dc5eb 100644 --- a/gpt4all-chat/CMakeLists.txt +++ b/gpt4all-chat/CMakeLists.txt @@ -274,7 +274,6 @@ if (GPT4ALL_LOCALHOST) cpack_ifw_add_repository("GPT4AllRepository" URL "http://localhost/repository") elseif(GPT4ALL_OFFLINE_INSTALLER) add_compile_definitions(GPT4ALL_OFFLINE_INSTALLER) - # noop else() if(${CMAKE_SYSTEM_NAME} MATCHES Linux) cpack_ifw_add_repository("GPT4AllRepository" URL "https://gpt4all.io/installer_repos/linux/repository") diff --git a/gpt4all-chat/llm.cpp b/gpt4all-chat/llm.cpp index 7953b296..c83e07f4 100644 --- a/gpt4all-chat/llm.cpp +++ b/gpt4all-chat/llm.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include class MyLLM: public LLM { }; @@ -60,6 +61,10 @@ bool LLM::hasSettingsAccess() const bool LLM::checkForUpdates() const { + #ifdef GPT4ALL_OFFLINE_INSTALLER + #pragma message "offline installer build will not check for updates!" + return QDesktopServices::openUrl(QUrl("https://gpt4all.io/")); + #else Network::globalInstance()->sendCheckForUpdates(); #if defined(Q_OS_LINUX) @@ -78,6 +83,7 @@ bool LLM::checkForUpdates() const } return QProcess::startDetached(fileName); + #endif } bool LLM::directoryExists(const QString &path) const