MIME types are invalid in Linux AppImage

• Jan 6, 2020 - 06:42
Reported version
3.x-dev
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

MIME types are installed as:

  • MSCZ: application/x-musescore-portable
  • MSCX: application/x-musescore-portable+xml
  • MXL: application/vnd.recordare.musicxml-portable
  • MusicXML: application/vnd.recordare.musicxml-portable+xml

Notice the "-portable" suffix. This should not be there.

The correct MIME types are:

  • MSCZ: application/x-musescore
  • MSCX: application/x-musescore+xml
  • MXL: application/vnd.recordare.musicxml
  • MusicXML: application/vnd.recordare.musicxml+xml

To verify the above, first install the AppImage using the relevant command line option:

./MuseScore*.AppImage install

Then, right-click on any MSCX, MSCZ, MXL or MusicXML score in the File Manage (e.g. Nautilus / GNOME Files) and click Properties to see the MIME type.


Comments

Background

The "-portable" suffix was being appended to avoid conflicts when multiple versions of MuseScore are installed simultaneously. This isn't a problem for MIME types per se, but it is a problem for the icon files, which by default have the same name as the MIME type they represent.

  • The MIME type "application/x-musescore" has an icon file named "application-x-musescore.svg".

If multiple versions of MuseScore are installed then both will provide a file called "application-x-musescore.svg". Removing either copy of MuseScore will delete that file for BOTH versions, so it was necessary to add a suffix to icon filenames to avoid this.

  • "application-x-musescore.svg" became "application-x-musescore-portable.svg", which avoids conflicts with non-AppImage versions of MuseScore.

However, that meant changing the MIME type too, hence the bug.

  • "application/x-musescore" became "application/x-musescore-portable", which is not what other programs will be expecting.

Solution

The PR manually specifies icon names rather than relying on default names based on the MIME type. This breaks the link between icon filenames and MIME types, so now a suffix can be appended to an icon filename without having to append it to the MIME type it represents.

  • Now the MIME type "application/x-musescore" has an icon file named "application-x-musescore-portable.svg".
Status PR created fixed

Fixed in branch master, commit 3c1635591d

_fix #299351: MIME types are invalid in Linux AppImage

MIME types are used to setup file associations (i.e. tell the File Manager
which files MuseScore can open) and to provide icons for those files.

Primary changes:

  • Remove MSCORE_INSTALL_SUFFIX from MIME types to ensure they are valid.

  • Manually specify icon names so they no longer have to match the MIME type.
    Icon names retain MSCORE_INSTALL_SUFFIX to ensure there are no conflicts
    when the user has multiple copies of MuseScore installed simultaneously.

Additional changes:

  • Improve formatting (indent 4 spaces instead of 2).

  • Create MIME types for MuseScore Drumsets (.drm), Palettes (.mpal) and
    Styles (.mss).

  • Add types for import formats, including Guitar Pro and Overture.

  • Add MIDI and new import types to .desktop file so MuseScore will appear in
    the File Manager's "Open with..." list for these types of file._

Fix version
3.5.0