Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-89110

QProcess: failed to run msiexe with property contains space

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.13.2
    • Core: Other
    • None
    • Windows 7/10 64
      Mingw 7.3.0 64
      Qt 5.13.2
      Qt Creator 4.13.3
    • Windows

    Description

      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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            zhu_hai Zhu Hai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes