How to register file associations in Ubuntu

I am creating an Ubuntu installer and I need to register my own file extension. I can not find examples of how to do this.

Can people provide me some script fragments on how to do this?

NB: I use InstallJammer to help me create an installer that allows me to call external scripts - this is why a script would be useful.

+4
source share
2 answers

The InstallJammer installer will not integrate very well with the distribution, but it does.

Use xdg-mime install and xdg-mime default to set the mimetype type and bind it.

+1
source

The recommended way is to write an ubuntu package, for example, with CDBS ( review , docs , examples , non-cdbs bonus ).

Then you add the $PACKAGE.sharedmimeinfo and $APPNAME.desktop to the debian / directory. The sharedmimeinfo file describes the type of file, the desktop file describes your application. The latter should contain MimeType=application/x-$APPNAME; that matches the type of file.

+2
source

All Articles