6
\$\begingroup\$

Is it possible to compile a monogame game into a single .exe? I know if you go in the debug or release bin, there is in fact a .exe your game, except you move this .exe's file location or try to run in on another computer it crashes. I am also aware of the one-click application except this seems like a really messy way of redistributing a monogame game. How come when you build your game, the exe for it wont work anywhere but that file location and that computer. I am also aware that the computer probably needs the XNA framework downloaded to play the monogame game, so in short is it possible to redistribute a monogame game by creating a single .exe and assume that person who is using it doesnt have XNA or monogame installed?

\$\endgroup\$
3
  • 8
    \$\begingroup\$ Please don't, this is why installers were invented. There are multiple free and well supported installers such as Windows Installer XML if you need a way to distribute your game. Most such installers allow you to install supporting libraries iff they are not already installed. Also monogame is not built on top of XNA its build on top of a managed DirectX wrapper so XNA is not a requirements. I think SlimDX and OpenTK are though/ \$\endgroup\$ Commented Mar 26, 2013 at 19:23
  • \$\begingroup\$ To correct my self it is SharpDX not SlimDX. \$\endgroup\$ Commented Mar 26, 2013 at 20:08
  • 1
    \$\begingroup\$ It seems to me that the question you are really trying to ask is "Why does my game crash when I run it on another computer?". More specifically, you need to provide information about the crash. What exception is thrown? The other part of your question is "How do I create an installer that has the required MonoGame dependencies in it?". If you can do that, you won't have any need for a single exe (which btw isn't easy, maybe impossible). \$\endgroup\$ Commented Mar 26, 2013 at 22:54

1 Answer 1

2
\$\begingroup\$

You can use tools like http://madebits.com/netz/index.php.

There is also an application that I personally used: SmartAssembly (http://www.red-gate.com/products/dotnet-development/smartassembly/). Even thought it says it's an obsfucator, you can use it just to pack every .dll and the main .exe into a single .exe.

However, please note that the 'Content' folder which contains the game assets will need to be held alongside with the single .exe file.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .