changing_application_icon_for_windows.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. .. warning::
  20. For the ICO file to effectively replace the default Godot icon, it must
  21. contain *all* the sizes included in the default Godot icon: 16×16, 32×32,
  22. 48×48, 64×64, 128×128, 256×256. If the ICO file does not contain all the sizes,
  23. the default Godot icon will be kept for the sizes that weren't overridden.
  24. The above ImageMagick command takes this into account.
  25. Changing the taskbar icon
  26. -------------------------
  27. The taskbar icon is the icon that shows up on the taskbar when your project
  28. is running.
  29. .. image:: img/icon_taskbar_icon.png
  30. To change the taskbar icon, go to
  31. **Project → Project Settings → Application → Config → Windows Native Icon**.
  32. Click on the folder icon and select your ICO file.
  33. .. image:: img/icon_project_settings.png
  34. This setting only changes the icon for your exported game on Windows.
  35. To set the icon for macOS, use ``Macos Native Icon``. And for any other platform,
  36. use the ``Icon`` setting.
  37. Changing the file icon
  38. ----------------------
  39. .. warning::
  40. There are `known issues <https://github.com/godotengine/godot/issues/33466>`__
  41. when changing the application icon in executables that embed a PCK file.
  42. It's recommended to avoid using rcedit for now if you choose to enable the
  43. **Embed Pck** option for your Windows export preset in the Export dialog.
  44. The file icon is the icon of the executable that you click on to start
  45. the project.
  46. .. image:: img/icon_file_icon.png
  47. Before selecting it in the export options, you will need to install
  48. an extra tool called **rcedit**.
  49. You can download it `here <https://github.com/electron/rcedit/releases>`_.
  50. After downloading, you need to tell Godot the path to the rcedit executable
  51. on your computer.
  52. Go to **Editor → Editor Settings → Export → Windows**.
  53. Click on the folder icon for the **rcedit** entry.
  54. Navigate to and select the rcedit executable.
  55. .. note::
  56. Linux and macOS users will also need to install
  57. `WINE <https://www.winehq.org/>`_ to use rcedit.
  58. On macOS 10.15 (Catalina) or later, make sure to use a 64-bit version of
  59. both WINE and rcedit since 32-bit applications aren't supported anymore.
  60. .. image:: img/icon_rcedit.png
  61. You should now have everything in place to change the file icon.
  62. To do that, you will need to specify the icon when exporting.
  63. Go to **Project → Export**. Assuming you have already created
  64. a Windows Desktop preset, select your icon in ICO format in
  65. the **Application → Icon** field.
  66. .. warning::
  67. All the supplied metadata must be valid. Most importantly, the version
  68. identifiers **must** take the form ``major.minor.patch.revision`` where
  69. every component is required and is a positive integer. For instance,
  70. ``1.2.0.0`` is valid but ``1.2.0`` is not.
  71. If you provide invalid metadata in the export preset, the application icon
  72. won't change as rcedit will fail to change the executable's metadata.
  73. .. image:: img/icon_export_settings.png
  74. .. note::
  75. If rcedit fails to change the icon, you can instead
  76. :ref:`compile your own Windows export templates <doc_compiling_for_windows>`
  77. with the icon changed. To do so, replace
  78. `platform/windows/godot.ico <https://github.com/godotengine/godot/blob/master/platform/windows/godot.ico>`__
  79. with your own ICO file *before* compiling export templates.
  80. Once this is done, you can specify your export templates as custom export
  81. templates in your project's Windows export preset.
  82. Testing the result
  83. ------------------
  84. You can now export the project. If it worked correctly, you should see this:
  85. .. image:: img/icon_result.png
  86. .. note::
  87. If your icon isn't showing up properly, on Windows 10, try clearing the icon
  88. cache. To do so, open the **Run** dialog and enter ``ie4uinit.exe
  89. -ClearIconCache`` or ``ie4uinit.exe -show``.