2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Add '-externalupdater' command-line argument.

Now no-autoupdater mode can be switched on in runtime.
Also TDESKTOP_DISABLE_AUTOUPDATE build is disabled in CI (trivial).

Fixes #4895.
This commit is contained in:
John Preston
2018-07-12 01:14:44 +03:00
parent e2bc6990c7
commit 52e7ddf079
29 changed files with 449 additions and 420 deletions

View File

@@ -91,10 +91,9 @@ Application::Application(
char **argv)
: QApplication(argc, argv)
, _launcher(launcher)
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
, _updateChecker(std::make_unique<Core::UpdateChecker>())
#endif // TDESKTOP_DISABLE_AUTOUPDATE
{
, _updateChecker(Core::UpdaterDisabled()
? nullptr
: std::make_unique<Core::UpdateChecker>()) {
const auto d = QFile::encodeName(QDir(cWorkingDir()).absolutePath());
char h[33] = { 0 };
hashMd5Hex(d.constData(), d.size(), h);
@@ -204,13 +203,13 @@ void Application::socketError(QLocalSocket::LocalSocketError e) {
}
#endif // !Q_OS_WINRT
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
if (!cNoStartUpdate() && Core::checkReadyUpdate()) {
if (!Core::UpdaterDisabled()
&& !cNoStartUpdate()
&& Core::checkReadyUpdate()) {
cSetRestartingUpdate(true);
DEBUG_LOG(("Application Info: installing update instead of starting app..."));
return App::quit();
}
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
singleInstanceChecked();
}
@@ -384,9 +383,7 @@ void Application::closeApplication() {
_localSocket.close();
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
_updateChecker = nullptr;
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
}
inline Application *application() {