Game Development Community

Creating a distributable exe

by Vishal Bhanderi · in Torque X 2D · 10/30/2007 (1:36 pm) · 13 replies

Hey guys,

I need help on how to compile the game to make it work with other computers without the IDE. I can't seem to get it to work whatever i try. I read somewhere that it's impossible. Is that true ?

#1
10/30/2007 (6:08 pm)
From Game Studio Express, select Build > Build Solution. Under the project directory is a folder called bin/x86/Debug. Your Game.exe should be there. There are a few other problems though. You'll find that the .exe is such a small file because most of the heavy lifting is in the TorqueX DLL, XNA DLLs, and .NET Framework DLLs. In order to package your game for another "clean" Windows configuration, you will need to package these framework installations. There's no clear path for that yet, as far as I know. To make things worse, the EULA presented with XNA and Game Studio Express forbids you to sell and distribute your game. So, there might be some legal challenges to contend with as well. Overall, I see XNA as purely a hobby, educational, and prototyping platform and not a commercial game development platform.

John K.
#2
10/31/2007 (2:30 am)
@John
Thank you for replying.

I tried the normal building but this doesn't seem to work (for me at least).
But "redistributables" and framework installations i don't get. Hopefully this will be easier when XNA 2 comes out.

I'm sure there letting us sell the games:
From the XNA help

"For Windows games only, you can make your game available to a wider audience (referred to as independent publishing) by distributing your completed game files, along with a set of prerequisite software, called "redistributables," that make it possible for other Windows users to play your game, even if they are not XNA Game Studio Express users."
#3
10/31/2007 (6:03 am)
XNA Dev Center's FAQ states - "XNA Game Studio Express may be used to create commercial games which target Windows". You just can't publish a commercial 360 title using XNA Game Studio Express.
#4
10/31/2007 (7:13 am)
Yes, you technically can. But finding the right redist setup is a problem with XNA right now. I don't believe it is that you "can't" but that it is not streamlined in a way to make it accessible to end users right now. It's been a while since I looked at deployment, though.
#5
10/31/2007 (9:12 am)
Looks like there might be some hope. I came across the XNA Framework redistribution package here...

C:\Program Files\Microsoft XNA\XNA Game Studio Express\v1.0\Redist

Check your hard drive for it... It contains the DirectX setup files in \DX Redist and the XNA setup files in \XNA FX Redist. You probably also need to distribute the .NET Framework runtime as well. (.NET Framework Redist)

Your game's installer should detect if these libraries are installed and then trigger the appropriate framework installation; starting with .NET, then DirectX, then XNA. Inno, my favorite free installer, should be able to handle it.

John K.
#6
10/31/2007 (12:17 pm)
Thank you guys. I'll give it one more go. If it fails hopefully it's easier in XNA 2.
#7
11/02/2007 (1:57 pm)
Benjamin Nitschke has created installers for his downloadable games, that will check if you have .NET etc. already on your system and will download and install the missing components automatically. But I don't know how he did this...
#8
11/02/2007 (2:08 pm)
Out of curiousity, I've looked into this a bit more and I've just finished an installer using Inno Setup. It runs .NET Setup, then DirectX Setup, then XNA Setup. The only requirement (for now) is that each framework setup is accessed locally and requires the redist files to be packaged with the game. Each framework install is launched silently and uses their own version detection to decide if a full install is necesasry. I can try to make it downloadable like Nitschke's, that seems like a better way to go to minimize the download footprint. I will post my Inno install script to this thread in a few hours.

John K.
#9
11/02/2007 (3:03 pm)
Cool! It looks that Inno is THE installer application.
#10
11/03/2007 (2:10 am)
Wow thanks guys. I hope it works for me :D
#11
11/03/2007 (11:30 am)
Here's the script I put together using Inno Setup. I created an instance of TankBuster called XnaTankBuster, using the TankBuster starter template. It's not perfect, but it seems to work. If I can scrape together some more time, I'll make a few improvements, such as download the frameworks as needed to keep a small initial download footprint.

[Setup]
AppName=TankBuster Example
AppVerName=TankBuster Example 1.0
AppPublisher=GarageGames
AppPublisherURL=http://www.garagegames.com/
AppSupportURL=http://www.garagegames.com/
AppUpdatesURL=http://www.garagegames.com/
DefaultDirName={pf}\TankBuster
DefaultGroupName=XNA Games
OutputBaseFilename=SetupOutput
Compression=lzma
SolidCompression=yes
 
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
 
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
 
[Files]
Source: "C:\XnaTankBuster\XnaTankBuster\Game\bin\x86\Release\Game.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\XnaTankBuster\XnaTankBuster\Game\bin\x86\Release\GarageGames.TorqueX.Framework.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\XnaTankBuster\XnaTankBuster\Game\bin\x86\Release\torqueSettings.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\XnaTankBuster\XnaTankBuster\Game\bin\x86\Release\data\images\*"; DestDir: "{app}\data\images"; Flags: ignoreversion
Source: "C:\XnaTankBuster\XnaTankBuster\Game\bin\x86\Release\data\levels\*"; DestDir: "{app}\data\levels"; Flags: ignoreversion
Source: "C:\XnaTankBuster\XnaTankBuster\Game\bin\x86\Release\data\sounds\*"; DestDir: "{app}\data\sounds"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
 
[Icons]
Name: "{group}\TankBuster"; Filename: "{app}\Game.exe"; WorkingDir: "{app}"
Name: "{commondesktop}\TankBuster"; Filename: "{app}\Game.exe"; WorkingDir: "{app}"; Tasks: desktopicon
 
[Run]
;INSTALL .NET FRAMEWORK
Filename: "{src}\DotNetRedist\dotnetfx.exe"; Parameters: "/Q"; Flags: runhidden skipifsilent
;INSTALL DirectX FRAMEWORK
Filename: "{src}\DirectXRedist\DXSETUP.exe"; Parameters: "/silent"; Flags: runhidden skipifsilent
;INSTALL XNA FRAMEWORK
Filename: "{src}\XNARedist\xnafx_redist.msi"; Parameters: "/quiet"; Flags: runhidden skipifsilent

I'll try to upload the runnable setup package to my website later on so you can see it in action. Although, even with packaging all the frameworks, the total download size (for TankBuster) is only 37MB:
9 MB for the Game
22 MB for .NET Framework
4 MB for Direct X
2 MB for XNA

Not too bad...

John K.
#12
11/04/2007 (3:31 am)
@John.

I tried using the Inno setup, it complied fine, but when i ran the setup it got 3 errors for the extra files (xna rest, .net, dx9) it said the files could no be found it the output directory. Is there something extra i need to do?
#13
11/04/2007 (7:48 am)
Yes, sorry that wasn't more clear. those errors mean that you don't have the Framework installers listed specified earlier. It is expecting to have the following in your "output" directoy, where ths compiled . SetupOutput.exe is created...

output\DotNetRedist\dotnetfx.exe
From Here

output\DirectXRedist\DXSETUP.exe
From: C:\Program Files\Microsoft XNA\XNA Game Studio Express\v1.0\Redist\DX Redist

output\XNARedist\xnafx_redist.msi
From: C:\Program Files\Microsoft XNA\XNA Game Studio Express\v1.0\Redist\XNA FX Redist

I'm still planning to create a more seamless version of the installer that downloads these components 'on-demand' rather than requiring them to be with the package.

John K.