Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


XNA Distribution Always Failing


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 kobuscrispi   Members   -  Reputation: 126

Like
0Likes
Like

Posted 25 August 2009 - 09:53 AM

I have spent all day looking up and trying different methods to distribute a .exe file of an XNA game. I made almost the simplest project possible (basically the XNA default game template with one picture added), and then tried the ClickOnce publish, and also tried using Nuclex's XNA installer to detect or install the XNA and .NET frameworks, and tried to have both people who DO have them already and people who don't, and it failed to work on both machines, despite working on mine. I am absolutely out of ideas as to why this isn't working, let alone how to make it work. I'm programming this on Vista, and I've tried using both Visual C# Express 2008 and SharpDevelop. If anyone has any further suggestions, I'm all ears.

Sponsor:

#2 EJH   Members   -  Reputation: 314

Like
0Likes
Like

Posted 25 August 2009 - 12:19 PM

The built-in publish isn't too useful from what I've seen. Personally I put the contents of the bin/x86/release folder into an installer (Inno and Nullsoft are both good free ones). Or you can just zip the release folder if you just want to give it to a friend.

Also, are all your game IO file paths relative or absolute? That is the most common cause of distribution failure. Your paths should all be relative to the current directory the game .exe is running in. I use:


string IOPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);




So all game files should be loaded/saved using that path as base, something like:

string playerSaveFile = IOPath + "\\save\\player.txt"

#3 kobuscrispi   Members   -  Reputation: 126

Like
0Likes
Like

Posted 25 August 2009 - 12:29 PM

Quote:
Original post by EJH
Also, are all your game IO file paths relative or absolute? That is the most common cause of distribution failure. Your paths should all be relative to the current directory the game .exe is running in.


Currently, I'm using the provided features in VC#08 for adding content to the solution, and it doesn't give me the option of changing the filename, nor is there any indication of whether it's using relative or absolute paths. My code for loading the resource just says:

mSpriteTexture = this.Content.Load<Texture2D>("hero");

Am I doing something seriously wrong here?

#4 EJH   Members   -  Reputation: 314

Like
0Likes
Like

Posted 26 August 2009 - 05:17 AM

Quote:
Original post by kobuscrispi
Quote:
Original post by EJH
Also, are all your game IO file paths relative or absolute? That is the most common cause of distribution failure. Your paths should all be relative to the current directory the game .exe is running in.


Currently, I'm using the provided features in VC#08 for adding content to the solution, and it doesn't give me the option of changing the filename, nor is there any indication of whether it's using relative or absolute paths. My code for loading the resource just says:

mSpriteTexture = this.Content.Load<Texture2D>("hero");

Am I doing something seriously wrong here?


I had to make paths to content relative because of exactly what is happening to you. Here's what I did:



// first define a base IOPath for all files
string IOPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);


// when loading models or textures
// use the base path + relative path
Model m = new Model();
m = ContentManager.Load<Model>(IOPath + "\\Content\\Models\\myModel.x");





#5 Machaira   Moderators   -  Reputation: 1028

Like
0Likes
Like

Posted 26 August 2009 - 06:27 AM

Quote:
Original post by EJH
I had to make paths to content relative because of exactly what is happening to you. Here's what I did:

Then something is wrong. You shouldn't have to specify the root game folder for the ContentManager. Normally you just set the RootDirectory property:

Content.RootDirectory = "Content";

Also, you don't use the extension for the content file as each piece of content is compiled into a file with an .xnb extension. You use the Asset Name property of the content, which by default is the file name without the extension.

#6 kobuscrispi   Members   -  Reputation: 126

Like
0Likes
Like

Posted 26 August 2009 - 11:04 AM

Tried what EJH suggested. Compiles and runs fine on my computer, but still suffers from exactly the same problem on other machines.

Error is as follows:

Description:
Stopped working

Files that help describe the problem:
C:\Users\Li-Chi\AppData\Local\Temp\WER615.tmp.version.txt
C:\Users\Li-Chi\AppData\Local\Temp\WER5252.tmp.hdmp

Read our privacy statement:
http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409


Not very useful, I know.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS