Use embedded icons for executable files

Bug #292504 reported by Scott Ritchie
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gnome-exe-thumbnailer (Ubuntu)
Fix Released
Wishlist
Scott Ritchie
libgnomeui (Ubuntu)
Invalid
Wishlist
Ubuntu Desktop Bugs

Bug Description

Binary package hint: nautilus

A new thumbnailer program for Windows Executables should be added to nautilus in order to display their embedded icon. I am unsure if .msi files need similar functionality. The icoutils program can already do this, however we just need to call it in the right way.

There's also a brainstorm discussion, with a script that seems promising:

http://brainstorm.ubuntu.com/idea/2141/

Changed in nautilus:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the bug report. This particular bug has already been reported, but feel free to report any other bugs you find.

Changed in nautilus:
assignee: nobody → desktop-bugs
status: Triaged → Invalid
Revision history for this message
Sebastien Bacher (seb128) wrote :

not sure the bug number now but that's something which has already been requested and that nautilus will not do, the thumbnailing can be done by some other software which understand the format used there though

Revision history for this message
Scott Ritchie (scottritchie) wrote :

Yeah, but presumably nautilus would then have to call the thumbnailer. We have several gnome-thumbnailer-foo packages in universe; are you proposing creating a new one?

Revision history for this message
A. Walton (awalton) wrote :

Yes. Or install it when Wine is installed, or whichever package ships the icon tool referenced above. Nautilus calls libgnomeui to create thumbnails, and there's a well written guide for ISVs to integrate into the GNOME desktop correctly written here: http://library.gnome.org/devel/integration-guide/stable/thumbnailer.html.en
It's just not Nautilus' job to install thumbnailers.

Revision history for this message
Scott Ritchie (scottritchie) wrote :

Retargetting to libgnomeui then. Thank you!

Changed in nautilus:
status: Invalid → New
Revision history for this message
A. Walton (awalton) wrote :

It's not libgnomeui's job either; did you click the link? gnome_thumbnailer looks up the mime-type via GConf, finds the thumbnailer responsible for it, and runs it over the file that Nautilus gives it. You install a new thumbnailer by adding the mime-type in GConf and specifying the thumbnailer.

