Our Castle Game Engine download page now recommends Windows users to download the engine as a self-extracting installer (EXE), which is a typical installation method on Windows.
The installer is done using excellent and popular Inno Setup. It will install CGE to a user directory, like C:\Users\USERNAME\AppData\Local\Programs\Castle Game Engine
. The installer automatically creates menu and desktop shortcuts, shows you the license summary, runs CGE editor for the 1st time if you want and generally makes the whole process completely straightforward for Windows users.
This is similar to e.g. VS Code, that also uses InnoSetup and installs for the current user. Note that we don’t install VS Code with CGE (though we may in the future), and as always you have a choice which IDE to use — VS Code, Lazarus, Delphi, Emacs or really any text editor you find suitable to edit Pascal.
As a bonus, unpacking using the InnoSetup is also much faster than unpacking the zip using built-in Windows zip support.
TODO: Note that the installer right now does not make system-wide install. I have an option to activate system-wide installlation for CGE (and the setup can offer you a choice whether to install for current user or system-wide). But it is hidden for now, because system-wide installation means that examples are read-only, and it means you cannot easily explore + just build / tweak the examples. At some point in the future, we should allow you to open example by making a copy of it and then we’ll reenable the option for system-wide installation here. Note that everything else worked smoothly with system-wide installation, the CGE editor and build tool work as usual, our tools in general have always been written to handle the case when they are installed in read-only directory.
Since you know I love automation and CI / CI, of course the whole process of building the installer is automated, and thanks to InnoSetup it was really trivial to automate. So the installer is rebuild using Jenkins after every commit (that passes a number of automated checks) and you always have the installer for the latest CGE snapshot available.
-
We keep a ISS file describing how to package CGE.
-
Our pack_release.sh script has an option to, once it prepared the CGE distributable files, instead of zip it can create a setup. To do this, it calls iscc
with parameters that define input, output directory, version etc. It looks like this (this is bash script):
# Detect iscc location
INNO_SETUP_CLI='iscc'
if ! which "${INNO_SETUP_CLI}" > /dev/null; then
# if not on $PATH, try default location
INNO_SETUP_CLI='c:/Program Files (x86)/Inno Setup 6/iscc.exe'
fi
# See https://jrsoftware.org/ishelp/index.php?topic=compilercmdline
# and https://jrsoftware.org/ispphelp/index.php?topic=isppcc (for preprocessor additional options).
"${INNO_SETUP_CLI}" \
"${ORIGINAL_CASTLE_ENGINE_PATH}/tools/internal/pack_release/cge-windows-setup.iss" \
"/O${OUTPUT_DIRECTORY}" \
"/F${ARCHIVE_NAME}" \
"/DMyAppSrcDir=${TEMP_PATH}castle_game_engine" \
"/DMyAppVersion=${CGE_VERSION}" |
# Detect iscc location
INNO_SETUP_CLI='iscc'
if ! which "${INNO_SETUP_CLI}" > /dev/null; then
# if not on $PATH, try default location
INNO_SETUP_CLI='c:/Program Files (x86)/Inno Setup 6/iscc.exe'
fi
# See https://jrsoftware.org/ishelp/index.php?topic=compilercmdline
# and https://jrsoftware.org/ispphelp/index.php?topic=isppcc (for preprocessor additional options).
"${INNO_SETUP_CLI}" \
"${ORIGINAL_CASTLE_ENGINE_PATH}/tools/internal/pack_release/cge-windows-setup.iss" \
"/O${OUTPUT_DIRECTORY}" \
"/F${ARCHIVE_NAME}" \
"/DMyAppSrcDir=${TEMP_PATH}castle_game_engine" \
"/DMyAppVersion=${CGE_VERSION}"
-
And that’s it π Jenkins archives the resulting exe, our scripts copy it to a GitHub release of the next snapshot, and we link to them.
The process was very straightforward I have to say, and in the future we will likely add an easy option to package your games into a self-extracting Windows installer too (using InnoSetup under the hood). For now, you can roll such setup on your own, using the output of CGE package in “directory” format as a start (input for Inno Setup) and following above notes and just Inno Setup documentation.