mirror of
https://github.com/tnodir/fort
synced 2024-11-15 02:05:44 +00:00
Installer: Fix "delay-start.bat"
This commit is contained in:
parent
cb1e07f933
commit
1d6a5c743b
@ -67,7 +67,8 @@ Name: "portable"; Description: "{cm:Portable}"; Flags: unchecked
|
|||||||
Source: "build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: "data\{#APP_EXE_NAME}.example.ini"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "data\{#APP_EXE_NAME}.example.ini"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "data\qt.conf"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "data\qt.conf"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "data\delay-start.bat"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist
|
Source: "data\delay-start.bat"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
; onlyifdoesntexist
|
||||||
|
|
||||||
[Dirs]
|
[Dirs]
|
||||||
Name: "{app}\Data"; Flags: uninsneveruninstall; Permissions: users-modify; Tasks: portable
|
Name: "{app}\Data"; Flags: uninsneveruninstall; Permissions: users-modify; Tasks: portable
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
@rem Wait for Installer's file deletion
|
@rem Wait for Installer's file deletion
|
||||||
@for /l %%i in (0,1,3) do (
|
@for /l %%i in (0,1,3) do (
|
||||||
timeout /t 1 > NUL
|
timeout /t 1 > NUL
|
||||||
@if not exist "%INSTALLER_PATH%" goto EXIT
|
@if not exist %INSTALLER_PATH% goto EXIT
|
||||||
)
|
)
|
||||||
|
|
||||||
:EXIT
|
:EXIT
|
||||||
|
@ -176,10 +176,14 @@ bool OsUtil::allowOtherForegroundWindows()
|
|||||||
|
|
||||||
void OsUtil::restartClient(const QString &installerPath)
|
void OsUtil::restartClient(const QString &installerPath)
|
||||||
{
|
{
|
||||||
|
const QLatin1String scriptPath("delay-start.bat");
|
||||||
|
|
||||||
QStringList args = QCoreApplication::arguments();
|
QStringList args = QCoreApplication::arguments();
|
||||||
args.replace(0, FileUtil::toNativeSeparators(installerPath)); // replace a program path
|
args.replace(0, FileUtil::toNativeSeparators(installerPath)); // replace a program path
|
||||||
|
|
||||||
QProcess::startDetached("delay-start.bat", args);
|
qCDebug(LC) << "restartClient:" << scriptPath << args;
|
||||||
|
|
||||||
|
QProcess::startDetached(scriptPath, args);
|
||||||
|
|
||||||
quit("required client restart");
|
quit("required client restart");
|
||||||
}
|
}
|
||||||
@ -191,6 +195,8 @@ void OsUtil::restart()
|
|||||||
QStringList args = QCoreApplication::arguments();
|
QStringList args = QCoreApplication::arguments();
|
||||||
args.removeFirst(); // remove a program path
|
args.removeFirst(); // remove a program path
|
||||||
|
|
||||||
|
qCDebug(LC) << "restart:" << appFilePath << args;
|
||||||
|
|
||||||
qApp->connect(qApp, &QObject::destroyed, [=] { QProcess::startDetached(appFilePath, args); });
|
qApp->connect(qApp, &QObject::destroyed, [=] { QProcess::startDetached(appFilePath, args); });
|
||||||
|
|
||||||
quit("required restart");
|
quit("required restart");
|
||||||
|
Loading…
Reference in New Issue
Block a user