Tutorial

Tutorial: Windows Installer for Your Unity Game

In this tutorial I’ll show you a really simple way to get a Windows installer for your Unity game with totally free tools but without any scripting involved in less than ~10 minutes!

Intro

I was part of a team which created a game as their master project. It’s called Of Light & Shadow and we released it under CC BY-NC-ND 3.0. In the end, I did the research and the actual creation of the Windows installer of our game but since i can’t code, I needed something rather simple to work with and here is the way I did it. Hopefully this is helpful for other people as well!

I think there are a couple of reasons why you might want to create an installer for your Unity game:

  • You get one small file thanks to excellent file compression!
  • Your license and/or extra notes will be seen at least…
  • The game gets installed in a safe place per default (C:\Program Files)
  • No manual extraction of files and/or moving them to other locations/folders
  • You can create shortcuts to the executable and to your website
  • It’s very easy to uninstall/remove the game
  • An installer might look professional to some people ;-)

The Tool

After some research I chose Inno Setup by Jordan Russell for several reasons:

  • It’s free and licensed under some kind of open source license!
  • It has a graphical wizard, you don’t have to script to create a basic installer!
  • Inno Setup is in active development since more than 15 years, it’s proven software
  • However it is very customizable and it has support for multilingual installs

Preparation

You need following files/resources to create the installer:

  • An actual build of your game!
    (MyGame.exe & MyGame_Data folder – they should be stored together in a separate build folder)

Optional

  • Your license and/or other notes prepared as .txt or .rtf documents
  • An icon for the setup executable
  • Extra files (Documentation, License, Credits, …)

PS: You can convert a .png/.jpeg/.gif into an .ico file easily with one of the bazillion online converters out there, for example ConvertIcon! (clean & ad free).

Step by Step

The first time you start Inno Setup, this welcome-dialog greets you.

Tutorial Inno Setup 01

Choose Create a new script file using the Script Wizard and click OK.

Tutorial Inno Setup 02

Just click Next.

Tutorial Inno Setup 03

Fill in all necessary information and click Next.

Tutorial Inno Setup 04

Change everything as you like, I chose the default settings.

Tutorial Inno Setup 05

Point the wizard to the main executable of your game, in my case C:\Users\Martin\Documents\#Shadow_Build\OfLightAndShadow.exe. Now we have to add the MyGame_Data folder. Click the Add folder… button but, IMPORTANT, do not choose the MyGame_Data folder directly! Instead choose the parent build folder (which includes the MyGame.exe as well).

Update 2013-07-08: A tip from Graham, thanks!

A quick note about the MyGame_Data folder. You can select it directly, then click edit and set the destination subfolder to “MyGame_Data”. This will create the proper subdirectory once the installation is done and you will not be including any unnecessary files.

Tutorial Inno Setup 06

Click Yes – and Next.

Tutorial Inno Setup 07

Change everything as you like, I checked everything.

Tutorial Inno Setup 08

Optional: If you want your license and/or extra information to be shown during the installation process, add them here as .txt or .rtf documents.

Tutorial Inno Setup 09

Choose the languages (translations) of the installer, I selected all.

Tutorial Inno Setup 10

Change the folder where you want the setup file to be stored after compilation and give it a name.
Optional: You can add the icon for the setup file as well.

Tutorial Inno Setup 11

Just click Next.

Tutorial Inno Setup 12

Finish.

Tutorial Inno Setup 13

Yes!

Tutorial Inno Setup 14

Save the script file and click Yes, the compilation starts automatically afterwards.

Tutorial Inno Setup 15

The main window with the script after the compilation and after a successful test of the installer (click to enlarge). If you want to try the result of this process, please go ahead and download the setup of Of Light & Shadow!

Notes

If you absolutely want to change the visual appearance of your installer, you should check out ISSkin. Take a look at the Getting Started page for a decent tutorial and some example code (2013-02: Seems like ISSkin has been abandoned). For any other script modifications, take a look at the Documentation!