aferentsbtv
Posts: 2
Joined: Wed Jul 06, 2022 7:26 am

Custom Action Run Powershell script: script Not Found

Hi guys, i'm trying to run powershell script during installation as a custom action and receiving error
Return code: -1

Script output: "[ERR] Could not find source script file!"

here is my custom action config and file and folders structure.
adv1.jpg
adv1.jpg (166.22 KiB) Viewed 1609 times
adv2.jpg
adv2.jpg (193.71 KiB) Viewed 1609 times
so i want to run alg_install.ps1 which is in temp folder, this script should install python wheel.

after i press Test Script i get next error.
adv3.jpg
adv3.jpg (65.82 KiB) Viewed 1609 times
i'm using Enterprise license

thanks in advance for any help.
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action Run Powershell script: script Not Found

Hello and welcome to our forums,

Most likely, your PowerShell script refers some items that can not be found when you test it. The "test" functionality is not really for scripts like yours, that install something.

However, this should work when the custom action is executed (when the setup is run).

Please note, however, that you have not added your file as a temporary file.
Unlike Advanced Installer's regular files or resources, "Temporary Files" are copied on the target machine at the beginning of the installation and are deleted at the end of it, ensuring you have access to them throughout the entire install process.
As you can see in the article I've linked above, temporary files have a specific icon.

Now this depends on when you want to execute the PowerShell script. For instance, if you want to execute it towards the end of the installation, there's no need to add your script as a temporary file.

One thing to be kept in mind here is the fact that two installation processes can not be run at the same time on the same computer. This is a limitation of the Windows OS.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aferentsbtv
Posts: 2
Joined: Wed Jul 06, 2022 7:26 am

Re: Custom Action Run Powershell script: script Not Found

Thanks for the reply.
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action Run Powershell script: script Not Found

You are always welcome!

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

Return to “Building Installers”