PDA

View Full Version : How is everybody handling VISTA compatiblity?


billy7777
05-23-2007, 02:49 PM
Just curious how everyone is handling VISTA compatibility? (Is this all taken care of in your install program?)

I don't have it so I only know what a few of my customers have told me - they eventually got it working. Is anyone else having similiar situations?

1. from what I hear you need to install the game into the "users" directory (instead of programs/etc.)

2. also You need to place a directX 9 file (d3m.dll) into the game directory too.

3. also need to RIGHT-CLICK on the install setup.exe and select "run as admistrator" perhaps the main.exe program file too?

Interested in hearing other developer's experiences with this.

Thanks
Bill

amaranth
05-23-2007, 09:46 PM
Here is a bit of info from me and my partner, Bryce:

You can keep the game in Program Files, but you must put any files that are created or modified in the user's directory. The ACLs on the Program Files directory won't let non-admin users write to that directory. To make my games compatible, I moved the save files and options files into the Users directory.

If you wanted to, you could have your installer modify the ACLs for your game directory so that you can keep your save game files and such within the game directory (simply pass a valid ACL != NULL as the second parameter in your CreateDirectory call). However, if you're dealing with portals, this can be complicated as they are all using different installers and rules. :)

another thing I noticed about Vista...
If you are using something to expand an EXE upon game startup under Program Files, it won't work. You'll need to rename the EXE extension. Alternatively, you may choose to pause the loading thread and then map the expanded EXE back into your process. If you opt for this strategy, please be aware that if you're a 32-bit process on a 64-bit OS that you'll need to adjust EIP to support the larger PE header.

Desktop Gaming
05-24-2007, 01:55 AM
I've just gone through Vista compatibility stuff to get my game into Portals.

Bottom line.

1. You can install your game to Program Files.

2. If your game unpacks resources to HD, this must be done at install time - not runtime.

3. Do not save game data into the Program Files directory. Attempts to do this get redirected to VirtualStore - this is for backwards compatibility only and should not be used for new releases.

4. Save your game data to C:\Users\<username>\<game folder>\. You can get this path by calling WinAPI's SHGetSpecialFolderLocation() with CSIDL_LOCAL_APPDATA (which returns C:\Users\<username>, so just add your game folder onto the end).

frozax
05-24-2007, 02:31 PM
3. Do not save game data into the Program Files directory. Attempts to do this get redirected to VirtualStore - this is for backwards compatibility only and should not be used for new releases.


Are there similar constraints about accessing the registry? I used to save data in a HKCU/Software folder. Is it still allowed / possible?

Desktop Gaming
05-24-2007, 02:47 PM
Are there similar constraints about accessing the registry? I used to save data in a HKCU/Software folder. Is it still allowed / possible?
Not sure about that - I'm not one for using the registry. I find INI/bespoke config files to be more manageable.

I have it on good authority that you should under no circumstances try writing to HKLM (again, these attempts get sent to a VirtualStore). As for HKCU - I honestly don't know. Checking through the specs I have, there are no notes concerning HKCU so I'd *guess* its OK, but don't quote me.

jlv
05-24-2007, 08:03 PM
4. Save your game data to C:\Users\<username>\<game folder>\. You can get this path by calling WinAPI's SHGetSpecialFolderLocation() with CSIDL_LOCAL_APPDATA (which returns C:\Users\<username>, so just add your game folder onto the end).

Anyone know why Microsoft didn't just set the environment variable HOME to the user's home directory like on unix?

Pallav Nawani
05-26-2007, 02:00 AM
Are there similar constraints about accessing the registry? I used to save data in a HKCU/Software folder. Is it still allowed / possible?

Yes.
You could use HKCU/Software/CompanyName/GameName etc.

frozax
05-26-2007, 06:13 AM
Oh, and in my previous games, to avoid people trying to mess up with the save game or their computer's date to crack the time limit of the demo, I saved a small binary file in the windows directory. I suppose I won't be able to do that anymore. Do you know if there's an "allowed hidden location" for such things?
(I guess I'll have to buy a copy of Vista :( )