SYSTEM user cannot run the ADD-APPXPACKAGE command
We developed an application in Xamarin.Forms creating the Android and UWP project.
We generated a package installer, which basically executes the following command via powershell:
-ExecutionPolicy Bypass Add-AppxPackage -Path "C:\Dir1\Dir2\Dir3\Windows\App.UWP_2.0.27.0_x64.msixbundle" -DependencyPath "C:\Dir1\Dir2\Dir3\Windows\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx", "C:\Dir1\Dir2\Dir3\Windows\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx", "C:\Dir1\Dir2\Dir3\Windows\Dependencies\x64\Microsoft.UI.Xaml.2.4.appx", "C:\Dir1\Dir2\Dir3\Windows\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx"
However, who calls the execution of powershell is a service that we have in the environment, as an orchestrator. This service is executed with the SYSTEM user, therefore, the powershell also executes the command using the SYSTEM.
Our problem is that, when executed in this way, we receive the return:
ERROR: Output of the installation process: Add-AppPackage: Deployment failed with HRESULT: 0x80073CF9, Installation failed. Contact the supplier
software. (Exception from HRESULT: 0x80073CF9)
Add deployment operation rejected in package CodeWith7-CodeWith4-CodeWith4-CodeWith4-CodeWith12_2.0.27.0_neutral_ ~ _3kncj78a7wnxj
from: App.UWP_2.0.27.0_x64.msixbundle installation request because the Local System account does not have
permission to perform this operation.
If we manually change the user who runs the service that calls the PS to a local ADM user, we do not have this error, but we have a business need to maintain the use of the SYSTEM user for the orchestrator.
We would like to know if it is possible to carry out this installation in a way that does not require the use of a local ADM and if not, would you know how to tell us the reason so that we can align with the customers who will use the solution?