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

Installing Qt Creator installs desktop files and icons to the wrong directory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 3.0.6
    • General
    • None
    • Gentoo Linux AMD64.
    • Linux/X11
    • d6768e5a16521c11fffb4b50eaf085f8c13272a7 (installer-framework/installer-framework/3.1)

    Description

      (I'm not sure who's responsible for this bug. I filed it as an installer bug, but it might be a Qt bug.)

      I installed Qt Creator 4.8.1 using the online installer for Linux (64-bit) and this resulted in desktop files and icons being installed into the wrong directory. They were installed into ~/.local/share/flatpak/exports/share/ instead of ~/.local/share/.

      This seems to be due to non-conformance to the XDG Base Directory Specification. The environment variable XDG_DATA_HOME specifies the directory where these files should be stored. If the variable is not defined or is empty, then ~/.local/share/ must be used. This is not what the Qt installer does. It instead uses the first directory specified in XDG_DATA_DIRS, which is not the purpose of that variable. For storing files, only XDG_DATA_HOME must be used, or ~/.local/share/ if the env var is empty. XDG_DATA_DIRS should not be used.

      Relevant wording in the spec (emphasis is mine):

      There is a single base directory relative to which user-specific data files should be written. This directory is defined by the environment variable $XDG_DATA_HOME.

      There is a set of preference ordered base directories relative to which data files should be searched. This set of directories is defined by the environment variable $XDG_DATA_DIRS. {{}}

      $XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used. 

      $XDG_DATA_DIRS defines the preference-ordered set of base directories to search for data files in addition to the $XDG_DATA_HOME base directory

      https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

      On my system, XDG_DATA_HOME is not defined, meaning installation files should go to ~/.local/share/. But XDG_DATA_DIRS is not empty:

      $ echo $XDG_DATA_DIRS
      /home/realnc/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

      The Qt installer seems to pick the first path of XDG_DATA_DIRS instead of using ~/.local/share/.

      Attachments

        Issue Links

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

          Activity

            People

              installerteam Installer Team
              realnc Nikos Chantziaras
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes