From d54bb02f477ce1259019520f89b140a3c5c65a80 Mon Sep 17 00:00:00 2001
From: luiscuenca <luiscuenca@outboxcode.com>
Date: Sat, 27 Jul 2019 08:53:32 -0700
Subject: [PATCH] Fix installer process windows

---
 launchers/win32/LauncherDlg.cpp     | 13 +++++++------
 launchers/win32/LauncherManager.cpp | 11 +++++++++--
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/launchers/win32/LauncherDlg.cpp b/launchers/win32/LauncherDlg.cpp
index d7d214842d..a82056bab0 100644
--- a/launchers/win32/LauncherDlg.cpp
+++ b/launchers/win32/LauncherDlg.cpp
@@ -702,13 +702,14 @@ void CLauncherDlg::OnTimer(UINT_PTR nIDEvent) {
                     _splashStep = SPLASH_DURATION;
                     setDrawDialog(DrawStep::DrawProcessUpdate);
                     theApp._manager.updateProgress(LauncherManager::ProcessType::Uninstall, 0.0f);
+                } else if (theApp._manager.shouldSkipSplashScreen()) {
+                    theApp._manager.updateProgress(LauncherManager::ProcessType::Uninstall, 1.0f);
+                    setDrawDialog(DrawStep::DrawProcessFinishUpdate);
+                    _splashStep = SPLASH_DURATION;
+                    _showSplash = false;
                 } else {
-                    if (theApp._manager.shouldSkipSplashScreen()) {
-                        _splashStep = SPLASH_DURATION;
-                    } else {
-                        theApp._manager.addToLog(_T("Start splash screen"));
-                        setDrawDialog(DrawStep::DrawLogo);
-                    }
+                    theApp._manager.addToLog(_T("Start splash screen"));
+                    setDrawDialog(DrawStep::DrawLogo);
                 }
             } else if (_splashStep > SPLASH_DURATION && !theApp._manager.needsToWait()) {
                 _showSplash = false;
diff --git a/launchers/win32/LauncherManager.cpp b/launchers/win32/LauncherManager.cpp
index d7d92a18fb..00bfe34957 100644
--- a/launchers/win32/LauncherManager.cpp
+++ b/launchers/win32/LauncherManager.cpp
@@ -611,11 +611,18 @@ void LauncherManager::onFileDownloaded(ProcessType type) {
 }
 
 void LauncherManager::restartNewLauncher() {
+    CString tempPath;
+    LauncherManager::getAndCreatePaths(LauncherManager::PathType::Temp_Directory, tempPath);
+    tempPath += "hql.exe";
+    CString installPath;
+    LauncherManager::getAndCreatePaths(LauncherManager::PathType::Launcher_Directory, installPath);
+    installPath += LAUNCHER_EXE_FILENAME;
+    CopyFile(installPath, tempPath, false);
     closeLog();
     if (_willContinueUpdating) {
-        LauncherUtils::launchApplication(_tempLauncherPath, _T(" --restart --noUpdate --continueUpdating"));
+        LauncherUtils::launchApplication(tempPath, _T(" --restart --noUpdate --continueUpdating"));
     } else {
-        LauncherUtils::launchApplication(_tempLauncherPath, _T(" --restart --noUpdate --skipSplash"));
+        LauncherUtils::launchApplication(tempPath, _T(" --restart --noUpdate --skipSplash"));
     }    
     Sleep(500);
 }