diff --git a/src/driver/scripts/reinstall.bat b/src/driver/scripts/reinstall.bat index 9cf0be61..022734ec 100644 --- a/src/driver/scripts/reinstall.bat +++ b/src/driver/scripts/reinstall.bat @@ -3,6 +3,6 @@ @cd "%~dp0" @echo off -%COMSPEC% /C "%~dp0uninstall.bat" +%ComSpec% /C "%~dp0uninstall.bat" "%~dp0install.bat" %* diff --git a/src/ui/util/osutil.cpp b/src/ui/util/osutil.cpp index 9261a89b..bfa3bb98 100644 --- a/src/ui/util/osutil.cpp +++ b/src/ui/util/osutil.cpp @@ -184,7 +184,8 @@ void OsUtil::restartClient() { const QFileInfo fi(QCoreApplication::applicationFilePath()); - const auto scriptPath = QLatin1String("cmd.exe"); + const auto scriptPath = qEnvironmentVariable("ComSpec", "cmd.exe"); + const auto command = QString("timeout /t 2 >NUL & start %1 --restarted").arg(fi.fileName()); const QStringList args = { "/c", command };