Ubuntu – Third party application Icon not displaying in dock for Ubuntu 17.10

17.10desktopgnome-shellubuntu-dock

I created an executable .desktop file in my Desktop which should launch a GUI application along with displaying an icon in dock, but in Ubuntu 17.10 icon is not displaying in dock:

desktop with download dialog

In previous Ubuntu versions (14.04 to 17.04) I didn't face this issue.

In Ubuntu 17.10 no 3rd party applications with icons as executables are being launched by default, It's asking for trust and launch to proceed.

untrusted application dialog

How can I give the launchers default execute permission, or whatever permission is needed to avoid getting this dialog?

The executable was created by compiling in Ubuntu 14.04 to support backward compatibility.

The .desktop file created to display the icon contains:

#!/usr/bin/env/ xdg-open 
[Desktop Entry]
Version=1.0
Type=Application
Name=MDM
Comment=MAVLDM
Terminal=false
X-Ubuntu-Gettext-Domain=example-content
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;
StartupNotify=false
OnlyShowIn=GNOME;Unity;
X-Desktop-File-Install-Version=0.20
Path=/home/ravi/Downloads/MDM
Exec=/home/ravi/Downloads/MDM/MAVLDM
Icon=/home/ravi/Downloads/MDM/mavldm.png

Is this changed in Ubuntu 17.10?

Best Answer

First right click on the .desktop file and select Properties. Then go to Permissions tab and check the "Allow executing file as program" if it's unchecked. Alternatively you may run

 chmod +x <filename.desktop>

Then double-click on the .desktop file, a window with the heading "Untrusted application launcher" should pop up (as in your second screenshot). Click on the "Trust and Launch" button. The .desktop file should be fixed now (i.e. should show correct name and icon specified inside the file) and the application will be launched.

From next time on it won't ask for any permission and launch the application straight away.