feat(updater): tie in updater part 1

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers
2023-06-25 21:36:20 -07:00
parent 90da57a806
commit d8e0b14dc4
8 changed files with 390 additions and 16 deletions
+12 -3
View File
@@ -132,6 +132,8 @@
#ifdef Q_OS_MAC
#include "updater/MacSparkleUpdater.h"
#else
#include "updater/PrismExternalUpdater.h"
#endif
#if defined Q_OS_WIN32
@@ -271,10 +273,15 @@ void BindCrtHandlesToStdHandles(bool bindStdIn, bool bindStdOut, bool bindStdErr
Application::Application(int& argc, char** argv) : QApplication(argc, argv)
{
#if defined Q_OS_WIN32
// attach the parent console
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
// attach the parent console if stdout not already captured
auto stdout_type = GetFileType(GetStdHandle(STD_OUTPUT_HANDLE));
if (stdout_type == FILE_TYPE_CHAR || stdout_type == FILE_TYPE_UNKNOWN) {
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
BindCrtHandlesToStdHandles(true, true, true);
consoleAttached = true;
}
} else if (stdout_type == FILE_TYPE_DISK || stdout_type == FILE_TYPE_PIPE ) {
BindCrtHandlesToStdHandles(true, true, true);
consoleAttached = true;
}
#endif
setOrganizationName(BuildConfig.LAUNCHER_NAME);
@@ -823,6 +830,8 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
qDebug() << "Initializing updater";
#ifdef Q_OS_MAC
m_updater.reset(new MacSparkleUpdater());
#else
m_updater.reset(new PrismExternalUpdater(m_rootPath, dataPath));
#endif
qDebug() << "<> Updater started.";
}