I know this is an old question, but the answer was either incomplete or has changed over time.
desktop-file-install
causes a database update, and to be precise, it updates the cache by rebuild_cache()
.
More details can be found in the source, in the official repository "desktop-file-utils":
https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/blob/master/src/install.c#L291
Just copying with cp
does not cause the mime base to be updated, which is important - it does not update its cache.
This is important for file updating - you may notice that if you change the text of the *.desktop on path /usr/share/xfce4/helpers/
file itself, the changes will not be accepted immediately.
The install call will do:
- First validation of the *.desktop file by
desktop-file-validate
- Further, if the file is valid, it will update the database by calling the
update-desktop-database
command