mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-04 00:31:07 +02:00
Fix defaults scripts and add version checking to qt launcher
This commit is contained in:
parent
a78be7a451
commit
b5df1a9f4d
1 changed files with 24 additions and 10 deletions
|
@ -21,6 +21,11 @@
|
||||||
|
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
|
QString getCurrentClientVersion() {
|
||||||
|
// TODO Implement client version checking
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LatestBuilds::getBuild(QString tag, Build* outBuild) {
|
bool LatestBuilds::getBuild(QString tag, Build* outBuild) {
|
||||||
if (tag.isNull()) {
|
if (tag.isNull()) {
|
||||||
|
@ -246,6 +251,13 @@ void LauncherState::downloadClient() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto currentVersion = getCurrentClientVersion();
|
||||||
|
if (QString::number(build.latestVersion) == currentVersion) {
|
||||||
|
qDebug() << "Existing client install is up-to-date.";
|
||||||
|
downloadContentCache();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_downloadProgress = 0;
|
_downloadProgress = 0;
|
||||||
setApplicationState(ApplicationState::DownloadingClient);
|
setApplicationState(ApplicationState::DownloadingClient);
|
||||||
|
|
||||||
|
@ -294,8 +306,9 @@ void LauncherState::installClient() {
|
||||||
ASSERT_STATE(ApplicationState::DownloadingClient);
|
ASSERT_STATE(ApplicationState::DownloadingClient);
|
||||||
setApplicationState(ApplicationState::InstallingClient);
|
setApplicationState(ApplicationState::InstallingClient);
|
||||||
|
|
||||||
auto installDir = _launcherDirectory.absoluteFilePath("interface_install");
|
_launcherDirectory.rmpath("interface_install");
|
||||||
_launcherDirectory.mkpath("interface_install");
|
_launcherDirectory.mkpath("interface_install");
|
||||||
|
auto installDir = _launcherDirectory.absoluteFilePath("interface_install");
|
||||||
|
|
||||||
_downloadProgress = 0;
|
_downloadProgress = 0;
|
||||||
|
|
||||||
|
@ -323,7 +336,7 @@ void LauncherState::installClient() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherState::downloadContentCache() {
|
void LauncherState::downloadContentCache() {
|
||||||
ASSERT_STATE(ApplicationState::InstallingClient);
|
ASSERT_STATE({ ApplicationState::RequestingLogin, ApplicationState::InstallingClient });
|
||||||
|
|
||||||
// Start content set cache download
|
// Start content set cache download
|
||||||
if (shouldDownloadContentCache()) {
|
if (shouldDownloadContentCache()) {
|
||||||
|
@ -410,12 +423,13 @@ void LauncherState::launchClient() {
|
||||||
QDir installDirectory = _launcherDirectory.filePath("interface_install");
|
QDir installDirectory = _launcherDirectory.filePath("interface_install");
|
||||||
auto clientPath = installDirectory.absoluteFilePath("interface.exe");
|
auto clientPath = installDirectory.absoluteFilePath("interface.exe");
|
||||||
|
|
||||||
|
// TODO Get correct home path
|
||||||
QString homePath = "hifi://hq";
|
QString homePath = "hifi://hq";
|
||||||
QString defaultScriptsPath = installDirectory.filePath("scripts/simplifiedUIBootstrapper");
|
QString defaultScriptsPath = installDirectory.filePath("scripts/simplifiedUIBootstrapper.js");
|
||||||
QString displayName = "fixMe";
|
QString displayName = "fixMe";
|
||||||
QString contentCachePath = _launcherDirectory.filePath("cache");
|
QString contentCachePath = _launcherDirectory.filePath("cache");
|
||||||
|
|
||||||
// TODO Fix parameters
|
// TODO Confirm that these params are correct across Windows and OSX
|
||||||
QString params = "--url " + homePath
|
QString params = "--url " + homePath
|
||||||
+ " --setBookmark hqhome=\"" + homePath + "\""
|
+ " --setBookmark hqhome=\"" + homePath + "\""
|
||||||
+ " --defaultScriptsOverride " + QDir::toNativeSeparators(defaultScriptsPath)
|
+ " --defaultScriptsOverride " + QDir::toNativeSeparators(defaultScriptsPath)
|
||||||
|
|
Loading…
Reference in a new issue