Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete / others,

Is there a way, through fsuipc, to tell which fs9.cfg is being used by fs9? On a Win 2000/XP machine each "username" has it's own fs9.cfg.

Also: can fsuipc tell me where is it located? I'm quite sure it's always here:

n:\Documents and Settings\ray\Application Data\Microsoft\FS9

but which drive is n?

I could figure it out with my VB6 app, just thought it may be possible with fsuipc.

Thanks,

Ray

Posted

Is there a way, through fsuipc, to tell which fs9.cfg is being used by fs9? On a Win 2000/XP machine each "username" has it's own fs9.cfg.

Not through FSUIPC , no. I do locate the place where user flights and plans are stored in AUTOSAVE.DLL, but that isn't the same, though presumably both use the current username.

If you are trying to do this programmatically look at the SHFOLDER API, and SHGetFolderPath specifically.

Regards,

Pete

  • 8 months later...
Posted

Sorry to drag up an old topic, but while trying to get the current FS9.CFG I noticed it isn't always so trivial:

- The path is correct as you say in the users profile

- The name however can be different:

> if you create a different FS9.EXE-File (say fs9a.exe), it will use the matching CFG-File (fs9a.cfg)

> also if you start the FS9.EXE with the parameter /CFG:xxx it will use this CFG-File

> and then, as if that wasn't enough, if you use a german FS9, it will use "Anwendungsdaten" instead of "Application Data"

Does anyone know how to find out which file the FS is currently using? I have heard this is also different in FS2002, does anyone know how it is there?

It would be really great to be able to read the current settings :))

Thanks

John

Posted

if you create a different FS9.EXE-File (say fs9a.exe), it will use the matching CFG-File (fs9a.cfg)

That sounds very useful. Thanks.

also if you start the FS9.EXE with the parameter /CFG:xxx it will use this CFG-File

Yes, that's actually been a facility in most recent versions of FS. I documented it in the FSUIPC Advanced user's guide in the section about multiple INI installations.

and then, as if that wasn't enough, if you use a german FS9, it will use "Anwendungsdaten" instead of "Application Data"

Is that down to the German FS9 or the German operating system? The "Application Data" sub-folder is used by many programs, not just FS9. I think this part of the path is one of those available through the "SHFolder" API -- there's a constant defined for the API to get a system path as follows:

CSIDL_APPDATA (0x001a)

The file system directory that serves as a common repository for application-specific data. A typical path is C:\Documents and Settings\username\Application Data. This CSIDL is supported by the redistributable Shfolder.dll for systems that do not have the Microsoft® Internet Explorer 4.0 integrated Shell installed.

Does anyone know how to find out which file the FS is currently using?

You can get the path as above. Except for the /CFG: option, you can get the name from the Process EXE name. I'm afraid I don't really know how to track down the use of the /CFG: option.

I have heard this is also different in FS2002, does anyone know how it is there?

In all versions before FS2004 the CFG file is in the main FS path.

Regards,

Pete

Posted

Thanks for your quick answer, Pete!

...That sounds very useful. Thanks.

That's what I thought as well :) - now I have a photo-scenery-CFG and a normal one.

Is that down to the German FS9 or the German operating system?

Oops, my bad, I just noticed that it is based on the operating system, i.e. I can get the path the way you described. Too many test-computers...

You can get the path as above. Except for the /CFG: option, you can get the name from the Process EXE name.

Can I get the process exe-name from outside of the FS (i.e. I'm running as an external program with access to FS through FSUIPC)? Or would it be easier to enumerate the process list and check for matching EXE-Files?

I'm afraid I don't really know how to track down the use of the /CFG: option.

Do you think there's a way to get at the name from outside of the FS? Otherwise I'll have the user confirm the correct CFG-File, if there are mutliple files in the path (now that I have the path ;)).

The real reason I'm interested in the FS9.CFG-File is to read the following settings: Crash-Detection, Stress-Detection, Real-Weather activated. Just checking (the last time I found them here in the forum, these settings were not readable), these settings still aren't readable throught FSUIPC, correct? (If I could get at the FS9.CFG then that wouldn't be a problem ;)).

Thanks for your time, Pete!

John

Posted

Can I get the process exe-name from outside of the FS (i.e. I'm running as an external program with access to FS through FSUIPC)? Or would it be easier to enumerate the process list and check for matching EXE-Files?

As long as you are on the same PC, your access to FSUIPC means you already have a Window handle owned by the process. Or even without FSUIPC you just need to find the top level window with class name "FS98MAIN" (they are all called that no matter which version!). Once you have the Window handle I think you can find the process name (probably full path name) easily enough.

Regards,

Pete

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.