add --skipSplash param

This commit is contained in:
luiscuenca 2019-07-25 11:22:20 -07:00
parent 13952bf27e
commit c3ad65f628
No known key found for this signature in database
GPG key ID: 2387ECD129A6961D
4 changed files with 33 additions and 23 deletions

View file

@ -43,6 +43,7 @@ BOOL CLauncherApp::InitInstance() {
bool restarting = false;
bool noUpdate = false;
bool continueUpdating = false;
bool skipSplash = false;
if (iNumOfArgs > 1) {
for (int i = 1; i < iNumOfArgs; i++) {
CString curArg = CString(pArgs[i]);
@ -54,6 +55,8 @@ BOOL CLauncherApp::InitInstance() {
noUpdate = true;
} else if (curArg.Compare(_T("--continueUpdating")) == 0) {
continueUpdating = true;
} else if (curArg.Compare(_T("--skipSplash")) == 0) {
skipSplash = true;
}
}
}
@ -68,7 +71,7 @@ BOOL CLauncherApp::InitInstance() {
if (uninstalling) {
_manager.uninstall();
} else {
_manager.init(!noUpdate, continueUpdating);
_manager.init(!noUpdate, continueUpdating, skipSplash);
}
if (!_manager.hasFailed() && !_manager.installLauncher()) {
return FALSE;

View file

@ -693,7 +693,6 @@ void CLauncherDlg::OnTimer(UINT_PTR nIDEvent) {
}
}
}
BOOL needsToWait = theApp._manager.needsToWait();
if (_showSplash) {
if (_splashStep == 0) {
if (theApp._manager.needsUninstall()) {
@ -704,10 +703,14 @@ void CLauncherDlg::OnTimer(UINT_PTR nIDEvent) {
setDrawDialog(DrawStep::DrawProcessUpdate);
theApp._manager.updateProgress(LauncherManager::ProcessType::Uninstall, 0.0f);
} else {
theApp._manager.addToLog(_T("Start splash screen"));
setDrawDialog(DrawStep::DrawLogo);
if (theApp._manager.shouldSkipSplashScreen()) {
_splashStep = SPLASH_DURATION;
} else {
theApp._manager.addToLog(_T("Start splash screen"));
setDrawDialog(DrawStep::DrawLogo);
}
}
} else if (_splashStep > SPLASH_DURATION && !needsToWait) {
} else if (_splashStep > SPLASH_DURATION && !theApp._manager.needsToWait()) {
_showSplash = false;
if (theApp._manager.shouldShutDown()) {
if (_applicationWND != NULL) {

View file

@ -21,11 +21,13 @@ LauncherManager::LauncherManager() {
LauncherManager::~LauncherManager() {
}
void LauncherManager::init(BOOL allowUpdate, BOOL continueUpdating) {
void LauncherManager::init(BOOL allowUpdate, BOOL continueUpdating, BOOL skipSplashScreen) {
initLog();
int tokenPos = 0;
_updateLauncherAllowed = allowUpdate;
_continueUpdating = continueUpdating;
_skipSplashScreen = skipSplashScreen;
_shouldWait = !skipSplashScreen;
if (_continueUpdating) {
_progressOffset = CONTINUE_UPDATING_GLOBAL_OFFSET;
}
@ -613,7 +615,7 @@ void LauncherManager::restartNewLauncher() {
if (_willContinueUpdating) {
LauncherUtils::launchApplication(_tempLauncherPath, _T(" --restart --noUpdate --continueUpdating"));
} else {
LauncherUtils::launchApplication(_tempLauncherPath, _T(" --restart --noUpdate"));
LauncherUtils::launchApplication(_tempLauncherPath, _T(" --restart --noUpdate --skipSplash"));
}
Sleep(500);
}

View file

@ -59,7 +59,7 @@ public:
};
LauncherManager();
~LauncherManager();
void init(BOOL allowUpdate, BOOL continueUpdating);
void init(BOOL allowUpdate, BOOL continueUpdating, BOOL skipSplashScreen);
BOOL initLog();
BOOL addToLog(const CString& line);
void closeLog();
@ -90,18 +90,19 @@ public:
const CString& getVersion() const { return _version; }
BOOL shouldShutDown() const { return _shouldShutdown; }
BOOL shouldLaunch() const { return _shouldLaunch; }
BOOL needsUpdate() { return _shouldUpdate; }
BOOL needsSelfUpdate() { return _shouldUpdateLauncher; }
BOOL needsSelfDownload() { return _shouldDownloadLauncher; }
BOOL needsUninstall() { return _shouldUninstall; }
BOOL needsInstall() { return _shouldInstall; }
BOOL needsToWait() { return _shouldWait; }
BOOL needsRestartNewLauncher() { return _shouldRestartNewLauncher; }
BOOL shouldContinueUpdating() { return _continueUpdating; }
BOOL willContinueUpdating() { return _willContinueUpdating; }
BOOL shouldSkipSplashScreen() const { return _skipSplashScreen; }
BOOL needsUpdate() const { return _shouldUpdate; }
BOOL needsSelfUpdate() const { return _shouldUpdateLauncher; }
BOOL needsSelfDownload() const { return _shouldDownloadLauncher; }
BOOL needsUninstall() const { return _shouldUninstall; }
BOOL needsInstall() const { return _shouldInstall; }
BOOL needsToWait() const { return _shouldWait; }
BOOL needsRestartNewLauncher() const { return _shouldRestartNewLauncher; }
BOOL shouldContinueUpdating() const { return _continueUpdating; }
BOOL willContinueUpdating() const { return _willContinueUpdating; }
void setDisplayName(const CString& displayName) { _displayName = displayName; }
bool isLoggedIn() { return _loggedIn; }
bool hasFailed() { return _hasFailed; }
bool isLoggedIn() const { return _loggedIn; }
bool hasFailed() const { return _hasFailed; }
void setFailed(bool hasFailed) { _hasFailed = hasFailed; }
const CString& getLatestInterfaceURL() const { return _latestApplicationURL; }
void uninstall() { _shouldUninstall = true; _shouldWait = false; };
@ -115,7 +116,7 @@ public:
void restartNewLauncher();
void onZipExtracted(ProcessType type, int size);
void onFileDownloaded(ProcessType type);
float getProgress() { return _progress; }
float getProgress() const { return _progress; }
void updateProgress(ProcessType processType, float progress);
void onCancel();
const CString& getLauncherVersion() const { return _launcherVersion; }
@ -145,11 +146,12 @@ private:
BOOL _shouldLaunch { FALSE };
BOOL _shouldWait { TRUE };
BOOL _shouldUpdateLauncher { FALSE };
BOOL _shouldDownloadLauncher{ FALSE };
BOOL _shouldDownloadLauncher { FALSE };
BOOL _updateLauncherAllowed { TRUE };
BOOL _shouldRestartNewLauncher { FALSE };
BOOL _continueUpdating{ FALSE };
BOOL _willContinueUpdating{ FALSE };
BOOL _continueUpdating { FALSE };
BOOL _willContinueUpdating { FALSE };
BOOL _skipSplashScreen { FALSE };
float _progressOffset { 0.0f };
float _progress { 0.0f };
CStdioFile _logFile;