• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 SetupPath key for P3Dv4 installer?

spotlope

FSDevConf team
Messages
346
Country
portugal
I have never had an issue with this before, but for some reason I can't find the Windows registry key for the Prepar3D v4 setupPath (or appPath). I'm trying to update some installers for the new sim, but this has me stumped. Has anyone already accessed the new key and been able to get the path to the root P3D4 folder? If so, I'd love to know where it can be found.
 
Messages
611
Country
switzerland
Hey Bill,

Since P3Dv4 is now a 64-bit app, the registry entries will not be in the Wow6432Node, but one level up: HKEY_LOCAL_MACHINE\SOFTWARE\Lockheed Martin\Prepar3D v4\SetupPath
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
In NSIS the entry is:
Code:
ReadRegStr $R0 HKCU "Software\Lockheed Martin\Prepar3D v4" "AppPath"
 
Messages
473
Country
hungary
Hello Guys!

I have the same problem. I know we do not have to find the registry under Wow6432Node. Basically I could find the entries in my registry, I can see them with my bare eyes but eventhough I try to access it I get nothing. Our special activator is written with VBA. Even the ClickTeam's Installer Creator is not working.

Here is the code I use:

Code:
FSrootRegVal = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Lockheed Martin\Prepar3D v4", "SetupPath", Nothing)

Any hint?
 
Messages
473
Country
hungary
Okay, I got it. Instead of the HKEY_LOCAL_MACHINE you have to use the HKEY_CURRENT_USER.
Like this:
HKEY_CURRENT_USER\Software\Lockheed Martin\Prepar3D v4
And it has a different key: AppPath

As n4gix mentioned above me. I just flew over his HKCU.

It is still a mistery why I cannot read the LOCAL_MACHINE because the key is there... But anyway problem is solved.

Thanks!
 
Messages
3
Country
venezuela
Hi, this is my first post here and I just want to contribute..

The "wrong" readings of the registry keys is due to the Registry Virtualization redirections implemented in Vista and later 64bit operating systems.

If you do use Inno Setup, the solution is pretty simple: you can do the query replacing HKEY_LOCAL_MACHINE with HKLM64 which specifies it needs to query the 64bit key tree and not Wow6432node. If you use HKLM or HKEY_LOCAL_MACHINE, Windows will redirect any query to the key tree corresponding to 32bit apps even if you specify that your key to read is not in the Wow6432node.

For example, you can do your query this way:

if RegQueryStringValue(HKLM64, 'SOFTWARE\Lockheed Martin\Prepar3D v4','SetupPath', SimInstallationPath) then
YourVariableToUseLater := SimInstallationPath

Instead of:

if RegQueryStringValue(HKLM, 'SOFTWARE\Lockheed Martin\Prepar3D v4','SetupPath', SimInstallationPath) then
YourVariableToUseLater := SimInstallationPath

Or:
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Lockheed Martin\Prepar3D v4','SetupPath', SimInstallationPath) then
YourVariableToUseLater := SimInstallationPath

Where SimInstallationPath and YourVariableToUseLater are String variables.

I don't know if any other installers have any alternative code to solve this matter, but I think they have their own way to do that.

I hope this information provide some help.

Regards,
Erick
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
If I'm not mistaken, I believe NSIS now supports HKLM64 as well.
 
Messages
69
Country
scotland
Hi all,

I was having the same issue, but am unable to find HKEY_CURRENT_USER\Software\Lockheed Martin\Prepar3D v4 ... "AppPath"

Within HKEY_CURRENT_USER\Software\Lockheed Martin\Prepar3D v4 I have only one variable "Installed" which is a DWORD and is set to 1.

Still puzzled why the HKLM key can't be found, as it IS there!

Regards,

Iain.
 
Messages
3
Country
venezuela
Hi all,

I was having the same issue, but am unable to find HKEY_CURRENT_USER\Software\Lockheed Martin\Prepar3D v4 ... "AppPath"

Within HKEY_CURRENT_USER\Software\Lockheed Martin\Prepar3D v4 I have only one variable "Installed" which is a DWORD and is set to 1.

Still puzzled why the HKLM key can't be found, as it IS there!

Regards,

Iain.

Hi Ian,

Please take a look at the post number #6, it may be helpful to solve your problem. Which installer software/scripting are you using?
 
Messages
75
Country
brazil
I'm bumping this because I'm having a strange issue.

I'm trying to get P3Dv4's installation path using NSIS but after testing at three different computers, I got two different results.

Using HKCU "Software\Lockheed Martin\Prepar3D v4" "AppPath" results in a success in one computer. Other two computers aren't having the same luck.
What can cause this difference? using HKLM64 and HKLM doesn't seem to solve either.

Edit: The computer that got the installation path has the P3Dv4 installed on disk C. The other two have P3Dv4 in different disks. Looks like it means something.
What is strange is that when searching for FSX it doesn't cause problems to have it installed on a disk other than the one from Windows. Is P3D different?
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Edit: The computer that got the installation path has the P3Dv4 installed on disk C. The other two have P3Dv4 in different disks. Looks like it means something.
What is strange is that when searching for FSX it doesn't cause problems to have it installed on a disk other than the one from Windows. Is P3D different?

I've not noticed any difference on any of my machines, or those of customers. However, to be on the "safe side" I leave the "Browse" button active to allow customers to choose their own installation path, just in case... ;)

Code:
  !insertmacro MUI_PAGE_COMPONENTS
  !insertmacro MUI_PAGE_DIRECTORY ; UNCOMMENT TO SEE BROWSE BUTTON!
  !insertmacro MUI_PAGE_INSTFILES
 
Messages
75
Country
brazil
Thank you hervesors and Bill!

I'm leaving the option to allow the users to choose their own installation path too. I'll try more to see if I find the cause of this specific problem. NSIS has a command SetRegView that possibly can solve this.

Also thank you Bill for posting about NSIS here on FsDeveloper. I discovered NSIS from your comments and the time spent on the documentation was really worth it :D
 
Messages
75
Country
brazil
Yes, we have it fixed. SetRegView worked.

I just needed to use SetRegView 64 whenever it reads P3Dv4 registries and SetRegView 32 if reading other sims. I'm still searching to find why, as it is not happening for others, but it is working for now.
 
Last edited:
Top