mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Escape msi and owncloud.exe path (who knows...)
This commit is contained in:
parent
4d826a3d21
commit
0dc8bde694
@ -202,9 +202,15 @@ void OCUpdater::slotStartInstaller()
|
||||
// manually here. We wrap the msiexec and client invocation in a powershell
|
||||
// script because owncloud.exe will be shut down for installation.
|
||||
// | Out-Null forces powershell to wait for msiexec to finish.
|
||||
QString command = QString("&{msiexec /norestart /passive /i '%1' | Out-Null ; &'%2'}")
|
||||
.arg(QDir::toNativeSeparators(updateFile))
|
||||
.arg(QDir::toNativeSeparators(QCoreApplication::applicationFilePath()));
|
||||
auto preparePathForPowershell = [](QString path) {
|
||||
path.replace("'", "''");
|
||||
|
||||
return QDir::toNativeSeparators(path);
|
||||
};
|
||||
|
||||
QString command = QString("&{msiexec /norestart /passive /i '%1'| Out-Null ; &'%2'}")
|
||||
.arg(preparePathForPowershell(updateFile))
|
||||
.arg(preparePathForPowershell(QCoreApplication::applicationFilePath()));
|
||||
|
||||
QProcess::startDetached("powershell.exe", QStringList{"-Command", command});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user