Creating an installer for Windows

As I mentioned previously, having multiple folders that need to be included with our .exe is somewhat of a pain. Rather than giving people a .zip file and hoping that they will extract it all and then keep everything in the same folder, I'd rather have the process be automatic and give the person an opportunity to have it installed, just like a professional game. With that in mind, I'm going to go over a free way to create a Windows installer.

Getting ready

Before we start working on this, we need to have an exported project. If you do not have that already, follow the previous recipe all the way to completion.

How to do it…

The first thing we need to do is get our setup program. For our demonstration, I will be using Jordan Russell's Inno setup. Let's get started by first downloading it:

  1. Go to http://jrsoftware.org/isinfo.php and from there, click on the Download Inno Setup link.
    How to do it…
  2. From here, click on the Stable Release button and select the isetup-5.5.6.exe file. Once it's finished, double-click on the executable to open it, clicking on the Run button if it shows a Security Warning and Yes to allow changes.
  3. Under the Select Setup Language window, leave it as English and then click on Ok.
    How to do it…
  4. From here, run through the installation, making sure to uncheck the Install Inno Setup Preprocessor option since we won't be using it. Upon finishing, make sure that Launch Inno Setup is checked and then press the Finish button.

    When you open the program, it will look something similar to this:

    How to do it…
  5. From here, choose Create a new script file using the Script Wizard and then select OK.
  6. Now click on the Next button, and you'll come to the Application Information section. Fill in your information and then click on Next.
    How to do it…
  7. Next, you'll come up to some information about the Application folder. In general, you will not want to change this information, so I'd click Next.
  8. From here, we'll be brought to the Application Files section, where we need to specify the files we want to install. Under Application main executable file:, select Browse to go to the location of your Export folder, select the .exe file, and then click on Open.
    How to do it…
  9. Now, we need to add in the project's folder (the same name as the .exe file). Click on the Add Folder… button, select the project's name folder, and then click on OK. In the popup that appears and asks whether you should include files in the subfolders, click on Yes.
  10. After that, we need to also add in the Engine folder. Click on the Add Folder… button, select the Engine folder, and then click on OK. In the popup that appears and asks whether you should include files in the subfolders, click on the Yes button.
    How to do it…
  11. Then, select each folder in the Other Applications files: section and click on the Edit button. From here, set the Destination subfolder property to the same name as the folder and then click on OK.
    How to do it…
  12. Make sure that you do the same with the Engine folder as well and then click on the Next button.
  13. In the next menu, check whichever options you'd like, and then click on Next.
    How to do it…
  14. Now, you'll have an option to include a license file, such as a EULA or whatever your publisher may require, and any personal stuff you want to tell your users before or after installation. The program accepts .txt and .rtf files. Once you're ready, click on the Next button.
  15. Next, they'll allow you to specify what languages you want the installation to work for. I'll just go for English, but you can add more. Afterward, click on Next.
  16. We need to set where we want the setup to be placed as well as the icon for it or a password. I created a new folder on my desktop called UE4DemoSetup and used it. Then click on Next!
    How to do it…

    Note

    If you want to include a custom icon but don't have a .ico file, you can visit http://www.icoconverter.com/ to create one from an image file.

  17. Next, you'll be brought to the Successfully Completed Script Wizard screen. After this, click on Finish!
    How to do it…
  18. Now it will ask you whether you'd like to compile the script immediately. Select Yes. It'll also ask you whether you want to save your script. Again, click on Yes. I saved it to the same folder as my exporting directory. It'll take a while, but as soon as you see Finished in the console window, it should be ready!
    How to do it…
  19. If you go to the same place as your export folder, you should see your installer!
    How to do it…
  20. If you run the project, you should see something similar to this:
    How to do it…

With this, we now have a working installer for our game and a single file that we can share with anyone. This will install everything correctly!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.23.114.100