Sharing Your Game Package
Describes how to distribute your game to other XNA Game Studio users in a package that protects your source code and assets.
Quick Information
Platform | Source code visible | Format | Windows user requirements | Xbox 360 user requirements | Windows Phone user requirements |
---|---|---|---|---|---|
Windows, Xbox 360, and Windows Phone | No | .ccgame App Hub Game Package |
|
|
|
If you would like to share your XNA Game Studio game with other XNA Game Studio users, but do not want to share your source code and assets, you can use the XNA Game Studio package utility (xnapack.exe). The package utility can be used from within supported versions of Microsoft Visual Studio tools, or from the command line.
You can share Xbox 360 games packaged in this format with App Hub members through the App Hub website for peer review and possible listing on the Xbox LIVE Marketplace.
Note
Currently, only Xbox 360 games can be shared through App Hub.
You can share Windows Phone games packaged in this format through Windows Phone Marketplace for possible listing.
There are two fundamental ways that a game package can be used:
Sharing with Another User
The XNA Game Studio package utility compresses your game's built executable and assets into a special compressed format that other XNA Game Studio users can open and play. You can package only XNA Game Studio game projects. The package utility does not support XNA Game Studio library projects.
To package your game using the XNA Game Studio package utility from the Visual Studio development environment
In XNA Game Studio, open the project you want to package.
On the Build menu, click Package [projname] as Creators Club Game, where [projname] is the name of the current project.
The output window indicates the status of the packing operation. If the packing operation is successful, the package file is created with a .ccgame extension and placed in the appropriate output folder of the project. For example, the package file for the release version of your Windows game would be located in the bin\x86\Release folder. This example assumes the default project settings have not been modified.
You may share this .ccgame file with other XNA Game Studio users. It is a compressed version of your project that contains no source code or source assets. Other users can play it, but are unable to view or modify your source files.
To package your game using the XNA Game Studio package utility from the command line
To open an XNA Game Studio command line, open the Start menu, click XNA Game Studio 4.0 Refresh, select Tools, and then click XNA Game Studio Command Prompt.
From the command line, use the cd command to change the active folder to the appropriate output folder of the project you want to package.
Enter a packing command using the syntax required by the XNA Game Studio package utility.
The following example packs a Windows game named
MyWinGame
and suppresses the logo and copyright messages.xnapack MyWinGame.exe /nologo
The command-line window indicates the current status of the packing operation. If the packing operation is successful, you created the package file with a .ccgame extension, and it is placed in the same folder as the startup assembly.
After you pack a game, you can share the .ccgame file with other XNA Game Studio users. It is a compressed version of your project that contains no source code or source assets. Other users can play it, but are unable to view or modify your source files.
Sharing from Another User
When you receive a .ccgame file from another XNA Game Studio user, you can unpack it by using either the graphical unpacking utility or the command-line utility.
Consider the following before unpacking.
XNA Game Studio must be installed.
Unpacking a .ccgame file automatically deploys the assets and game assembly to the target platform.
- For a Windows project, you must have the same version of the XNA Framework installed with which the .ccgame file was built.
- For an Xbox 360 project, you must have at least one Xbox 360 console specified already in XNA Game Studio Device Center, a valid App Hub membership, and XNA Game Studio Connect running on the Xbox 360 console to which you are deploying the assets and game assembly.
- For a Windows Phone project, you must have at least one Windows Phone digital media device connected.
To unpack a packaged game from Windows Explorer
From Windows Explorer, double-click the .ccgame file you want to unpack.
A dialog box appears.
Click Unpack to begin the unpacking process.
When the unpacking process is complete, the next step depends on the platform.
- For a Windows project, a folder containing the game executable opens in Windows Explorer. Run the game by double-clicking the executable.
- For an Xbox 360 project, you can run the game from the Game Library.
- For a Windows Phone project, you can run the game from the Games list.
Warning
If the intended destination of an unpacked game already exists, the XNA Game Studio package utility deletes the existing destination and its contents. It then creates a new container or folder containing the contents of the new game package. This applies to games targeting Windows, Xbox 360, and Windows Phone platforms.
To unpack a packaged game from the command line
To open an XNA Game Studio command prompt, on the Start menu, click XNA Game Studio 4.0 Refresh, click Tools, and then click XNA Game Studio Command Prompt.
From the command line, use the cd command to change the active folder to the folder containing the appropriate package.
Enter an unpacking command using the syntax required by the XNA Game Studio packing utility.
The following example unpacks an App Hub game package containing a Windows game called
MyWinGame
, and suppresses all non-error messages.xnapack unpack MyWinGame-Windows.ccgame /quiet
When the unpacking process is complete, the next step depends on the platform.
- For a Windows project, a folder containing the game executable opens in Windows Explorer. Run the game by double-clicking the executable.
- For an Xbox 360 project, you can run the game from the Game Library on your Xbox 360 console.
- For a Windows Phone project, you can run the game from the Games list on your Windows Phone device.
Warning
If the intended destination of an unpacked game already exists, the XNA Game Studio package utility deletes the existing destination and its contents. It then creates a new container or folder containing the contents of the new game package. This applies to games targeting Xbox 360, Windows Phone, and Windows platforms.
See Also
Sharing Your Source Code and Assets
Distributing Your Finished Windows Game