changing_application_icon_for_windows.rst 4.3 KB

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