Comfortable Windows installer of Castle Game Engine, plus notes how to integrate InnoSetup with Jenkins and into your own applications

Posted on

Castle Game Engine installer
Castle Game Engine installed on Windows
Castle Game Engine installer
Castle Game Engine installer

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.

  1. We keep a ISS file describing how to package CGE.

  2. 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}"
  3. 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.

Notable Replies

  1. Personally, I find this a little more confusing than before.

    Firstly, the filename for the installer executable does not give any clues that it is for Windows (other the .exe suffix) nor whether it is 32 or 64 bit. It would be less confusing if it followed the same naming conventions as the other files.

    Also, it isn’t clear from your description whether installing VS Code is optional for those that prefer to use another IDE such as Lazarus.

  2. It’s linked under “Windows…” on Download | Castle Game Engine :slight_smile: And as you say, it is .exe – so naturally it is for Windows.

    As for bits: This is the version of Castle Game Engine for Windows we recommend you to download, whether you want to build 64 or 32-bit applications. To build 32-bit you just combine it with a compiler that makes win32 applications (FPC or Delphi), but regardless of it you can use CGE editor in 64-bit mode.

    Most of the world has moved to 64-bit by now, and we don’t actively test CGE editor on win32 (even though it should work). So you really should use CGE editor win64 version. And you likely should also make win64 applications, this is what users generally expect, unless you really have some specific needs.

    Nothing has changed here, and the installation is not bundled with VS Code. I see how the text in my news announcement could be confusing, I edited it – the point was just that https://code.visualstudio.com/ installer for Windows is also using InnoSetup and ends up installed alongside CGE. But this is unrelated to CGE, i.e. we do not install VS Code automatically (yet).

    And as always, and we mention it also on Install | Manual | Castle Game Engine , the choice of IDE is yours. VS Code, Lazarus, Delphi, Emacs or really any text editor. This will never change, whatever we will recommend as default. Any IDE you like is suitable to edit Pascal code.

  3. Thanks. The description is much clearer now.

    Does the installer make it any easier to update CGE?

    When I mentioned the filenames being confusing, I meant on the GitHub latest releases page, where the filename is the main way of knowing what each file is.

  4. Not (yet). There is no auto-update feature (for now). To update CGE, you just have to go to Download | Castle Game Engine and download and install the new version.

    When and how we will deal with auto-updates is a task for the future :slight_smile: Definitely first we need to finally release 7.0 and then get on some reasonable “release cycle” (i.e. recommend to users stable 7.0, 7.2, 7.4 etc.) instead of recommending “7.0-alpha.snapshot” :slight_smile:

    InnoSetup makes sure that if you install another version of CGE on top of existing, it will be upgraded properly (you don’t need to make explicit “uninstall” before doing explicit installation of new version).

Continue the discussion at Castle Game Engine Forum

Participants