ServiceUI Problems Error 5

I have recently started having problems with the ServiceUI I always get the error:
The exit code is: ======================= Matched Processes ======================= Process Found: [explorer.exe] ID [7076] SESSION [1] ======================= Logon Lookup ======================= [winlogon.exe] Session: [1] PID [696] [Target Session [1] = Match] ======================= Launch Process ======================= Program to launch : [Deploy-Application.exe] Command line : [Deploy-Application.exe] API [CreateProcessAsUser] Error: [5] ======================= Exiting with [-1] =======================

Unfortunately I have no idea what the problem could be.

If you need any more information just ask.

Can you describe how you run ServiceUI, example of a commandline?

$exitcode = .\Invoke-ServiceUI.ps1 -PrcoessName ‘explorer.exe’ -DeploymentType ‘Install’ -AllowRebootPassThru

From the documentation in the file README.md:

Parameters

  • ProcessName
    • Specifies the name of the process check for to trigger the interactive installation. Default value is ‘explorer’. Multiple values can be supplied such as ‘app1’,
      ‘app2’. The .exe extension must be omitted.

Try this:
$exitcode = .\Invoke-ServiceUI.ps1 -ProcessName 'explorer' -DeploymentType 'Install' -AllowRebootPassThru
Or this (since explorer is the default process):
$exitcode = .\Invoke-ServiceUI.ps1 -DeploymentType 'Install' -AllowRebootPassThru

2 Likes

The ServiceUI examples weren’t working at all from my own testing. I’ve updated them in our develop branch which you can obtain here: PSAppDeployToolkit/examples/ServiceUI at develop · PSAppDeployToolkit/PSAppDeployToolkit · GitHub

Replace any previous copies of the batch files and Invoke-ServiceUI.ps1 with these and you should be golden.

1 Like

Thanks i will test it later and come back with my result

1 Like