66# and set it as the Exec= line of the .desktop file in the AppImage.
77
88# TODO:
9- # Handle mime types as well
9+ # Handle icons for mime types as well using xdg-icon-resource
1010# Handle multiple versions of the same AppImage?
11- # Handle removed AppImages. Currently we are just setting TryExec=
11+ # Handle removed AppImages? Currently we are just setting TryExec=
1212# See http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DELETE
1313# Possibly move this to the C runtime that is part of every AppImage?
1414
114114# Determine where the desktop file should be installed
115115if [[ $EUID -ne 0 ]]; then
116116 DESTINATION_DIR_DESKTOP=" $HOME /.local/share/applications"
117+ SYSTEM_WIDE=" "
117118else
118119 # TODO: Check $XDG_DATA_DIRS
119120 DESTINATION_DIR_DESKTOP=" /usr/local/share/applications"
121+ SYSTEM_WIDE=" --mode system" # for xdg-mime and xdg-icon-resource
120122fi
121123
122124# Check if the desktop file is already there
@@ -135,8 +137,9 @@ if [ -z "$SKIP" ] ; then
135137 yesno " Install" " Should a desktop file for $APPIMAGE be installed?"
136138fi
137139
138- # If the user has agreed, rewrite and install the desktop file
140+ # If the user has agreed, rewrite and install the desktop file, and the MIME information
139141if [ -z " $SKIP " ] ; then
142+ find ./share/mime/ -type f -name * xml -exec xdg-mime install $SYSTEM_WIDE --novendor {} \;
140143 # desktop-file-install is supposed to install
141144 # .desktop files to the user's
142145 # applications directory when run as a non-root user,
0 commit comments