PDA

View Full Version : FSX Installation folder detection


Jorge Santoro
27 Mar 2007, 13:12
Hi guys,
Do you know how to detect the FSX installation folder using some REGISTRY entry?

Thank you.
Jorge Santoro.

theisomizer
27 Mar 2007, 16:36
Hello Jorge,

In [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\microsoft games\flight simulator\10.0], look for the SetupPath key.

Happy to help,
Sean

Jetliner
28 Mar 2007, 06:12
Please excuse my ignorance but, I'm looking for the same with regard to the path to the saved flights folder (MyDocuments\Flight Simulator X\).

The thing that throws me is the username. Right now I simply have the user locate the folder via a filelistbox but, that's pretty lame. :)

John

Pete Dowson
30 Mar 2007, 06:37
Please excuse my ignorance but, I'm looking for the same with regard to the path to the saved flights folder (MyDocuments\Flight Simulator X\).

The thing that throws me is the username. Right now I simply have the user locate the folder via a filelistbox but, that's pretty lame. :)

Get the user name via the SHGetFolderPath call with CSIDL_PERSONAL.

Bear in mind also that the folder name is only "Flight Simulator X Files" on English-language FSX installs. Instead of fixing it as that get the proper name from FSX's "language.dll" module using LoadString. The ID is 36864.

Regards

Pete

gadgets
05 Apr 2007, 19:31
The registry key to FSX SetupPath differs when FSX is loaded on a 64-bit Vista machine. It becomes "LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Micro soft Games\Flight Simulator\10.0".

Does anyone know whether the 64-bit Vista key for FS9 is similarly changed and whether the 32-bit version of Vista uses similarly-changed keys or if it uses the XP keys. Same question regarding FS9 UT Canada/Alaska and the UT port to FSX when installed on Vista machines.

Thanks in advance,
Don

Pete Dowson
06 Apr 2007, 15:48
The registry key to FSX SetupPath differs when FSX is loaded on a 64-bit Vista machine. It becomes "LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Micro soft Games\Flight Simulator\10.0".

This sounds worrying, as it will affect every installer for FS applications there is, including mine for FSUIPC4.

I asked a contact in Microsoft about this and the answer, which I don't fully understand, was:

32-bit code on Win64 writes to a 32-bit portion of the registry (like the Program Files/Program Files (x86) split). Eula.dll writes that key when the user clicks Accept. FSX is 32-bit so it reads from that node when reading from HKLM. The only problem is if 64-bit code went looking for the key. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/registry_key_security_and_access_rights.asp for details.


I've not checked the reference (maybe I won't understand that either), but it seems to me that the bit "FSX is 32-bit so it reads from that node when reading from HKLM. The only problem is if 64-bit code went looking for the key." might imply that Vista 64 fiddles the access according to whether you are a 32-bit or 64-bit app, and that the Wow6432Node part is dealt with automatically, at least for a 32-bit app.

Is this right? Does anyone have 64-bit vista installation to check?

Regards
Pete

theisomizer
06 Apr 2007, 18:24
Pete,

I have access to Vista 64. I don't have it installed on anything yet but I have been meaning to give it a test drive soon anyways. I have the next four days off so I'll get it up on Virtual PC and see what gives.

I sure hope he isn't right about the registry, as it would make the app I'm currently working on crash pretty violently. Time to write some error checking code! :duck:

Sean