UI: OsUtil: Use "ComSpec" env var for "cmd.exe" path

This commit is contained in:
Nodir Temirkhodjaev 2024-05-12 15:48:20 +03:00
parent d7f829266c
commit 04cd393286
2 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,6 @@
@cd "%~dp0" @cd "%~dp0"
@echo off @echo off
%COMSPEC% /C "%~dp0uninstall.bat" %ComSpec% /C "%~dp0uninstall.bat"
"%~dp0install.bat" %* "%~dp0install.bat" %*

View File

@ -184,7 +184,8 @@ void OsUtil::restartClient()
{ {
const QFileInfo fi(QCoreApplication::applicationFilePath()); 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 auto command = QString("timeout /t 2 >NUL & start %1 --restarted").arg(fi.fileName());
const QStringList args = { "/c", command }; const QStringList args = { "/c", command };