vahid.azizi
Posts: 2
Joined: Tue Oct 07, 2025 6:32 am

Need to get the user-selected installation path ([APPDIR]) before install execution (PowerShell action)

Hello,

I’m developing an installer for a Rhino plugin, and during the installation process, I need to run a PowerShell script that installs another file (“yek.”) on the system.

For this purpose, I need to get the folder path that the user selected during the installation (the destination path).
I’m using the [APPDIR] property to retrieve it, but it always returns the default path C:\Program Files — unless the user manually changes the drive (for example, selects D:). Also, if the user chooses another folder inside the C: drive, it still returns the same default C:\Program Files path instead of the selected subfolder.

My PowerShell custom action runs after the system has been successfully modified, but I still need to know the correct user-selected [APPDIR] value at that point.

How can I correctly get the actual installation path selected by the user during setup?

Thank you in advance for your help!

Best regards,
Vahid
Catalin
Posts: 7504
Joined: Wed Jun 13, 2018 7:49 am

Re: Need to get the user-selected installation path ([APPDIR]) before install execution (PowerShell action)

Hello Vahid,
I’m using the [APPDIR] property to retrieve it, but it always returns the default path C:\Program Files — unless the user manually changes the drive (for example, selects D:). Also, if the user chooses another folder inside the C: drive, it still returns the same default C:\Program Files path instead of the selected subfolder.
When do you execute the PowerShell script?

Please make sure that it is scheduled after the dialogs are displayed and that folders are resolved. Ideally, that should be after "Paths Resolution" action group.

If you still encounter issues with this, please provide a sample project that reproduces this (or a test-case) so I can run some tests on my end.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
vahid.azizi
Posts: 2
Joined: Tue Oct 07, 2025 6:32 am

Re: Need to get the user-selected installation path ([APPDIR]) before install execution (PowerShell action)

Catalin wrote: Tue Oct 07, 2025 8:49 am Hello Vahid,
I’m using the [APPDIR] property to retrieve it, but it always returns the default path C:\Program Files — unless the user manually changes the drive (for example, selects D:). Also, if the user chooses another folder inside the C: drive, it still returns the same default C:\Program Files path instead of the selected subfolder.
When do you execute the PowerShell script?

Please make sure that it is scheduled after the dialogs are displayed and that folders are resolved. Ideally, that should be after "Paths Resolution" action group.

If you still encounter issues with this, please provide a sample project that reproduces this (or a test-case) so I can run some tests on my end.

Best regards,
Catalin
Hi Catalin,

Yes, I had the same assumption. I also thought the issue might be related to when the PowerShell action is executed.

I’ve tested it in multiple stages — including during the UI sequence and in several places inside the Install Execution Stage (even after Paths Resolution).
Just to be sure, I even tried running the PowerShell script after pressing the “Finish” button at the end of the installation, but the problem still persists.

The [APPDIR] property always returns the default C:\Program Files... path, unless I change the drive (for example to D:).
If I stay on the C: drive but select a different folder, it still gives me the default path.
Only when I switch to another drive does [APPDIR] return the correct value.

Do you have any idea what could cause this behavior?

I’m currently quite busy, but if you need it, I can prepare and send you a sample project in the next couple of days.
Catalin
Posts: 7504
Joined: Wed Jun 13, 2018 7:49 am

Re: Need to get the user-selected installation path ([APPDIR]) before install execution (PowerShell action)

Hello Vahid,
I’m currently quite busy, but if you need it, I can prepare and send you a sample project in the next couple of days.
Please do, as this behavior is not normal and I suspect it has to do with a misconfiguration on your end.

Without being able to see the AIP file options and run some tests on my end, it'd be hard for me to say why this is happening.

Take your time with the sample project, there's no rush. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”