OK so SHGetSpecialFolderLocation works on 98, I just hope that the same constants all exist.
As for not using Common_AppData then where will you put a High Score table that can be written and read by everyone? I think you are supposed to put it there and use JazzieB's permissions code, OR I guess create an empty high-score table and use an installer script that does it for you. But I'd rather make the high score and settings files the first time the game is run and set the permissions then. This ensures that if portals package your game it will work and they don't need to do anything unusual with the installer (i.e. time wasted by both parties)
Btw, for JazzyB, from MSDN "Virtualization will be removed from subsequent versions of Windows so it important not to rely on this feature"
Also "Note that if UAC is disabled, then virtualization is also disabled. If virtualization is disabled, standard user accounts behave exactly like limited user accounts in Windows XP, and legacy applications may not function correctly for standard users that would otherwise have succeeded due to virtualization."
Basically the new methods need to be embraced, sigh.
Also there's this whole "Application Manifest" issue. And that if you make one of those and declare your app's execution level in it, then Vista won't use Virtualisation. But what the hell is an Application Manifest and how do you make it anyway. Perhaps BMax should make one by default now?
Source: http://msdn2.microsoft.com/en-us/library/bb206295.aspx
Thread1: http://forums.indiegamer.com/showthread.php?t=9781
Also: http://msdn.microsoft.com/msdnmag/issues/07/01/uac/
In that third article it says:
"Sometimes, as when you're storing high scores for a game, you need to maintain system-wide state and allow users to write to it. The recommended place to store this data is in the %allusersprofile% directory. Here you can create a directory specific to your application and allow users to write to it. Just remember, other users can tamper with this file."
Does this mean that if you put a file in allusersprofile as an administrator, that a standard user can a) read it and more importantly b) WRITE to it? (i.e. without running any code to sett access to EVERYONE)
Tim and GFK: Perhaps you could test the above manually by making a text file in the all users folder and then changing user and trying to write to it?
It also says this about user preferences/settings:
"When you design your application, there will likely be some application settings you'll want applied for the user. Perhaps the users specify custom information about how their views are shown or which menus are displayed. A good way to provide this facility is to create a default template under the Program Files directory, then copy and modify it in the user's AppData directory, %localappdata%. This data can be copied at first run of your application and enables per-user state for each user. If, on the other hand, you want machine-wide state that individual users can modify, you would want to put this in the %allusersprofile%, as in the high scores example mentioned earlier."
So localappdata is best for user save games etc like you said GfK.
Some we are getting somewhere ...
so Ironic the title of this thread :-D
As for not using Common_AppData then where will you put a High Score table that can be written and read by everyone? I think you are supposed to put it there and use JazzieB's permissions code, OR I guess create an empty high-score table and use an installer script that does it for you. But I'd rather make the high score and settings files the first time the game is run and set the permissions then. This ensures that if portals package your game it will work and they don't need to do anything unusual with the installer (i.e. time wasted by both parties)
Btw, for JazzyB, from MSDN "Virtualization will be removed from subsequent versions of Windows so it important not to rely on this feature"
Also "Note that if UAC is disabled, then virtualization is also disabled. If virtualization is disabled, standard user accounts behave exactly like limited user accounts in Windows XP, and legacy applications may not function correctly for standard users that would otherwise have succeeded due to virtualization."
Basically the new methods need to be embraced, sigh.
Also there's this whole "Application Manifest" issue. And that if you make one of those and declare your app's execution level in it, then Vista won't use Virtualisation. But what the hell is an Application Manifest and how do you make it anyway. Perhaps BMax should make one by default now?
Source: http://msdn2.microsoft.com/en-us/library/bb206295.aspx
Thread1: http://forums.indiegamer.com/showthread.php?t=9781
Also: http://msdn.microsoft.com/msdnmag/issues/07/01/uac/
In that third article it says:
"Sometimes, as when you're storing high scores for a game, you need to maintain system-wide state and allow users to write to it. The recommended place to store this data is in the %allusersprofile% directory. Here you can create a directory specific to your application and allow users to write to it. Just remember, other users can tamper with this file."
Does this mean that if you put a file in allusersprofile as an administrator, that a standard user can a) read it and more importantly b) WRITE to it? (i.e. without running any code to sett access to EVERYONE)
Tim and GFK: Perhaps you could test the above manually by making a text file in the all users folder and then changing user and trying to write to it?
It also says this about user preferences/settings:
"When you design your application, there will likely be some application settings you'll want applied for the user. Perhaps the users specify custom information about how their views are shown or which menus are displayed. A good way to provide this facility is to create a default template under the Program Files directory, then copy and modify it in the user's AppData directory, %localappdata%. This data can be copied at first run of your application and enables per-user state for each user. If, on the other hand, you want machine-wide state that individual users can modify, you would want to put this in the %allusersprofile%, as in the high scores example mentioned earlier."
So localappdata is best for user save games etc like you said GfK.
Some we are getting somewhere ...
so Ironic the title of this thread :-D