Skip to content

Distributing Launchpad on Windows

Jarl Gullberg edited this page May 6, 2015 · 5 revisions

Distributing Launchpad on Windows is very simple. While you can roll your own solution, I personally use Inno Setup to create a self-contained installer which will handle everything for your customers.

If you've used Inno Setup before, the summary will suffice. If not, read on.

Summary

Download the script from GitHub Launchpad Inno Script. Set the LaunchpadReleaseDir define to a folder with a built and configured copy of Launchpad.
Download the GTK# installer and place it in the same directory, editing the version in the script to the version you downloaded.

Build and distribute.

Inno Setup

Inno Setup is a Windows-only installation package studio which implements a powerful scripting language, allowing you to create complex and fully featured .exe installation packages. I've created a script specifically for Launchpad, which should be simple to edit to suit your needs. I'm going to walk you through editing, building and configuring this script.

It should be noted that advanced users will most likely want to extend and edit this script, as it is barebones and only serves as an example or quick way of doing things.

Preparations

First of all, you're going to need a complete and configured build of Launchpad. You should, at this point, have downloaded or built it from source and filled out the launcher's config. Place the files into a working directory on your computer - you will need to use the path to this folder later on. Everything inside this directory will be added and deployed to your users when they install the package.

Additionally, you will need to download the GTK# installer from Mono, and place it into the same directory. Since Launchpad uses the same binaries for both Windows and Unix, the applications depends on these libraries to function despite it being a WinForms application. The installer will, in the end, automatically install this file as if the user had installed it themselves.

You can download the GTK# installer here: [http://www.mono-project.com/download/#download-win](GTK# for .NET)

Downloading Inno Setup

Next, you will need the actual software we will be building our package in. Head over to Inno Setup's download page, and download Unicode Quickstart package: Inno Setup Downloads

The installer will present you with a bunch of different alternatives and options while installing - I suggest getting the encryption module because it's nice to have. The provided script editor/IDE is a must for most users, and I find it very useful.

Getting the script

Once you've finished downloading and installing the program, download the script I've created from GitHub: Launchpad ISS Setup

Place this file somewhere where you'll keep your other Launchpad-related items. It's going to be your friend for the rest of this guide.

Now, either open it through the script studio you just installed, or via double-clicking it. It should open in the studio and show you the raw code of the script.

Setting your variables

Now, in order for the script to find your files, we will need to alter some of the defines and variables in the script. Near the top, you should see some lines which look like this:

#define MyAppName "Launchpad"
#define MyAppVersion "0.1.0"
#define MyAppPublisher "Jarl Gullberg"
#define MyAppURL "https://github.com/Nihlus/Launchpad/"
#define MyAppExeName "Launchpad.exe"

;
 ; Fill this out with the path to your built launchpad binaries.
;
#define LaunchpadReleaseDir "C:\Users\Jarl\Desktop\launchpad-winpack"

Alter the values between the quotes to match your game's data - for instance, MyAppName should be changed to whatever the name of your game is, and the publisher should be your company name (or your own, if you are self-publishing).

Pay extra attention to the LaunchpadReleaseDir define - this is the path to the working folder you created at the start of this article. Alter the path from what I have here to the path pointing to your working folder.

Unless you have a custom-built version of Launchpad with a different assembly name, you should not change MyAppExeName.

Additionally, you should not change the MyAppVersion define - this is the version of Launchpad which is distributed with the installer. Changing it won't have any real effect unless you are distributing your own build of Launchpad with official updates disabled - if you're doing that, you are most likely rolling your own solution.

After these values comes a few lines of Setup configurations. Here, you need only alter this line:

OutputDir=C:\Users\Jarl\Desktop

Change this to something more meaningful, like your desktop or your working directory.

Now scroll down to the bottom of the script. Right near the very bottom, you should see these two fields:

[Files]
(...)
; Extra libraries - GTK# must be included.
Source: "{#LaunchpadReleaseDir}\gtk-sharp-2.12.26.msi"; DestDir: "{tmp}";

(...)

[Run]
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\gtk-sharp-2.12.26.msi"" /qn"
(...)

Usually, there is no need to change these two. However, make sure that the version stated here is the same as the one you downloaded earlier and placed into the working folder - if it is not, alter the script to match the file.

Building the installer

If you've done everything correctly so far, you should have a fully functioning script! Hit F9 to start the installer in Debug mode, where you can try out the full installer as a user would normally install it. When you're satisfied, take a look in your specified output directory, and you should see a complete installer file.

All that's left is to distribute this file to your users - well done!