In fact, all of this has already been done (you'll probably want to bump the tools in use to GIO-equivalents, however: http://www.objectnetworks.net/wiki/index.php?title=Exe_icon_for_Gnome)

All that's left is providing a package that does the above for you, which should be done in Wine, with icoutils, or in its own package. It's not GNOME's bug.

Changed in libgnomeui:
status: New → Invalid
Revision history for this message
Scott Ritchie (scottritchie) wrote :

Shouldn't Gnome recognize these icons WITHOUT Wine installed? The use case I'm thinking of is someone downloading an executable file off the internet (or by inserting a CD). When they double click it without Wine installed, we need to inform them about Wine and offer to install it; I see no reason why that executable should be without an icon during that first run.

Revision history for this message
Sebastien Bacher (seb128) wrote :

having nautilus displaying icons for those would give the false impression that they can be used which is not true, the thumbnailer should be installed in wine rather

Revision history for this message
Endolith (endolith) wrote :

The original icon should always be displayed, whether Wine is installed or not, and a dialog will explain that it cannot be run without Wine, offering a button to install Wine.

If Wine has been installed, it would probably be beneficial to still pop up something (notification area balloon) to explain that not everything runs perfectly in Wine, so if your app does nothing on double-click, you'll need to figure out what's wrong. Maybe the balloon should only appear if Wine returns an error.

A possibility for emphasizing the use of Wine is to show the program's icon superimposed on a Wine icon, or vice versa, like a Wine emblem on top of the original program icon, to indicate that the program will be launched through Wine.

Revision history for this message
StefanHuszics (stefan-huszics) wrote :

From a users POV it makes no sense at all that an icon isnt displayed if a "Window software" CD is inserted. After all, putting an W2k+ software CD into Windows 98 still shows the CD icon I presume. So there is no automatic "Icon means software will work properly, or even at all" correlation.

Also the CD itself is fully browsable even without wine installed, so this really isn't directly related with Wine, but is directly related with the user experience of the Gnome desktop itself. So IMO this is a Gnome bug. Otherwise we are pretty much saying the equal to "PNGs should not be thumbnailed unless Gimp is installed". Clearly the wrong approach IMO.

Revision history for this message
Endolith (endolith) wrote :

Here's what the gnome-exe-thumbnailer script (http://www.mediafire.com/?ky94kc2jdjb) does to the icons, as mentioned.

Revision history for this message
Endolith (endolith) wrote :

And here's the script itself (public domain, by qaaq on Ubuntu Brainstorm). It doesn't seem to work on most icons.

I changed the install instructions a little to re-use the built-in MIME type:

----
sudo apt-get install sharutils icoutils
sudo cp gnome-exe-thumbnailer /usr/local/bin
sudo chmod a+rx /usr/local/bin/gnome-exe-thumbnailer
gconftool-2 --set /desktop/gnome/thumbnailers/application@x-ms-dos-executable/command --type string "/usr/local/bin/gnome-exe-thumbnailer %i %o"
gconftool-2 --set /desktop/gnome/thumbnailers/application@x-ms-dos-executable/enable --type boolean true
----

Revision history for this message
Endolith (endolith) wrote :

Also the menu icon found in /usr/share/pixmaps/wine.svg is probably better than the one embedded in the script.

Revision history for this message
Scott Ritchie (scottritchie) wrote :

The original icon should be the large one, not the Wine icon.

Actually, we may not even want to bother with a Wine bottle at all.

Revision history for this message
Endolith (endolith) wrote :

I'm not convinced this should be built into Wine, but it should be assigned to something.

Revision history for this message
Endolith (endolith) wrote :

I think it makes sense to add a Wine icon (emblem?) over top of the exe's built-in icon, to indicate that it's going to be run under Wine. If the exe were going to be run through something else (CrossOver? a virtual Windows machine?) then it could have a different emblem representing that.

If nothing is installed that can handle .exes, I think it should still show the exe's built-in icon, but have a "no action" emblem.

Revision history for this message
Scott Ritchie (scottritchie) wrote :

You make a good point Endolith, although I don't think we currently have a mechanism inside the thumbnailer for determining which of Wine/Crossover/etc will open a particular executable. I'll try and talk to Codeweavers about it.

Revision history for this message
Endolith (endolith) wrote :

Well, the file association would be used for that, right? Or are .exe files not associated with Wine by default?

Here's a mockup of what I'm imagining. I'm not sure there's really a precedent for this, though. If you have SVG files associated with Inkscape, you don't see SVG thumbnails with a little Inkscape emblem, for instance. (Though maybe you should?)

Revision history for this message
Endolith (endolith) wrote :
Revision history for this message
Endolith (endolith) wrote :

Also, using a thumbnailer as in the gnome-exe-thumbnailer script isn't even the right approach. Thumbnails are larger than normal icons, and are displayed with a frame around them, which makes it look all odd.

Revision history for this message
Endolith (endolith) wrote :

It would be better to use the extracted icon as the file's actual icon, instead of as a thumbnail, in the same way that you can set a custom icon for a file using the Properties dialog.

Again, I'm not sure if there's any precedent for this, though (using different icons for files of the same MIME type based on their content)

Revision history for this message
Scott Ritchie (scottritchie) wrote :

I'm going to assign this to myself. For Karmic, there will be a new package (I'm thinking wine-support) that's meant to be installed before Wine is; this package is where we'll put things like the thumbnailer script in this bug report and the prompt to install Wine.

Changed in wine:
assignee: nobody → scottritchie
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Endolith (endolith) wrote :

