-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.13.2
-
None
-
Windows 7/10 64
Mingw 7.3.0 64
Qt 5.13.2
Qt Creator 4.13.3
This command works fine from Windows 7/10 command shell:
msiexec /passive /i "c:\test space.msi" TARGETDIR="c:\test space"
But msiexec complains invalid arguments and pops a window of help messages when running via QProcess::startDetached.
Here is the piece of code:
QString target = "C:\\Test Space";
QString msi_file = "C:\\test space.msi";
QString msiexec = QStandardPaths::findExecutable("msiexec.exe");
QStringList args;
args <<"/passive"<<"/i"<<QDir::toNativeSeparators(msi_file);
args <<"TARGETDIR=\""+QDir::toNativeSeparators(target)+"\"";
if (!QProcess::startDetached(msiexec, args)) {
qDebug()<<"Start msiexec failed!";
}
The full code is attached as main.cpp
It works fine if remove the space from 'target' string.