@@ -214,7 +214,7 @@ if [ -e "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" ] ; then
214214 # echo "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME already there"
215215 EXEC=$( grep " ^Exec=" " $DESTINATION_DIR_DESKTOP /$VENDORPREFIX -$DESKTOPFILE_NAME " | head -n 1 | cut -d " " -f 1)
216216 # echo $EXEC
217- if [ " Exec=$APPIMAGE " == " $EXEC " ] ; then
217+ if [ " Exec=\" $APPIMAGE \" " == " $EXEC " ] ; then
218218 exit 0
219219 fi
220220fi
@@ -232,10 +232,14 @@ if [ -z "$SKIP" ] ; then
232232 # applications directory when run as a non-root user,
233233 # and to /usr/share/applications if run as root
234234 # but that does not really work for me...
235+ #
236+ # For Exec we must use quotes
237+ # For TryExec quotes is not supported, so, space must be replaced to \s
238+ # https://askubuntu.com/questions/175404/how-to-add-space-to-exec-path-in-a-thumbnailer-descrption/175567
235239 desktop-file-install --rebuild-mime-info-cache \
236- --vendor=$VENDORPREFIX --set-key=Exec --set-value=" ${APPIMAGE} %U" \
240+ --vendor=$VENDORPREFIX --set-key=Exec --set-value=" \" ${APPIMAGE} \" %U" \
237241 --set-key=X-AppImage-Comment --set-value=" Generated by ${THIS} " \
238- --set-icon=" $ICONFILE " --set-key=TryExec --set-value=" $ APPIMAGE" " $DESKTOPFILE " \
242+ --set-icon=" $ICONFILE " --set-key=TryExec --set-value=${ APPIMAGE// / \\ s} " $DESKTOPFILE " \
239243 --dir " $DESTINATION_DIR_DESKTOP "
240244 chmod a+x " $DESTINATION_DIR_DESKTOP /" *
241245 RESOURCE_NAME=$( echo " $VENDORPREFIX -$DESKTOPFILE_NAME " | sed -e ' s/.desktop//g' )
0 commit comments