Personal tools

Setting an executable icon

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Initial page)
 
m
 
Line 4: Line 4:
 
== Introduction ==
 
== Introduction ==
  
Many operating systems display icons for executables in their file manager windows. The following shows how to add icons to  
+
Many operating systems display icons for executables in their file manager windows. The following shows how to add icons to executables compiled from Haskell source. The examples use the [[Media:Favicon.ico | haskell.org favicon]].
 
+
executables compiled from Haskell source. The examples use the haskell.org favicon ([[image:favicon.ico]]).
+
  
  
Line 18: Line 16:
 
* generate an object file with the command:
 
* generate an object file with the command:
 
<code>
 
<code>
       windres -i Icon.rc Resource.o
+
       windres -i Icon.rc Icon.o
 
</code>
 
</code>
 
* Compile your Haskell program with a command like:
 
* Compile your Haskell program with a command like:
 
<code>
 
<code>
       ghc Nop.hs Resource.o
+
       ghc Nop.hs Icon.o
 
</code>
 
</code>
 +
Now you will see the Haskell logo as the icon for Nop.exe in the file manager.
  
  

Latest revision as of 23:23, 7 November 2014

This article is a stub. You can help by expanding it.


[edit] 1 Introduction

Many operating systems display icons for executables in their file manager windows. The following shows how to add icons to executables compiled from Haskell source. The examples use the haskell.org favicon.


[edit] 2 Windows

  • Save the favicon as favicon.ico in the directory of your application
  • Create the file Icon.rc, with the contents:

     1 ICON "favicon.ico"

  • generate an object file with the command:

     windres -i Icon.rc Icon.o

  • Compile your Haskell program with a command like:

     ghc Nop.hs Icon.o

Now you will see the Haskell logo as the icon for Nop.exe in the file manager.


[edit] 3 Linux

A description how to do this in Ubuntu: Create desktop icon executable on Ubuntu Linux