Disable updater on Steam

This commit is contained in:
Atlante45 2016-11-07 15:41:43 -08:00
parent 25b9b97609
commit f34cf64f3e
4 changed files with 21 additions and 8 deletions

View file

@ -599,7 +599,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
qCDebug(interfaceapp) << "Home sandbox does not appear to be running....";
if (wantsSandboxRunning) {
QString contentPath = getRunServerPath();
SandboxUtils::runLocalSandbox(contentPath, true, RUNNING_MARKER_FILENAME);
bool noUpdater = SteamClient::isRunning();
SandboxUtils::runLocalSandbox(contentPath, true, RUNNING_MARKER_FILENAME, noUpdater);
sandboxIsRunning = true;
}
determinedSandboxState = true;
@ -1119,9 +1120,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
setActiveEyeTracker();
#endif
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
applicationUpdater->checkForUpdate();
// If launched from Steam, let it handle updates
if (!SteamClient::isRunning()) {
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
applicationUpdater->checkForUpdate();
}
// Now that menu is initialized we can sync myAvatar with it's state.
myAvatar->updateMotionBehaviorFromMenu();

View file

@ -61,15 +61,16 @@ void SandboxUtils::ifLocalSandboxRunningElse(std::function<void()> localSandboxR
}
void SandboxUtils::runLocalSandbox(QString contentPath, bool autoShutdown, QString runningMarkerName) {
void SandboxUtils::runLocalSandbox(QString contentPath, bool autoShutdown, QString runningMarkerName, bool noUpdater) {
QString applicationDirPath = QFileInfo(QCoreApplication::applicationFilePath()).path();
QString serverPath = applicationDirPath + "/server-console/server-console.exe";
qDebug() << "Application dir path is: " << applicationDirPath;
qDebug() << "Server path is: " << serverPath;
qDebug() << "autoShutdown: " << autoShutdown;
qDebug() << "noUpdater: " << noUpdater;
bool hasContentPath = !contentPath.isEmpty();
bool passArgs = autoShutdown || hasContentPath;
bool passArgs = autoShutdown || hasContentPath || noUpdater;
QStringList args;
@ -87,6 +88,10 @@ void SandboxUtils::runLocalSandbox(QString contentPath, bool autoShutdown, QStri
args << "--shutdownWatcher" << interfaceRunningStateFile;
}
if (noUpdater) {
args << "--noUpdater";
}
qDebug() << applicationDirPath;
qDebug() << "Launching sandbox with:" << args;
qDebug() << QProcess::startDetached(serverPath, args);

View file

@ -26,7 +26,7 @@ public:
void ifLocalSandboxRunningElse(std::function<void()> localSandboxRunningDoThis,
std::function<void()> localSandboxNotRunningDoThat);
static void runLocalSandbox(QString contentPath, bool autoShutdown, QString runningMarkerName);
static void runLocalSandbox(QString contentPath, bool autoShutdown, QString runningMarkerName, bool noUpdater);
};
#endif // hifi_SandboxUtils_h

View file

@ -579,6 +579,10 @@ function backupResourceDirectoriesAndRestart() {
}
function checkNewContent() {
if (argv.noUpdater) {
return;
}
// Start downloading content set
var req = request.head({
url: HOME_CONTENT_URL
@ -817,7 +821,7 @@ function onContentLoaded() {
// Disable splash window for now.
// maybeShowSplash();
if (buildInfo.releaseType == 'PRODUCTION') {
if (buildInfo.releaseType == 'PRODUCTION' && !argv.noUpdater) {
var currentVersion = null;
try {
currentVersion = parseInt(buildInfo.buildIdentifier);