That's great, but I'm not sure the thumbnailer approach is the right approach, as shown in the images. I'm not sure what the right approach would be, though. Is there any precedent for executable files with different icons? .exe files in Ubuntu are kind of like files in an interpreted language, since they aren't executable by themselves and need another layer to operate. Is there any way for python or java files to give themselves unique icons?

Revision history for this message
Scott Ritchie (scottritchie) wrote :

The frames need to go, of course, but I believe that could be fixed in nautilus if there isn't a way to do it already.

Revision history for this message
Endolith (endolith) wrote :

Right. So it would be better to change the actual icons instead of using a thumbnailer script.

Here's some discussion about the same idea applied to ELF binaries:

http://brainstorm.ubuntu.com/idea/5744/
https://blueprints.launchpad.net/ubuntu/+spec/elficon
http://www.compholio.com/elficon/
https://bugs.launchpad.net/ubuntu/+bug/207141

Revision history for this message
Erich E. Hoover (ehoover) wrote :

Hmm, didn't know about this bug... The discussion on ELF binaries probably isn't helpful to you, it mostly goes along the lines of:
You think Linux is OpenWindows? Funny... -- jrusinek

So, if you guys know of some way to change the icon that gets rid of the annoying border on newer versions of nautilus then I'd love to hear it. Also, new ubuntu versions don't seem to allow a sudo'd user to change GConf settings.

Revision history for this message
Endolith (endolith) wrote :

Well you can right-click -> Properties -> Click the icon and change it, which is probably controlled by some .dotfile in the home directory, but I'm not sure if modifying that file is the right way to go about changing icons programmatically.

The "ugly border" is because you're not actually changing the icon. You're creating a thumbnail for the file (like a thumbnail for a PDF or graphic, which I think is the wrong way to do it.

Revision history for this message
Scott Ritchie (scottritchie) wrote :

So I've created the gnome-exe-thumbnailer package for Karmic. The goal is this:

If file is executable permissions, show just the embedded exe
If file is not executable, show its icon contained in a generic "program" window with a Wine logo embedded on the side.

affects: wine (Ubuntu) → gnome-exe-thumbnailer (Ubuntu)
Changed in gnome-exe-thumbnailer (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Erich E. Hoover (ehoover) wrote :

Yeah, I'm aware of why the border shows up - older versions of nautilus didn't do that so I was a tad irritated when they added the border for images less than the thumbnail size. At one time I was trying to explore how text files have "custom icons," but I didn't see a way to gain access to that functionality and stopped looking into it when I stumbled upon the thumbnail technique.

Revision history for this message
Endolith (endolith) wrote :

Can you post a screenshot? It doesn't use a Wine emblem?

Revision history for this message
Scott Ritchie (scottritchie) wrote :

An emblem would be a similar idea, although I don't think nautilus exposes that functionality to thumbnailer scripts.

Revision history for this message
Endolith (endolith) wrote :

I really don't think the thumbnailer is the right way to do it. So it's going to look like this in Karmic? http://launchpadlibrarian.net/21331762/gnome-exe-thumbnailer.png

Revision history for this message
Scott Ritchie (scottritchie) wrote :

Yes, and this will perhaps provide the motivation Gnome needs to strip the "draw a box around all thumbnails" code and put it into the thumbnailers themselves where it belongs.

It's either that or hack something into libgnomeui (loses the modularity of thumbnailers) or define some new custom icon method.

Revision history for this message
Erich E. Hoover (ehoover) wrote :

> Yes, and this will perhaps provide the motivation Gnome needs to strip the "draw a box around all thumbnails" code and put it into the thumbnailers themselves where it belongs.

FYI, with Karmic if the thumbnail is small enough (though I'm not sure exactly how Gnome determines this value) the border will go away. So, at least we're back to the old behavior.

Revision history for this message
Scott Ritchie (scottritchie) wrote :

The thumbnailer works great now

Changed in gnome-exe-thumbnailer (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.