changing_application_icon_for_windows.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. .. _doc_changing_application_icon_for_windows:
  2. Changing application icon for Windows
  3. =====================================
  4. By default, the exported project's icon will be the Godot icon.
  5. You will most likely want to change that for your project. There are two types
  6. of icons that can be changed on Windows: the file icon and the taskbar icon.
  7. Creating an ICO file
  8. --------------------
  9. Windows does not use formats such as png or jpg for application icons. Instead,
  10. it uses a Windows-only format called ICO. You can create your application icon
  11. in any program but you will have to convert it to an ICO file using a program such
  12. as GIMP.
  13. `This video tutorial <https://www.youtube.com/watch?v=uqV3UfM-n5Y>`_ goes over how to
  14. export an ICO file with GIMP.
  15. It is also possible to convert a PNG image to an hiDPI-friendly ICO file
  16. using this `ImageMagick <https://www.imagemagick.org/>`_ command:
  17. .. code-block:: none
  18. magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
  19. Depending on which version of ImageMagick you installed, you might need to leave out the ``magick`` and run this command instead:
  20. .. code-block:: none
  21. convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
  22. .. warning::
  23. For the ICO file to effectively replace the default Godot icon, it must
  24. contain *all* the sizes included in the default Godot icon: 16×16, 32×32,
  25. 48×48, 64×64, 128×128, 256×256. If the ICO file does not contain all the sizes,
  26. the default Godot icon will be kept for the sizes that weren't overridden.
  27. The above ImageMagick command takes this into account.
  28. Changing the taskbar icon
  29. -------------------------
  30. The taskbar icon is the icon that shows up on the taskbar when your project
  31. is running.
  32. .. image:: img/icon_taskbar_icon.png
  33. To change the taskbar icon, go to
  34. **Project → Project Settings → Application → Config → Windows Native Icon**.
  35. Click on the folder icon and select your ICO file.
  36. .. image:: img/icon_project_settings.png
  37. This setting only changes the icon for your exported game on Windows.
  38. To set the icon for macOS, use ``Macos Native Icon``. And for any other platform,
  39. use the ``Icon`` setting.
  40. Changing the file icon
  41. ----------------------
  42. In Godot 3.5 and later, you can change the file icon without
  43. external tools using `godoticon <https://github.com/pkowal1982/godoticon>`__.
  44. Changing the file icon this way should work for executables containing
  45. an embedded PCK.
  46. .. warning::
  47. There are `known issues <https://github.com/godotengine/godot/issues/33466>`__
  48. when changing the application icon in executables that embed a PCK file.
  49. It's recommended to avoid using rcedit for now if you choose to enable the
  50. **Embed Pck** option for your Windows export preset in the Export dialog.
  51. The file icon is the icon of the executable that you click on to start
  52. the project.
  53. .. image:: img/icon_file_icon.png
  54. Before selecting it in the export options, you will need to install
  55. an extra tool called **rcedit**.
  56. You can download it `here <https://github.com/electron/rcedit/releases>`_.
  57. After downloading, you need to tell Godot the path to the rcedit executable
  58. on your computer.
  59. Go to **Editor → Editor Settings → Export → Windows**.
  60. Click on the folder icon for the **rcedit** entry.
  61. Navigate to and select the rcedit executable.
  62. .. note::
  63. Linux and macOS users will also need to install
  64. `WINE <https://www.winehq.org/>`_ to use rcedit.
  65. On macOS 10.15 (Catalina) or later, make sure to use a 64-bit version of
  66. both WINE and rcedit since 32-bit applications aren't supported anymore.
  67. .. image:: img/icon_rcedit.png
  68. You should now have everything in place to change the file icon.
  69. To do that, you will need to specify the icon when exporting.
  70. Go to **Project → Export**. Assuming you have already created
  71. a Windows Desktop preset, select your icon in ICO format in
  72. the **Application → Icon** field.
  73. .. warning::
  74. All the supplied metadata must be valid. Most importantly, the version
  75. identifiers **must** take the form ``major.minor.patch.revision`` where
  76. every component is required and is a positive integer. For instance,
  77. ``1.2.0.0`` is valid but ``1.2.0`` is not.
  78. If you provide invalid metadata in the export preset, the application icon
  79. won't change as rcedit will fail to change the executable's metadata.
  80. .. image:: img/icon_export_settings.png
  81. .. note::
  82. If rcedit fails to change the icon, you can instead
  83. :ref:`compile your own Windows export templates <doc_compiling_for_windows>`
  84. with the icon changed. To do so, replace
  85. `platform/windows/godot.ico <https://github.com/godotengine/godot/blob/master/platform/windows/godot.ico>`__
  86. with your own ICO file *before* compiling export templates.
  87. Once this is done, you can specify your export templates as custom export
  88. templates in your project's Windows export preset.
  89. Testing the result
  90. ------------------
  91. You can now export the project. If it worked correctly, you should see this:
  92. .. image:: img/icon_result.png
  93. .. note::
  94. If your icon isn't showing up properly, on Windows 10, try clearing the icon
  95. cache. To do so, open the **Run** dialog and enter ``ie4uinit.exe
  96. -ClearIconCache`` or ``ie4uinit.exe -show``.