Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
8  
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/ –  ClassicThunder Mar 26 '13 at 19:23
    
To correct my self it is SharpDX not SlimDX. –  ClassicThunder Mar 26 '13 at 20:08
1  
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). –  craftworkgames Mar 26 '13 at 22:54
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.