Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example Inno Setup script for Godot games
; IMPORTANT: Follow the instructions at
; https://docs.godotengine.org/en/stable/getting_started/workflow/export/changing_application_icon_for_windows.html
; and make sure the "Options > Application > Product Version" field is set
; in Godot's Export dialog before exporting your EXE file. Otherwise,
; Inno Setup will mistake the Godot version for your game's version.
;
; You can check whether you were successful by examining the .EXE file's
; properties dialog on Windows, or by using the `peres -v` command from `pev`
; on Linux.
;
; If you're using the Flatpak version of Godot, you'll need to either replace
; the GameVersion line here or manually run an adapted version of
; wine c:\rcedit.exe game.exe --set-product-version 0.1 \
; --set-file-version 0.1 --set-icon icon.ico
; because Flatpak's Godot doesn't have Wine.
; IMPORTANT: You must invoke ISCC with the following arguments
; /DExeBase=filename_without_extension
; /DGameName="Whatever"
; /DGameDevName="Your Name"
; /DGameDevUrl="http://www.your.website/"
#define GameVersion GetVersionNumbersString(ExeBase + '.exe')
[Setup]
AppName={#GameName}
AppVersion={#GameVersion}
AppPublisher={#GameDevName}
AppPublisherURL={#GameDevUrl}
; TODO: AppSupportURL=
; TODO: AppUpdatesURL=
DefaultDirName={autopf}\{#GameName}
; NOTE: Remove these if using a 32-bit export
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
; Omit "version x.y.z" from the name in the Add/Remove Programs menu
AppVerName={#GameName}
; Just for fun
SetupIconFile=setup_icon.ico
; TODO: WizardImageFile=
WizardSmallImageFile=wizard_small_image.bmp
; Compress as well as can be hoped for
Compression=lzma2/ultra
InternalCompressLevel=ultra
SolidCompression=yes
; Be kind to the Start Menu
DefaultGroupName=Games
AllowNoIcons=yes
; Be kind to digital archivists who want easy access to this stuff
;
; TODO: Find a way to extract ALL of this from the game EXE to avoid
; opportunities for letting the information get out of sync.
VersionInfoProductName={#GameName}
VersionInfoCompany={#GameDevName}
VersionInfoVersion={#GameVersion}
; If this directive is not specified or is blank, Windows will select an icon
; itself, which may not be the one you prefer.
; -- https://jrsoftware.org/ishelp/topic_setup_uninstalldisplayicon.htm
UninstallDisplayIcon={app}\{#ExeBase}.exe
[Files]
; ignoreversion because debug and release builds may have the same PE metadata
; and it can lead to confusing/frustrating behaviour when you try to switch
Source: "{#ExeBase}.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#ExeBase}.pck"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\{#GameName}"; Filename: "{app}\{#ExeBase}.exe"; WorkingDir: "{app}"
; An "Uninstall" option is omitted because I think we've reached a point where
; people can be trusted to know about or look up Add/Remove Programs
[Run]
Filename: "{app}\{#ExeBase}.exe"; Description: "Run the Game"; Flags: postinstall nowait skipifsilent unchecked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment