# How to set up a cross-platform game project that can install standalone or via Steam?

I'm thinking about developing a game. I want to make it cross-platform for Windows, Debian-based Linux and MAC (arm / x86) from the start, which will of course take a bit more time but it also helps to keep down the struggle to later integrate it to other platforms.

As I'm starting from scratch, the first consideration that comes to mind is how to install the game. Here are my requirements:

• The game should be installable via steam.
• The game should be installable independently (even though it needs steam to run eventually). But I want to provide an installer, package, whatever on my webpage for users to download.
• If using external libraries, they should be open source (so is the game).

My intention is to provide it in the most iconic way for each platform. In Windows and Mac this would probably be an installer, whereas on Debian this would probably be a package or an archive.

The question is: how can I set this up to maximize user convenience and allow for some customizability (e.g. I want to design the installer logos/banners etc. myself)?

• I've edited this question to nudge it away from the off-topic "suggest which software packages I should use" and toward the on-topic "how do I solve this problem" to hopefully keep the question open for answers. Mar 16 at 11:26

From what I understand, the main thing you are asking is, if you had a standalone game, how to package it and make it usable from different platforms/operating systems.

With that said, I assume you have a game that can compile to a standalone form, as in having an executable file, asset files, any external dependencies etc. Now it's time to prepare it for distribution on other platforms:

# Steam

Steam willy happily accept a .zip file that contains your standalone project. The only thing you'd have to do is then tell it what file to execute when a person clicks the Play Game button. Something like, execute bin/mygame.exe or rungame.sh. You can also optionally give command line arguments for a more customised experience. This is the same for all operating systems you mentioned.

You don't have to worry about how your project is installed there, as the Steam Client can take care of that for you.

I'm not sure if Steam would accept an actual custom installer, but I imagine that might be a bit more involved.

The game should be installable independently (even though it needs steam to run eventually). But I want to provide an installer, package, whatever on my webpage for users to download.

When implementing the Steamworks SDK in your game, you can add some functionality that basically says, if the game was not launched through Steam, exit and run it through Steam instead. This can be done with the SteamAPI_RestartAppIfNecessary flag. This is unrelated to making a program installable, which I'll cover below.

# Independently installable

This method is a bit more involved, as it differs from platform to platform. There are tools out there to create installable packages for Windows, assuming you have a standalone project already compiled and working.

### Windows

If you are using CMake, you can use CPack and NSIS to generate a desktop installer, which is a file people can just double click to install your project in their windows machine. There's more information about it on CPack - NSIS generator.

You can then use the Window's MSIX tool to generate a Windows Universal compatible project, to potentially upload it to the Windows Store.

### Linux

For Linux, since your project is open source, you can use something like makefile, to allow users to compile and install your program manually. A usual approach is for users to run the following:

make
make install


To compile and install a project on their system. It's a very long discussion of how to implement this, possibly out of scope for this answer.

Using this method, you can then create packages for different Linux Distributions. Since you asked about debian, there's some information on Debian - Introduction to Debian Packaging.

Each distro has different ways of doing that, but for the most part you'd need to attach the makefile approach above to a file that tells Debian what your game is about, how to compile it etc.

### Mac

Unfortunately my experience there is limited, and I can't help too much. I know it's a Unix platform, and it's possible to use makefiles mentioned above, but I believe you need to use XCode to make something easily distributable and installable.

# Conclusion

The question is: how can I set this up to maximize user convenience and allow for some customizability (e.g. I want to design the installer logos/banners etc. myself)?

For the most part following the steps above will set you up for allowing users to try your game with just a few clicks. To modify the installer, the process is different for each platform.

On Steam you can upload graphical assets that are displayed on different places of your game page.

On CMake, you can supply project icons, which are used when it generates an installer.

• What if I want to ship my game on Linux but not give players access to my sourcecode? Isn't there some way to give them an already compiled binary? Mar 16 at 13:49
• @Philipp I focused mainly on open source because that's what OP asked for. For non-open source games, the two options I'm aware of are to distribute the standalone directory directly, or create a bash script that installs the standalone in a system (which is what GOG uses). A lot of default package managers for a lot of Linux distros do not allow non-open source games, so there isn't really a workaround in that case. Do you think that should be in the original answer ? Mar 16 at 14:05
• @TomTsagk Thanks alot for your elaborate answer. I'm fairly experienced with CMake so I'm glad to hear that you can create an installer from it. As my game is also open source I wouldn't bother for providing a binary alone if its easier the other way, but maybe someone else can elaborate on this topic to give a brief overview of how that would play out, also for the case on MacOS I'm still interested. Mar 17 at 6:14
• @glades when it comes to putting a project on the official software store of each Linux Distro, a lot of them will pretty much reject closed-source projects, maybe with some exceptions with very popular software. The rules are different for each Linux Distro, you'd have to look at that individually, I thought it would be too much information for one post here. If you are using cmake already, it should be straightforward to package your project. Mar 17 at 10:15