Building A Windows Installer For MonoGame App

Hi,

I’m soon to be distributing a beta for Jetboard Joust and would rather do it with a proper installer rather than sending out a zip file (which is what I did for the alpha).

Does anyone have any preferred tools for this that are simple to use and (preferably) free? I’ve googled and see there’s a bunch of options out there but I thought asking the community first might stop me going down any blind alleys!

I’m a MacOS guy so generally unfamiliar with Windows terminology in general - please bear that in mind :smile:

I’ve used Inno Setup in the distant past with some very good results: http://www.jrsoftware.org/isinfo.php

However, since you’re already on Steam, it’s pretty trivial to setup a beta build/package, and could then take advantage of the Steam distribution processes.

1 Like

Wasting your time here. Installers are annoying and unnecessary for indie games.

Wasting your time here. Installers are annoying and unnecessary for indie games.

I disagree. End-users do not understand the purpose of prerequisites, let alone which ones they’d need. For that reason alone, installers make their lives easier so that when they get your game it “just works”.

3 Likes

Setup wizards (like Inno) are perfectly fine to use.

Although Windows Installer Xml (WiX) is ideal if you have some serious work to do as part of installation (like DLC/DRM issues), it’s not worth fussing with and learning if you’re just making a splat installer.


Installers aren’t really optional, only technical types will understand the mark of the web and unblock your executable on windows and the windows firewall might as well be the Spanish inquisition.

2 Likes

They can unpack the zip, they’re not that stupid. Wanna waste some time, pick NSIS. Used in one of my projects (which actually needed an installer), worked fine.

Thanks all for your input - I will look into Inno.

The feedback I have is that installers are necessary as many users get put off by the various security ‘walls’ involved with unpacking zips, not to mention the potential issues with missing .dlls, .net versions etc. Someone I spoke to who ran a beta program similar to mine estimated he had at least a 50% drop off rate because of this and wished he’d used an installer.

Personally, I prefer installers.

I’m not going to be distributing the beta through Steam which is why I’m not using their installer. This is partly as I don’t want to go through the hurdles of getting the build approved atm and partly because (apparently) giving away beta keys removes the game from people’s wishlists and I need all the wishlists I can get at the moment!

1 Like

Inno is a great tool.
NSIS is great too, but personally I hate fiddling with the script to set it up.
You could also go other ways to distribute your game.
For example with the itch,io app that acts like a Steam client for indies.
You can set up what dependencies to install or you could go the osu! route and make your own custom installer in C#.

Well, I got Inno to work with a minimum of fuss, took less than an hour, so thanks again for that recommendation. I just used the wizard to set things up and then manually edited a couple of things in the script it generated - bingo!

It’s a bit annoying that I get listed as ‘unknown publisher’ when it installs (even though I’ve defined the publisher name) but I’m guessing I need a signing certificate to get around that and I’m not going to be paying for one of those (in the short-term at least).

So, in the installed directory I have the exe file and all the dlls that MonoGame requires plus the MonoGame content directory and everything in there. I presume this is the standard way of doing things or am I missing something? There’s no way to hide the content directory from the user is there? There’s something that irks me about all of those files in there that some end user could mess with and then come crying to me for support (or writing a bad review) : D

You can override methods in ContentManager and then give your manager to your “Game” during initialization: Zip content file

They’re already compressed so you’d probably want to consider a RIFF file with the first block being whatever kind of name -> index|offset table you want instead of sticking them in a zip-file.

Zip does actually have just a store without compress option but I don’t have the foggiest idea how you actually use that without ancient tools. In which case zip it up and rename it to something like PAK and call it a day.

Thanks for the info, very interesting! I think that’s going to be put on the ‘nice to have’ list :wink:

Hi - I’m not sure if this would help but in 2015 I wrote Candy Kid originally in XNA and then ported to MonoGame for iOS / Android. However, for the Windows build I managed to create a WiX installer… you can find more information how it was done here
Cheers,
Steve.

If its just for windows has anyone tried just using the one click installer with monogame that is built into VS in the project properties under publish ? Worked in xna.

If its just for windows has anyone tried just using the one click installer with monogame that is built into VS in the project properties under publish ? Worked in xna.

The ClickOnce stuff is only usable when it’s something internal (which is why the default tries to pump to an FTP target or NMD - not a local folder). It has barely any configuration, doesn’t cope with partial patching (because it’s supposed to be installed from the intranet), updates use a WTF-Archival-Bloat! mess of madness, easily crashes Windows if you’re using Fody (which you should be), etc.

Of course, that’s assuming that it even manages to generate a working installer instead of one that just crashes. That thing is evil, manually rigging things together with Orca is better idea.

For the installer, it would be a good idea to have it also package/install the version of .NET that your game targets (this can be found in your project’s properties, if you don’t know). Assuming you’re targeting MonoGame for WindowsDX, it may also be worth your time to have your installer package/install DirectX. Up to you though, both of those will already be on pretty much any player’s machine, but if it/they aren’t your game will likely crash on startup and your end-user won’t understand why.

As for hiding your content files, there are a number of ways, but most would require a decent amount of work. Namely, setting up your own content processor that extends/replaces MonoGame’s default ContentManager. The simplest way, without any programming work, is to just make the files “hidden”. Under default windows settings, they simply won’t appear. Nothing else to it. However, you can go as far as embedding and even encrypting your content files into your executable. Research the options and their various pros/cons before committing a lot of time to anything. For example, with the embedding option, the files will be “hidden” within your executable, but unless you do anything else with it they’d be easily extractable via a simple .NET decompiler, and therefore probably wouldn’t be worth the effort to make that work. Additionally, it makes your executable pretty large, and effects the way it’s loaded and such.

1 Like

That’s right, it makes your executable take 2 years to ngen and finally start. Externally pack your resources, use Fody Costura to clean up your assemblies - then accept the 2-10 minute startup time on new machines (because of Fody.Costura packing ~30mb of assemblies into your exe). Pack resources into your exe and you’re just toast.

Use an external stub app to hide the delay if needed (by adding a null path to your exec params so ngen can do its thing) showing a spinning loader until ngen returns.

C# is probably the most complicated source material to deploy. It’s just a mess. You can rewrite an entire CMake build-tree faster than you can decipher a BadImageFormatException in regards to an installer.

Again, thanks for all the great insights people. Really helpful. I did wonder whether it was possible to include the .net runtime so I will look into that. I’m using the DesktopGL MonoGame project rather than the DirectX one so I don’t think I have to worry about DIrectX. I don’t think I’m going to sweat too much over packaging all the content files for now, seems like there are better uses for my time. I think, will probably just make them ‘hidden’ under Windows.

1 Like