burnersk
Posts: 43
Joined: Mon Mar 25, 2019 12:26 pm

Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

I discover critical errors when trying to use (any) PowerShell custom actions when the application is configured to be installed "Per-User only".

See the project file:
Your Application.aip
Advanced Installer project
(14.08 KiB) Downloaded 267 times
I receive the following error:
Error calling MSI API: 1627 Method: MsiViewExecute Table: Property. Extended Error: 1: 2210 2: C:\Users\MyUser~1\AppData\Local\Temp\BUI37E9.tmp\ps-5FD7.msi 3: 0.
When I change "Package type" with "Install Parameters" to "Per-machine only" it works, when I change it back to "Per-user only" it crashes. Also the MSI build crashes when executed.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

Hello,

Thank you for the provided file.

I have tested it and everything works as expected for me:
PowerShell.png
PowerShell.png (185.91 KiB) Viewed 7309 times
I just downloaded the project, built and ran it. Is there anything that I am missing here?

Also, have you tried testing this on multiple machines? If so, does it reproduce on every machine?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
burnersk
Posts: 43
Joined: Mon Mar 25, 2019 12:26 pm

Re: Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

Hi Catalin,

I just tried it on a different system (hardware, Windows 10 build) and I still can reproduce it.

My first assumption was DOS file/folder name length restrictions (e.g. "MyUser~1" vs "MyUserAccount"), but I just have reproduced it without hitting this limitation. Now the error message does not contain any "~" file/folder truncation. So this seems to be a dead end.

The erroneous behavior is the same as on the first machine where I have discovered this issue.
  • "Per-user only": error
  • "Per-user only (with admin rights)": success
  • "Per-machine only": success
  • "Per-machine if user is admin ...": success
  • "Per-user only" with "Run as administration" checked: error
Advanced Installer Version 16.6.1 with an activated Professional license. Windows 10 Pro Version 1909 Build 18363.535, Region Germany, Language English (USA), PowerShell Version 5.1.18362.145, Bitdefender Total Security. The other system is a Windows Pro Version 1809 Build 17763.864, Region Germany, Language German (Germany), PowerShell Version 5.1.17763.771, McAfee VirusScan Enterprise.

I click "Test script" with "Custom Actions" > "PowerShellScriptInline".
Image 1.png
Image 1.png (96.44 KiB) Viewed 7306 times
burnersk
Posts: 43
Joined: Mon Mar 25, 2019 12:26 pm

Re: Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

Hi Catalin,

I never have build the actual setup. The setup seems to work, but the "Test script" button does not work when "Per-user only" install type condition applies.

PS: I mentioned that the MSI also crashes, this was due to a typo that I have fixed, and then only tested with "Test script" button.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

Hello,

First of all, please accept my apologies for such a delayed reply but we had some days off due to holidays and New Year's, therefore I was not able to followup on this.

I have tested this now and I can indeed confirm that I was able to reproduce it. At first, I thought that you meant the script fails at run time, not by using the "Test Script" functionality.

To be fully honest with you, I can not say for sure why this happens. Most probably, this is an issue in what regards the "Test Script" functionality. I have reported it to the development team and hopefully this will be fixed in a future version of Advanced Installer. Thank you for bringing this to our attention.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
burnersk
Posts: 43
Joined: Mon Mar 25, 2019 12:26 pm

Re: Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

Thanks, Catalin. Hope you had nice vacation.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

You are always welcome!

It was, indeed.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

Hello,

This has been fixed in version 16.8 of Advanced Installer, released on February 18th, 2020.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Running PowerShell inline script causes errors (1627, 2210) when installed "Per-User only"

You are always welcome.

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

Return to “Common Problems”