October 18, 200619 yr In the main directory of FSX resides the scenery.cfg file which contains information for FSX about where to find the scenery files located on the computer. I manually added a few entries of my own and started FSX. I discovered that FSX didn't notice the changes and loaded the scenery as it were before I made the changes. Upon investigation, I discovered a second scenery.cfg file located in the "Documents and SettingsAll UsersApplication DataMicrosoftFSX" folder.What I'd like to know is how FSX knows to look in this location rather than in its own directory for the scenery.cfg file. The SDK seems to omit the fact that the scenery.cfg file can reside in other locations. Any help would be appriciated, thank you.
October 18, 200619 yr Hey Joshua,I believe you will find that the scenery.cfg that actually means anything to FSX is located in the C:Documents and SettingsAll UsersApplication DataMicrosoftFSX folder. At least that is where it is on my system. I have no clue what the cfg. file in the FSX folder does now, but I do no it has absolutely no effect on the sim. The one in the Documents and Settings folder does.
October 18, 200619 yr Yes, I already know that "Documents and SettingsAll UsersApplication DataMicrosoftFSX" is the location of the *REAL* scenery.cfg but what I want to know is how FSX knows to look in that location. I'm concerned that if I create a program to edit the scenery.cfg file, it won't work on non-english versions of Windows XP.
October 18, 200619 yr Moderator Joshua, FSX will always look in that folder. Originally, ACES had planned to have a separate scenery.cfg for each user......thankfully quite a few of us convince them that would be a "bad idea..." ;)The copy in the FSX root folder is simply a "template" in case a new one ever needs to be autobuilt. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
October 18, 200619 yr If you need to programmatically access any of the fsx files located in the users documents and settings folders, you can use the %APPDATA% and %USERPROFILE% environment variables, as well as the %ALLUSERSPROFILE% variable to access the allusers folders.In a default WinXP installation, %USERPROFILE% translates to "C:Documents and Settings"%APPDATA% translates to "C:Documents and SettingsApplication Data"%ALLUSERSPROFILE% translates to "C:Documents and SettingsAll Users"Using these variables ensures that your program does not need to know the literal location of the above folders, and will work no matter where the OS is installed.If you wanted to access the scenery.cfg file located in the All Users profile, you would use the path:%ALLUSERPROFILE%Application DataMicrosoftFSXscenery.cfgIf you wanted to access the fsx.cfg file you would use:%APPDATA%MicrosoftFSXfsx.cfgOr:%USERPROFILE%Application DataMicrosoftFSXfsx.cfgI'm sure that FSX uses these same variables to figure out where to put the user files.Regards,...jim
October 18, 200619 yr Thank you, Jim! Your method is great in that it doesn't require a program to access the registry and I believe that'll be invaluable to anyone who's wanting to programmatically get to the scenery.cfg or fsx.cfg files.After I submitted the original posting above, I did some additional searching and found that it's also possible to programmatically find the All Users directory by retrieving two registry values. Here's the KB article from Microsoft Support which indicate the specific registry keys to use for retrieving the two values: http://support.microsoft.com/kb/214653 (Note: The KB article itself is for modifying those particular keys but all we're after here is to just read from those particular keys)Which ever method is used, the results will be the same: access to the All Users profile regardless of which language version of Windows XP (or Vista) is installed.
Create an account or sign in to comment