Forum Discussion

Skinheed's avatar
Skinheed
Copper Contributor
May 10, 2021
Solved

Issues with PowerShell start and end scripts

I think there is a problem with the PSFLauncher.exe. It appears to be using the working directory of the application shortcut to find the StartingScriptWrapper.ps1. This is breaking PowerShell suppor...
  • Bogdan Mitrache's avatar
    May 13, 2021

    Hi Skinheed 

     

    I am Bogdan, from the Advanced Installer team. Thanks for reporting this issue. Just wanted to let you know that until a fix is included by MSFT in the official PSF repo we will include a custom fix directly inside our next version.

     

    Until then, you have a workaround in Advanced Installer:


    Advanced Installer allows you to update the working directory and application parameters (that you would usually specify in the "Application Details" view) directly from the PS1 script.

    For your scenario, please follow these steps.

    1. Go to "Application Details > Working directory" and make sure this field (Working Directory) is empty.
    2. Use a PS script that updates the Working directory, attached is a sample.

    This sample PS script (from the attached zip) updates the Working directory to the first argument it receives (its value should be relative to APPDIR).

    IMPORTANT, when using the above script:

    1. change the script to include your own ApplicationID.
    2. set the desired working directory path (relative to APPDIR) in the 'scriptArguments' field.
      The Working Dir argument can also be changed directly from inside your PS1 script, if you wish to hardcode it inside the script.
    3. set the 'waitForScriptToFinish' field to 'true'

      Let me know if this helps.

Resources