P3D v4 Installer cannot find P3Dv4 installation despite using correct path?

I am beta testing my installer and I am using the Windows registry AppPath key to check if P3Dv4 is indeed installed. I am using:

HKEY_CURRENT_USER\Software\Lockheed Martin\Prepar3d v4
Key=AppPath

which I read here seems to be the standard way to check. My installer works fine with my testers except one. He installed his P3Dv4 at:

'C:\Program Files\Lockheed Martin\Prepar3D v4\'

and my installer gives an error message that P3Dv4 cannot be found? My code to check is fairly simple (PowerShell):

If ((AI_GetMsiProperty CHECKBOX_P3DV4_PROP -eq "CheckBox") -and (AI_GetMsiProperty P3DV4_INSTALL_PATH -eq ""))

basically says if the P3Dv4 checkbox is 'checked' and the AppPath is "empty" then it will throw the error. But his AppPath is not empty. Could it be some Windows security preventing the installer to check?

On a side note, I tried re-creating the issue on my PC and discovered I cannot create a folder in my C:\Program Files folder? I get 'Access is denied' and I'm the Aministrator. Same issue? .... HELP! :eek:
 

Christian Bahr

Resource contributor
Hi.

In all my projects I use these options:

installer_p3dv4_path.jpg


I need the path to start the Prepar3d.exe with certain options. As a result, the scenery is automatically registered as an add-on package in the P3Dv4. The installer itself runs as a 64-bit application. Maybe that helps a little further.
 
Hi Christian and thanks for the tips. I will look into these. You say your installer runs as a 64bit program. What if the User has a 32bit OS? Conflict?

Oooops... think I answered my own question. How could it install P3Dv4 is the OS is NOT 64bit, ha!
 

Christian Bahr

Resource contributor
You say your installer runs as a 64bit program. What if the User has a 32bit OS? Conflict?
Oooops... think I answered my own question. How could it install P3Dv4 is the OS is NOT 64bit, ha!
Exactly. For the FSX, I continue to use a 32-Bit installer, because the FSX is a 32-bit application.
 
Christian, changed my HKEY_CURRENT_USER to HKEY_LOCAL_MACHINE like yours and added the "search the 64 bit portion of the registry" still no luck. It sure seems like Windows protection is causing this as I had him create a fake P3Dv4 folder outside the C:\Program Files and had him change AppPath (SetupPath) to match the fake folder location and my installer found it. He says other 3rd-party add-ons have add no issues installing?

Any other suggestions you might have? Head scratcher???
 

Christian Bahr

Resource contributor
Maybe I should have written that my installer does not refer to the P3D as the installation location, but always suggests an installation location outside the P3D (C:\Program Files\Bahrometrix\xxx). The installation location itself is freely selectable.

I only need the registry path to locate the Prepar3D.exe. If the Prepar3D.exe was found (Custom Search), then it is executed together with command line parameters (Custom Action) to automatically register the corresponding addon at the end of the installation as an add-on package in the Sim.

So my intention is a little different from what you have in mind. You want to install your add-on into the P3D, I suspect.
 
I see what you are doing. While the User can install the add-on anywhere they like, portions of the install do get added inside P3D. Actually, the user can install up to six different platforms at one time if they wish, so I need to know where those FS versions are rather than have them enter manually. Mmmmmmm.... not sure why/how other addons can get past it but I cannot. Thx for the help. I will keep researching.
 
Yes, he is always running as Administrator. I am having him try turning off Windows Defender during install. He says he has installed A2A, MilViz and Just Flight in the past with no issues. He wasn't sure if thier installers check for installed paths or ask him to insert the path of his P3Dv4. I'm think contacting them to see if they have had any User issues in the past that install to C:\Program Files.
 

Christian Bahr

Resource contributor
I just remember that Installer depending on whether you are logged in as Administrator or as a user in Windows.

installer_installation_type.jpg
 
Hey Bill, I see in your sig you've done work on Milvis. Since my tester has installed Milviz in the past do you happen to know if you use HOTKEY_CURRENT_USER or HOTLEY_LOCAL_MACHINE to find an installation? Would it be helpful for me to find out what aircraft of Milviz he has?
 

n4gix

Resource contributor
Hey Bill, I see in your sig you've done work on Milvis. Since my tester has installed Milviz in the past do you happen to know if you use HOTKEY_CURRENT_USER or HOTLEY_LOCAL_MACHINE to find an installation? Would it be helpful for me to find out what aircraft of Milviz he has?
All of the Milviz installers are built with NSIS (Nullsoft Scriptable Install System). Here is the list of paths we search for to determine what versions of the sim the user current has installed. From the returns, we then build the "choice list" dynamically.

Note that we look in HKey Current User, except for FSX which is checking for HKey Local Machine:
C-like:
        ${If} $RadioButton6_State == 1
              ReadRegStr $INSTDIR HKLM "Software\Microsoft\Microsoft Games\flight simulator\10.0" SetupPath
        ${EndIf}

        ${If} $RadioButton2_State == 1
              ReadRegStr $INSTDIR HKCU "Software\Microsoft\Microsoft Games\flight simulator - steam edition\10.0" AppPath
        ${EndIf}

        ${If} $RadioButton3_State == 1
              ReadRegStr $INSTDIR HKCU "Software\LockheedMartin\Prepar3D v2" AppPath
        ${EndIf}

        ${If} $RadioButton4_State == 1
              ReadRegStr $INSTDIR HKCU "Software\Lockheed Martin\Prepar3D v3" AppPath
        ${EndIf}

        ${If} $RadioButton5_State == 1
              ReadRegStr $INSTDIR HKCU "Software\Lockheed Martin\Prepar3D v4" AppPath
        ${EndIf}
 
An update/FYI - looks I was able to fix the tester who had his P3Dv4 in the C:\Program Files folder (beta testing). For FSX, I was gonna try your suggested HOTKEY_LOCAL_MACHINE instead of HOTKEY_CURRENT_USER and discovered this... I have no Microsoft Games entry under HOTKEY_LOCAL_MACHINE?

I did a fresh install of both FSX (boxed Gold Edition), and FSX:SE on Windows 10 but not entries under HOTKEY_LOCAL_MACHINE, only under HOTKEY_CURRENT_USER. I think I fixed it with HOTKEY_CURRENT_USER (again testing) but I thought that strange maybe?
 

n4gix

Resource contributor
I checked in a somewhat newer installer script and note that I did in fact change FSX to look in HKCU as well now:

ReadRegStr $R0 HKCU "Software\Microsoft\Microsoft Games\flight simulator\10.0" "AppPath"
 
Top