mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-21 19:39:00 +00:00
This PR establishes the initial infrastructure required to migrate gpt4all away from reliance on the IFW framwork by implementing a custom updater. This custom updater (currently headless only) can perform the same operations as the existing updater with the option for more functionality to be added and most importantly, is installer agnostic, meaning gpt4all can start to leverage platform specific installers. Implements both offline and online installation and update mechanisms. Initial implementation of: https://github.com/nomic-ai/gpt4all/issues/2878 Signed-off-by: John Parent <john.parent@kitware.com>
39 lines
865 B
C++
39 lines
865 B
C++
#pragma once
|
|
|
|
#include <QDir>
|
|
#include <QVersionNumber>
|
|
#include <QString>
|
|
#include <QStringList>
|
|
#include <QFile>
|
|
#include <QCoreApplication>
|
|
|
|
namespace gpt4all {
|
|
namespace state {
|
|
|
|
class Gpt4AllState : public QObject {
|
|
public:
|
|
virtual ~Gpt4AllState() = default;
|
|
static Gpt4AllState & getInstance();
|
|
QVersionNumber &getCurrentGpt4AllVersion();
|
|
QFile &getCurrentGpt4AllConfig();
|
|
QDir &getCurrentGpt4AllInstallRoot();
|
|
bool checkForExistingInstall();
|
|
QFile &getInstaller();
|
|
void setInstaller(QFile *installer);
|
|
void removeCurrentInstallation();
|
|
bool getExistingInstaller();
|
|
#ifdef OFFLINE
|
|
void driveOffline();
|
|
#endif
|
|
|
|
private:
|
|
explicit Gpt4AllState(QObject *parent = nullptr) {}
|
|
QFile *installer;
|
|
QFile currentGpt4AllConfig;
|
|
QDir currentGpt4AllInstallPath;
|
|
QVersionNumber currentGpt4AllVersion;
|
|
};
|
|
}
|
|
}
|
|
|