Uploaded image for project: 'Qt Installer Framework'
  1. Qt Installer Framework
  2. QTIFW-787

binarycreator fails to create archive if temporary directory contains spaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 3.0.1
    • 3.1.0
    • General
    • None
    • 5e28f85a886e1e28edc0370f15b777bbf2b2a557

    Description

      The binarycreator program fails to generate a 7zip archive if the temporary directory contains spaces. This is not uncommon on Windows since the temporary directory is in e.g. C:\Users\<username\AppData\Local\Temp. If the user name contains spaces (e.g. "Frerich Raabe"), binarycreator faills. Setting the TMP environment variable to a path which does not contain spaces works around the issue.

      The reason for this is that the createArchive function in src/libs/installer/lib7z_facade.cpp assembles a command line via

              const UString command = QString2UString(
                  // (mode: add) (type: 7z) (time: modified|creation|access) (threads: multi-threaded)
                  QLatin1String("a -t7z -mtm=on -mtc=on -mta=on -mmt=on ")
      #ifdef Q_OS_WIN
                  + QLatin1String("-sccUTF-8 ") // (files: case-sensitive|UTF8)
      #endif
                  + QString::fromLatin1("-mx=%1 ").arg(int(level)) // (compression: level)
                  + QDir::toNativeSeparators(target) + QLatin1Char(' ')
                  + QDir::toNativeSeparators(sources.join(QLatin1Char(' ')))
              );
      

      ...but neglects escaping the 'target' argument or any of the 'sources' values.

      Attachments

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

        Activity

          People

            installerteam Installer Team
            frerich Frerich Raabe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes