Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
Write an article for LinuxForums Today! Win Great Prizes!
Configure GNOME and a file browser that supports thumbnailers (such as Nautilus) to generate icons embedded inside Windows executables.
Dependencies: icoutils (can be found in most repositories).
This guide will allow your file browser (Nautilus is used in this guide, but with some amendments other browsers supporting external thumbnailers should work) to automatically extract and generate GNOME-compatible icons for Windows executables.
We'll use a combination of wrestool and icotool, provided by icoutils. First we will create a bash script to utilise these two binaries, since GNOME will only execute simple commands as thumbnailers, but not bash script or similar.
As root, create an empty file in /usr/bin named 'msiconailer' (or whatever you want to call your thumbnailer) then copy and paste this code into the contents of the file using a text editor:
This code first extracts the 'main' icon (type 14) from your Windows exe (specified by the first argument $1). These binaries can include multiple cursors/icons, so we need to use wrestool to make sure we get the one we want. The data for this icon will be passed to stdout by wrestool, which we then pipe into icotool, which converts this data into a PNG format image and writes it to disk in the location specified as the second argument ($2). Here's an example use of our script:
Once you've saved the script (and don't forget to make it executable), we can configure our thumbnailer in GNOME.
The thumbnailers are configured inside gconf-editor (you can access this via the Applications menu or just enter gconf-editor into a terminal). The specific path to the thumbnailers is /desktop/gnome/thumbnailers - but to add new keys here we must use the terminal. Execute these two commands in the terminal:
Your thumbnailer has been added - browse to a Windows executable using Nautilus to see icons generated.
If your exe icons don't appear, don't forget to empty the .thumbnails/fail folder in your home directory, and make sure things are configured correctly in Nautilus preferences (such as abandoning thumbnail-generation for files over a certain size or residing in a remote location).
Comments about this article
Comment title: * please do not put your response text here