P3D v4 SetupPath key for P3Dv4 installer?

spotlope

FSDevConf team
#1
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.
 
#2
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
#3
In NSIS the entry is:
Code:
ReadRegStr $R0 HKCU "Software\Lockheed Martin\Prepar3D v4" "AppPath"
 
#4
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?
 
#5
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!
 
#6
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
 
#10
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.
 
#11
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?
 
#12
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
#14
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
 
#15
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
 
#16
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