So during our install process we have a custom action. This custom action is a powershell script that runs that uses $PSScriptRoot to help with pathing. So the directory structure during install looks like this:
C:\Users\<user>\AppData\Local\Temp\custom_stuff\script.ps1
Now script.ps1 references files in a subfolder:
C:\Users\<user>\AppData\Local\Temp\custom_stuff\additional_files
The issue we are running into is that Advanced Installer is copying script.ps1 to a temp file in C:\Users\<user>\AppData\Local\Temp and then running it which obviously changes the $PSScriptRoot and breaks access to the addtional_files path. Now I know I could hard code the `custom_stuff` folder in the powershell script but we also run this script outside of using the advanced installer application.
So i guess my question is, is there any way to get Advanced Installer to not create a temporary copy of the powershell script that its executing at the level of C:\Users\<user>\AppData\Local\Temp and just run the script in the folder from disk or is there any other way in which I can call my script where the path doesn't end up breaking?
TIA, Peter