ammits
Posts: 7
Joined: Fri Dec 09, 2022 4:23 pm

Powershell Script don't run during installation Windows 10 LTSB2016 (IOT), Manually it's OK.

Dear all,

I've the Problem that i've to publish an Installer Package, in which we has some Settings and Files to deliver.
On Win10 LTSC2021, the script works flawless directly, when i use Custom Actions and let the Script from File execute.

On Win10 LTSB2016, it don't works from the custom actions. It will not run and in Eventviewer you see the Package was installed with code 0 whichi means success.
But if i trigger it manually from the powershell commandline it runs without any problems...

For me it's a problem, i had to publish versions with a wider Support from Win LTSB2015 - LTSC2021 and Windows Server 2012R2 - 2022.

Actually i only know it works with Win10 LTSC2021 and Windows Server 2022, the LTSB2016 NOT Working, the others are not already tried because of priority...

Can i give you some additional Informations to face down the problem?

Thanks,
Markus
ammits
Posts: 7
Joined: Fri Dec 09, 2022 4:23 pm

Re: Powershell Script don't run during installation Windows 10 LTSB2016 (IOT), Manually it's OK.

I forget to say which version i use, it's the 21.5.1 .

Thanks
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Powershell Script don't run during installation Windows 10 LTSB2016 (IOT), Manually it's OK.

Hello Markus,

If the script is not running, I would advise checking the execution policy set on that LTSB2016 machine.

To do so, you can open a PowerShell and then run the following cmdlet: Get-ExecutionPolicy.

For more information about execution policies, please refer to the following article: about_Execution_Policies
But if i trigger it manually from the powershell commandline it runs without any problems...
Could you please give me some more details here? Is the PowerShell script working or the installation package?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ammits
Posts: 7
Joined: Fri Dec 09, 2022 4:23 pm

Re: Powershell Script don't run during installation Windows 10 LTSB2016 (IOT), Manually it's OK.

Thanks for your reply, now it seem a bit different than in the title or described.
We had after i opened this post some changes which i have to integrate in the script and after that it's also not seems be executed on LTSC2021.
The cause is, that in some situation the custom action for the PowerShell file, even if you set it NOT to auto, you set it to 64bit, it triggers the 32Bit Powershell executable, which for most scripts i know not work...

You can see this, when you open a process monitor, than it's 32Bit PowerShell used, when "nothing" happens...

Now i use a workaround and trigger the PowerShell Script over a Launchfile...
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Powershell Script don't run during installation Windows 10 LTSB2016 (IOT), Manually it's OK.

Hello Markus,

First of all, I am glad you managed to find a workaround for the issue.

Now, regarding the Powershell script, have you tried setting it as 64-bit? If so, did it help?

Pretty sure that the 64-bit option should launch the 64-bit version of Powershell from the system.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ammits
Posts: 7
Joined: Fri Dec 09, 2022 4:23 pm

Re: Powershell Script don't run during installation Windows 10 LTSB2016 (IOT), Manually it's OK.

Hi Catalin,

After i see what the problem is, i also tested the option to set it to 64Bit option for running the script.
But in my case i had no success. I don't know what's behind your 64Bit option, i think it's not a variable which has the "correct" Path in it...

Regards,
Markus
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Powershell Script don't run during installation Windows 10 LTSB2016 (IOT), Manually it's OK.

Hello Markus,

Thank you once again for the followup on this.

That's really strange, as I've just tested this on a normal Windows VM and it launches the correct 64-bit PowerShell launcher.

It's true, however, that I do not have access to a machine with a Windows like yours and therefore can not really fully test this. :(

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

Return to “Common Problems”