Game Development Community

Unable to open XML file in 64bit Vista

by Peter Robinson · in Torque 2D Professional · 11/08/2013 (4:13 pm) · 5 replies

I couldn't find anything on the forums about this. I basically have a customer who's copy of my game couldn't open the XML files that I use for my maps. The files usually sit in the AppData folder and normally everything works fine but in his case it's not opening the file. He's using 64bit Vista which I have a feeling has something to do with the problem. I'm trying to open the file using a SimXMLDocument object. Since it's on his computer I don't really have a way of trying the normal things like checking isFile(). I should also mention that the game is running with an older version of Torque2D, 1.7.6. If any of this sounds like a familiar problem please let me know. It's going to be hard to figure out since I don't have access to his system. Thanks!

About the author

A programmer who has been using the Torque2D game engine since the early adopter days. My game is Pirate Code and it can be found at www.circuithive.com. It will be arriving on Steam in 2016.


#1
11/09/2013 (2:41 pm)
This is a very long shot but has worked for me in the past: have him try to install the game in any directory except the Program Files (or its derivatives).
#2
11/10/2013 (5:24 am)
After talking to the customer it looks like it's a problem with the installer. I think the engine is looking in the right place but the files it's looking for aren't there. The installer is Inno Script. The files are supposed to go to the {userappdata} constant. Again he's running Vista 64bit and he installed the game to a different drive (H:\) while the user's AppData folder is on the C drive. All these pieces together landed the files in the wrong spot and I'm not really sure even where that spot is. Any ideas on how to fix this? Have any of you seen anything like this with your installers? Thanks!
#3
11/10/2013 (9:32 am)
I also use InnoSetup to build my installer and haven't seen any problems like this. I used to run into problems with running from shortcuts, but as soon as I set the "Working directory", everything worked.

Is there a reason that the XML files must go into the app data directory? Are they modifiable? Otherwise, I'd highly recommend them to go into the installed directory.

One last idea... could you show us the code that reads the XML file? Maybe there's a more robust way to handle this?
#4
11/10/2013 (1:59 pm)
I think that's how I'm going to try to fix this - moving the xml files to the install directory. I have a feeling that will be the easiest way to fix the problem. I'll follow up here on if it works.
#5
11/12/2013 (12:05 pm)
Well for whatever reason I couldn't get the xml files to work in the install directory so I changed the files to cs files and the save and load functions to read them. Probably should have done it this way in the first place. Now they're safely inside the install folder where the installer can't misplace them. Thanks for your help!