PSADT Start-ADTProcessAsUser works when run as SYSTEM manually but not when deployed via Intune

Hi,

I am packaging Altova MissionKit Enterprise using PSADT v4.1.8.

The license is delivered as a .altova_licenses file and is associated with:

"C:\ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" "%1"

During installation I launch the license wizard in user context:

    # License file
    $licenseFile = "$($adtSession.DirSupportFiles)\MissionKit_Enterprise_2_installed_users_from_2026-06-18_permanent.altova_licenses"
    Start-ADTProcessAsUser -FilePath "$env:ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" -ArgumentList "`"$licenseFile`"" -IgnoreExitCodes "1" -PassThru

If I run the package manually as SYSTEM (e.g. PsExec/administrative testing), the Altova License Wizard popup appears correctly in the logged-on user's session.

However, when the same package is deployed through Intune using:

Invoke-AppDeployToolkit.exe -DeploymentType Install -SuppressRebootPassThru

the installation completes, but the License Wizard UI never appears for the user, despite Start-ADTProcessAsUser being used.

Has anyone experienced differences between Start-ADTProcessAsUser when executed manually as SYSTEM versus when executed by the Intune Management Extension?

Specifically:

  • Is there any limitation with UI processes launched using Start-ADTProcessAsUser from Intune deployments?
  • Is additional configuration required for interactive UI to appear in the user session?
  • Has anyone successfully launched Altova License Wizard or similar interactive post-install activation dialogs from an Intune-delivered PSADT package?

Any guidance would be appreciated.

I'd also add the PSADT log line showing:

RunAsActiveUser = Domain\user
SessionId = 1

Howdy! We need one of the below from you to help further though.

Just thinking out loud here....

It sounds like the Start-ProcessAsUser is not showing the license wizard UI interactively,
Maybe try including -WindowStyle Normal on your Start-ADTProcessAsUser line

<![LOG[[Initialization] :: [Altova_AltovaMissionKit2026rel.2(x64)EnterpriseEdition_vLatestVersion_64-bit_EN_01] install started.]LOG]!><time="15:38:45.012+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [Altova_AltovaMissionKit2026rel.2(x64)EnterpriseEdition_vLatestVersion_64-bit_EN_01] script version is [1.0.0].]LOG]!><time="15:38:45.029+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [Altova_AltovaMissionKit2026rel.2(x64)EnterpriseEdition_vLatestVersion_64-bit_EN_01] script date is [2026-07-01].]LOG]!><time="15:38:45.029+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [Altova_AltovaMissionKit2026rel.2(x64)EnterpriseEdition_vLatestVersion_64-bit_EN_01] script author is [Rust@m].]LOG]!><time="15:38:45.029+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [Invoke-AppDeployToolkit.ps1] script version is [4.1.8].]LOG]!><time="15:38:45.029+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The following parameters were passed to [Invoke-AppDeployToolkit.ps1]: [-DeploymentType:'Install' -DeployMode:'Interactive' -SuppressRebootPassThru].]LOG]!><time="15:38:45.044+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] module version is [4.1.8].]LOG]!><time="15:38:45.052+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] module imported in [7,8456699] seconds.]LOG]!><time="15:38:45.052+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] module initialized in [7,7809086] seconds.]LOG]!><time="15:38:45.060+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] module path is ['C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit'].]LOG]!><time="15:38:45.060+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] config path is ['C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Config'].]LOG]!><time="15:38:45.060+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] string path is ['C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Strings'].]LOG]!><time="15:38:45.060+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: [PSAppDeployToolkit] session mode is [Native].]LOG]!><time="15:38:45.075+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Computer Name is [ABC-HYB-123456.domain.com].]LOG]!><time="15:38:45.075+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Current User is [NT AUTHORITY\SYSTEM].]LOG]!><time="15:38:45.075+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: OS Version is [Microsoft Windows 11 Enterprise X64 10.0.26200.8655].]LOG]!><time="15:38:45.075+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: OS Type is [WorkStation].]LOG]!><time="15:38:45.091+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Hardware Platform is [Physical].]LOG]!><time="15:38:45.091+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Current Culture is [da-DK], language is [DA] and UI language is [DA].]LOG]!><time="15:38:45.091+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: PowerShell Host is [ConsoleHost] with version [5.1.26100.8655].]LOG]!><time="15:38:45.091+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: PowerShell Version is [5.1.26100.8655 X64].]LOG]!><time="15:38:45.107+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: PowerShell Process Path is [C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell.exe].]LOG]!><time="15:38:45.111+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: PowerShell CLR (.NET) version is [4.0.30319.42000].]LOG]!><time="15:38:45.111+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The following users are logged on to the system: [Domain\user1].]LOG]!><time="15:38:45.124+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Session information for all logged on users:
 
NTAccount             : Domain\user1
SID                   : S-1-5-21-974480964-475331416-589719471-23619
UserName              : user1
DomainName            : DOMAIN
SessionId             : 1
SessionName           : Console
ConnectState          : WTSActive
IsCurrentSession      : False
IsConsoleSession      : True
IsActiveUserSession   : True
IsValidUserSession    : True
IsUserSession         : True
IsRdpSession          : False
IsLocalAdmin          : False
IsLocalAdminException : 
LogonTime             : 02-07-2026 09:28:50
IdleTime              : 00:01:01.0630000
DisconnectTime        : 
ClientName            : 
ClientProtocolType    : Console
ClientDirectory       : 
ClientBuildNumber     :
]LOG]!><time="15:38:45.129+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Current process is running under a system account [NT AUTHORITY\SYSTEM].]LOG]!><time="15:38:45.134+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The following user is the console user [Domain\user1] (user with control of physical monitor, keyboard, and mouse).]LOG]!><time="15:38:45.139+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The active logged on user who will receive UI elements is [Domain\user1].]LOG]!><time="15:38:45.145+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The current execution context has a primary UI language of [da-DK].]LOG]!><time="15:38:45.149+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The following locale was used to import UI messages from the strings.psd1 files: [da].]LOG]!><time="15:38:45.153+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Unable to find COM object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence.]LOG]!><time="15:38:45.158+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Device has completed the OOBE and toolkit is not running with an active ESP in progress.]LOG]!><time="15:38:45.175+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Session 0 detected but deployment mode was explicitly set to [Interactive].]LOG]!><time="15:38:45.179+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: The processes ['UModel', 'XMLSpy', 'StyleVision', 'MapForce', 'DatabaseSpy'] were specified as requiring closure but deployment mode was explicitly set to [Interactive].]LOG]!><time="15:38:45.182+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Installation is running in [Interactive] mode.]LOG]!><time="15:38:45.187+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Deployment type is [Install].]LOG]!><time="15:38:45.192+60" date="7-02-2026" component="Open-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Initialization] :: Module [PSAppDeployToolkit.Extensions] imported successfully.]LOG]!><time="15:38:45.589+60" date="7-02-2026" component="PSAppDeployToolkit.Extensions.psm1" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit.Extensions\PSAppDeployToolkit.Extensions.psm1">
<![LOG[[Pre-Install] :: Evaluating disk space requirements.]LOG]!><time="15:38:46.175+60" date="7-02-2026" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Retrieving free disk space for drive [C:\].]LOG]!><time="15:38:46.244+60" date="7-02-2026" component="Get-ADTFreeDiskSpace" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Free disk space for drive [C:\]: [343143 MB].]LOG]!><time="15:38:46.260+60" date="7-02-2026" component="Get-ADTFreeDiskSpace" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Successfully passed minimum disk space requirement check.]LOG]!><time="15:38:46.300+60" date="7-02-2026" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: The user has [3] deferrals remaining.]LOG]!><time="15:38:46.328+60" date="7-02-2026" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Checking for running processes: ['UModel', 'XMLSpy', 'StyleVision', 'MapForce', 'DatabaseSpy']]LOG]!><time="15:38:46.410+60" date="7-02-2026" component="Get-ADTRunningProcesses" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Specified processes are not running.]LOG]!><time="15:38:46.442+60" date="7-02-2026" component="Get-ADTRunningProcesses" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Instantiating user client/server process.]LOG]!><time="15:38:46.525+60" date="7-02-2026" component="Invoke-ADTClientServerOperation" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Countdown has [00:10:00] seconds remaining.]LOG]!><time="15:38:47.159+60" date="7-02-2026" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.ClientServer.Server\ServerInstance.cs">
<![LOG[[Pre-Install] :: The user selected to continue...]LOG]!><time="15:39:02.052+60" date="7-02-2026" component="Show-ADTInstallationWelcome" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Checking for running processes: ['UModel', 'XMLSpy', 'StyleVision', 'MapForce', 'DatabaseSpy']]LOG]!><time="15:39:02.078+60" date="7-02-2026" component="Get-ADTRunningProcesses" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Specified processes are not running.]LOG]!><time="15:39:02.100+60" date="7-02-2026" component="Get-ADTRunningProcesses" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Creating the progress dialog in a separate thread with [StatusMessage: Installation i gang. Vent venligst…], [StatusMessageDetail: Dette vindue lukkes automatisk, når installationen er færdig.].]LOG]!><time="15:39:02.560+60" date="7-02-2026" component="Show-ADTInstallationProgress" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Getting information for installed applications matching the provided FilterScript...]LOG]!><time="15:39:02.807+60" date="7-02-2026" component="Get-ADTApplication" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Found no application based on the supplied FilterScript.]LOG]!><time="15:39:02.958+60" date="7-02-2026" component="Get-ADTApplication" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: No applications found for removal.]LOG]!><time="15:39:03.004+60" date="7-02-2026" component="Uninstall-ADTApplication" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Getting information for installed applications matching the provided FilterScript...]LOG]!><time="15:39:03.044+60" date="7-02-2026" component="Get-ADTApplication" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Found no application based on the supplied FilterScript.]LOG]!><time="15:39:03.168+60" date="7-02-2026" component="Get-ADTApplication" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: No applications found for removal.]LOG]!><time="15:39:03.192+60" date="7-02-2026" component="Uninstall-ADTApplication" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Pre-Install] :: Fetching page: https://www.altova.com/missionkit/download]LOG]!><time="15:39:03.217+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Pre-Install] :: Posting to: https://www.altova.com/ThankYou (BA/P win64 en)]LOG]!><time="15:39:03.378+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Pre-Install] :: Resolved download endpoint: https://cdn.sw.altova.com/v2026r2/en/MissionKitEnt2026rel2_x64.exe]LOG]!><time="15:39:03.697+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="2" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Pre-Install] :: Downloading to temp: C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Files\AltovaMissionKit.tmp]LOG]!><time="15:39:03.919+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="2" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Pre-Install] :: Download completed: C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Files\MissionKitEnt2026rel2_x64.exe (bytes: 470733424)]LOG]!><time="15:39:45.932+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="2" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Install] :: Install: "C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Files\MissionKitEnt2026rel2_x64.exe"]LOG]!><time="15:39:45.998+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="2" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Install] :: Preparing to execute process [C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Files\MissionKitEnt2026rel2_x64.exe]...]LOG]!><time="15:39:46.157+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: CreateNoWindow not specified, StdOut/StdErr streams will not be available.]LOG]!><time="15:39:46.202+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: Working Directory is [C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Files].]LOG]!><time="15:39:46.208+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: Executing ["C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Files\MissionKitEnt2026rel2_x64.exe" ALLUSERS="2" CREATE_DESKTOP_SHORTCUT="NO" /qn]...]LOG]!><time="15:39:46.215+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: Executed ["C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Files\MissionKitEnt2026rel2_x64.exe" ALLUSERS="2" CREATE_DESKTOP_SHORTCUT="NO" /qn], awaiting completion...]LOG]!><time="15:39:51.543+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: Execution completed successfully with exit code [0].]LOG]!><time="15:41:24.586+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="0" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: StdOut Output from Execution: N/A]LOG]!><time="15:41:24.603+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: StdErr Output from Execution: N/A]LOG]!><time="15:41:24.610+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: Interleaved Output from Execution: N/A]LOG]!><time="15:41:24.620+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Install] :: PassThru parameter specified, returning execution results object.]LOG]!><time="15:41:24.631+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: Altova license ProgId: LicenseKeyUpdate.altova_licenses]LOG]!><time="15:41:24.677+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="2" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Post-Install] :: Altova license open command: "C:\ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" "%1"]LOG]!><time="15:41:24.683+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="2" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Post-Install] :: DeployMode: Interactive]LOG]!><time="15:41:34.708+60" date="7-02-2026" component="Install-ADTDeployment" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\Invoke-AppDeployToolkit.ps1">
<![LOG[[Post-Install] :: Preparing to execute process [C:\ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe] for user [Domain\user1]...]LOG]!><time="15:41:35.151+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: Please use [-SuccessExitCodes] and/or [-RebootExitCodes] to specify your process's exit codes.]LOG]!><time="15:41:35.158+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: CreateNoWindow not specified, StdOut/StdErr streams will not be available.]LOG]!><time="15:41:35.180+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: Working Directory is [C:\ProgramData\Altova\SharedBetweenVersions].]LOG]!><time="15:41:35.188+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: Executing ["C:\ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" "C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\SupportFiles\MissionKit_Enterprise_2_installed_users_from_2026-06-18_permanent.altova_licenses"] for user [Domain\user1]...]LOG]!><time="15:41:35.196+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: Executed ["C:\ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" "C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\SupportFiles\MissionKit_Enterprise_2_installed_users_from_2026-06-18_permanent.altova_licenses"], awaiting completion...]LOG]!><time="15:41:35.376+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: Execution completed successfully with exit code [0].]LOG]!><time="15:41:35.477+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="0" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: StdOut Output from Execution: N/A]LOG]!><time="15:41:35.482+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: StdErr Output from Execution: N/A]LOG]!><time="15:41:35.487+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: Interleaved Output from Execution: N/A]LOG]!><time="15:41:35.492+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Post-Install] :: PassThru parameter specified, returning execution results object.]LOG]!><time="15:41:35.496+60" date="7-02-2026" component="Start-ADTProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Finalization] :: Closing the installation progress dialog.]LOG]!><time="15:41:35.792+60" date="7-02-2026" component="Close-ADTInstallationProgress" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Finalization] :: Closing user client/server process.]LOG]!><time="15:41:35.916+60" date="7-02-2026" component="Close-ADTClientServerProcess" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[[Finalization] :: [Altova_AltovaMissionKit2026rel.2(x64)EnterpriseEdition_vLatestVersion_64-bit_EN_01] install completed in [171,5423678] seconds with exit code [0].]LOG]!><time="15:41:36.492+60" date="7-02-2026" component="Close-ADTSession" context="NT AUTHORITY\SYSTEM" type="0" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">
<![LOG[-------------------------------------------------------------------------------]LOG]!><time="15:41:36.507+60" date="7-02-2026" component="Close-ADTSession" context="NT AUTHORITY\SYSTEM" type="1" thread="24504" file="C:\Windows\IMECache\650c8d80-c18a-4e7c-8ff5-19b1d055003d_4\PSAppDeployToolkit\PSAppDeployToolkit.psm1">

I have changed Install command: Invoke-AppDeployToolkit.exe -DeploymentType Install -SuppressRebootPassThru ----->
Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Interactive -SuppressRebootPassThru

post-install:
Start-ADTProcessAsUser -FilePath "$env:ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" -ArgumentList ""$licenseFile"" -WindowStyle Normal -IgnoreExitCodes "1" -PassThru

PSADT package did run interactively, so that UI works fine.

it still did not start user Altova license UI which otherwise does start if it run package with CMD as system

I'm not seeing anything obvious in the logs, the process starts and ends all within 100 ms without an error from the toolkit.

Confirming there's only a single user logged onto the device? Anything in the event logs that might be of help? Any logs from that exe to indicate what might have gone wrong?

yes single user logged on, that's my normal user. no other logs i see from exe, I don't get why it does not launch the process for active user, is there any other param i should add for Start-ADTProcessAsUser that could help start it for my active normal user?

The thing is that it did start it, it's that the process didn't do anything and exited. This is why it'd be good if it had any kind of logging or if something was available in the event logs of the system.

While it shouldn't make any difference, you could also test a pre-rc1 release of our next version: Fix some `Show-ADTInstallationRestartPrompt` CodeQL complaints. · PSAppDeployToolkit/PSAppDeployToolkit@143f173 · GitHub.

I was beginning to think this sounded a little like this previous issue:
No GUI during an interactive setup with version 4.1.5 - The Toolkit / General Discussion - PSAppDeployToolkit Community
However, in this case the app was run from the System context, which your LicenseWizard.exe is not.
:thinking:
But I have just re-reviewed your code:

# License file
    $licenseFile = "$($adtSession.DirSupportFiles)\MissionKit_Enterprise_2_installed_users_from_2026-06-18_permanent.altova_licenses"
    Start-ADTProcessAsUser -FilePath "$env:ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" -ArgumentList "`"$licenseFile`"" -IgnoreExitCodes "1" -PassThru

IMHO as the $licenseFile is already double quoted, I'm uncertain if there is a need to parse this to the Start-ADTProcessAsUser in double quotes with an extra pair of escaped double quotes

... -ArgumentList "`"$licenseFile`"" 

I personally would have either:

-ArgumentList $($licenseFile)

or

-ArgumentList "$($licenseFile)"

But I'd be happy to be corrected.

People always go nuts with quotes. Less is best. This is PowerShell, not a batch script!

Just -ArgumentList $licenseFile would be fine.

Interesting, but what I wonder is, why it does work when Run package with PsExec and I get UI with that format and quotes, and when it runs via Intunes it does not, I would expect it it was a quotes issue it would have not even worked via CMD/PsExec.

I'll retest with -ArgumentList $licenseFile

The bad quotes don't explain the difference between Intune and your manual attempts via psexec.exe, it's more just about cleaning up some stuff that may help by happenstance.

At this current time, I really couldn't say as it's not like the toolkit is failing to run the process. It's running it fine, the process is just instantly bombing out and without its own logging, its a bit of a mystery.

I can say with a lot of confidence that the toolkit isn't the problem is because every return result from Win32 API calls is tested to ensure success, throwing an exception on the first sign of failure.

Yeah, that's the mystery.

here is the code of the software deployment for PSADT 4.1.8; Invoke-AppDeployToolkit:

<#

.SYNOPSIS
PSAppDeployToolkit - This script performs the installation or uninstallation of an application(s).

.DESCRIPTION
- The script is provided as a template to perform an install, uninstall, or repair of an application(s).
- The script either performs an "Install", "Uninstall", or "Repair" deployment type.
- The install deployment type is broken down into 3 main sections/phases: Pre-Install, Install, and Post-Install.

The script imports the PSAppDeployToolkit module which contains the logic and functions required to install or uninstall an application.

.PARAMETER DeploymentType
The type of deployment to perform.

.PARAMETER DeployMode
Specifies whether the installation should be run in Interactive (shows dialogs), Silent (no dialogs), NonInteractive (dialogs without prompts) mode, or Auto (shows dialogs if a user is logged on, device is not in the OOBE, and there's no running apps to close).

Silent mode is automatically set if it is detected that the process is not user interactive, no users are logged on, the device is in Autopilot mode, or there's specified processes to close that are currently running.

.PARAMETER SuppressRebootPassThru
Suppresses the 3010 return code (requires restart) from being passed back to the parent process (e.g. SCCM) if detected from an installation. If 3010 is passed back to SCCM, a reboot prompt will be triggered.

.PARAMETER TerminalServerMode
Changes to "user install mode" and back to "user execute mode" for installing/uninstalling applications for Remote Desktop Session Hosts/Citrix servers.

.PARAMETER DisableLogging
Disables logging to file for the script.

.EXAMPLE
powershell.exe -File Invoke-AppDeployToolkit.ps1

.EXAMPLE
powershell.exe -File Invoke-AppDeployToolkit.ps1 -DeployMode Silent

.EXAMPLE
powershell.exe -File Invoke-AppDeployToolkit.ps1 -DeploymentType Uninstall

.EXAMPLE
Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent

.INPUTS
None. You cannot pipe objects to this script.

.OUTPUTS
None. This script does not generate any output.

.NOTES
Toolkit Exit Code Ranges:
- 60000 - 68999: Reserved for built-in exit codes in Invoke-AppDeployToolkit.ps1, and Invoke-AppDeployToolkit.exe
- 69000 - 69999: Recommended for user customized exit codes in Invoke-AppDeployToolkit.ps1
- 70000 - 79999: Recommended for user customized exit codes in PSAppDeployToolkit.Extensions module.

.LINK
https://psappdeploytoolkit.com

#>

[CmdletBinding()]
param
(
    # Default is 'Install'.
    [Parameter(Mandatory = $false)]
    [ValidateSet('Install', 'Uninstall', 'Repair')]
    [System.String]$DeploymentType,

    # Default is 'Auto'. Don't hard-code this unless required.
    [Parameter(Mandatory = $false)]
    [ValidateSet('Auto', 'Interactive', 'NonInteractive', 'Silent')]
    [System.String]$DeployMode,

    [Parameter(Mandatory = $false)]
    [System.Management.Automation.SwitchParameter]$SuppressRebootPassThru,

    [Parameter(Mandatory = $false)]
    [System.Management.Automation.SwitchParameter]$TerminalServerMode,

    [Parameter(Mandatory = $false)]
    [System.Management.Automation.SwitchParameter]$DisableLogging
)


##================================================
## MARK: Variables
##================================================

# Zero-Config MSI support is provided when "AppName" is null or empty.
# By setting the "AppName" property, Zero-Config MSI will be disabled.
$adtSession = @{
    # App variables.
    AppVendor = 'Altova'
    AppName = 'Altova MissionKit 2026 rel. 2 (x64) Enterprise Edition'
    AppVersion = 'vLatestVersion'
    AppArch = '64-bit'
    AppLang = 'EN'
    AppRevision = '01'
    AppSuccessExitCodes = @(0)
    AppRebootExitCodes = @(1641, 3010)
    AppProcessesToClose = @('UModel','XMLSpy','StyleVision','MapForce','DatabaseSpy')  # Example: @('excel', @{ Name = 'winword'; Description = 'Microsoft Word' })
    AppScriptVersion = '1.0.0'
    AppScriptDate = '2026-07-01'
    AppScriptAuthor = 'Rust@m'
    RequireAdmin = $true

    # Install Titles (Only set here to override defaults set by the toolkit).
    InstallName = ''
    InstallTitle = ''

    # Script variables.
    DeployAppScriptFriendlyName = $MyInvocation.MyCommand.Name
    DeployAppScriptParameters = $PSBoundParameters
    DeployAppScriptVersion = '4.1.8'
}

function Install-ADTDeployment
{
    [CmdletBinding()]
    param
    (
    )

    ##================================================
    ## MARK: Pre-Install
    ##================================================
    $adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"

    ## Show Welcome Message, close processes if specified, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt.
    Show-ADTInstallationWelcome -CloseProcesses $adtSession.AppProcessesToClose -CheckDiskSpace -AllowDefer -DeferTimes 3 -ForceCloseProcessesCountdown 600

 
    ## Show Progress Message (with the default message).
    Show-ADTInstallationProgress

    ## <Perform Pre-Installation tasks here>
    #MSI AND EXE for majority it works
    Uninstall-ADTApplication -Name "Altova MissionKit" -FilterScript { $_.Publisher -like 'Altova*' } -ErrorAction SilentlyContinue
    Uninstall-ADTApplication -Name "Altova XML-Schema Manager" -FilterScript { $_.Publisher -like 'Altova*' } -ErrorAction SilentlyContinue    

    # PSADT v4 - Altova MissionKit Professional x64 (download latest via form, avoid 32KB ThankYou HTML)
    
    $baseUrl = "https://www.altova.com"
    $downloadPageUrl = "$baseUrl/missionkit/download"
    $postUrl = "$baseUrl/ThankYou"
    
    $destDir = "$($adtSession.DirFiles)\"
    $tmpFile = "$destDir" + "AltovaMissionKit.tmp"
    
    Try {
        $ProgressPreference = 'SilentlyContinue'
    
        Write-ADTLogEntry -Message "Fetching page: $downloadPageUrl" -Severity 1
        Invoke-WebRequest -Uri $downloadPageUrl -UseBasicParsing -SessionVariable webSession | Out-Null
    
        $body = @{
            ProductCode     = "BA"      # MissionKit
            #EditionCode     = "P"       # Professional
            EditionCode     = "E"       # Enterprise
            InstallerType   = "Product"
            OperatingSystem = "win64"
            Lang            = "en"
        }
    
        Write-ADTLogEntry -Message "Posting to: $postUrl (BA/P win64 en)" -Severity 1
        $resp = Invoke-WebRequest -Uri $postUrl -Method Post -Body $body -UseBasicParsing -WebSession $webSession -MaximumRedirection 10
    
        if (-not $resp -or -not $resp.Content) { throw "Empty response from /ThankYou." }
        $html = $resp.Content
    
        # Extract best candidate URL from HTML (absolute or relative)
        $urls = @()
    
        # Absolute URLs
        $urls += [regex]::Matches($html, '(?i)https?:\/\/[^\s"''<>]+') | ForEach-Object { $_.Value }
    
        # href="/..."
        $urls += [regex]::Matches($html, '(?i)href\s*=\s*["''](?<u>\/[^"''<>]+)["'']') | ForEach-Object { $_.Groups['u'].Value }
    
        # url=/... (meta refresh, JS)
        $urls += [regex]::Matches($html, '(?i)\burl\s*=\s*(?<u>\/[^"''<>\s]+)') | ForEach-Object { $_.Groups['u'].Value }
    
        $urls = $urls | Where-Object { $_ } | Select-Object -Unique
    
        # Prefer direct installer first (.exe), else download-like endpoints
        $downloadUrl =
            ($urls | Where-Object { $_ -match '(?i)\.exe(\?|$)' } | Select-Object -First 1)
    
        if (-not $downloadUrl) {
            $downloadUrl =
                ($urls | Where-Object { $_ -match '(?i)download|dl|installer|setup|get' } | Select-Object -First 1)
        }
    
        if (-not $downloadUrl) {
            Write-ADTLogEntry -Message "No obvious download URL found on ThankYou page. First 25 extracted URLs: $($urls | Select-Object -First 25 -join ' | ')" -Severity 3
            throw "Could not find installer/download URL on ThankYou page."
        }
    
        if ($downloadUrl -notmatch '^https?://') { $downloadUrl = "$baseUrl/$($downloadUrl.TrimStart('/'))" }
    
        Write-ADTLogEntry -Message "Resolved download endpoint: $downloadUrl" -Severity 2
    
        # Determine final filename (Content-Disposition if possible)
        $fileName = $null
        try {
            $head = Invoke-WebRequest -Uri $downloadUrl -Method Head -UseBasicParsing -WebSession $webSession -MaximumRedirection 10
            if ($head -and $head.Headers["Content-Disposition"] -match 'filename="?([^";]+)"?') { $fileName = $matches[1] }
        } catch { }
    
        if (-not $fileName) {
            try { $fileName = [System.IO.Path]::GetFileName(([uri]$downloadUrl).AbsolutePath) } catch { }
        }
    
        #Pro
        #if (-not $fileName -or $fileName -notmatch '(?i)\.exe(\?|$)') { $fileName = "Altova-MissionKit-Professional-x64-Latest.exe" }
        
        #Enterprise
        if (-not $fileName -or $fileName -notmatch '(?i)\.exe(\?|$)') { $fileName = "Altova-MissionKit-Enterprise-x64-Latest.exe" }
    
        $finalPath = "$destDir$fileName"
    
        # Download to temp first
        if (Test-Path -LiteralPath $tmpFile) { Remove-Item -LiteralPath $tmpFile -Force -ErrorAction SilentlyContinue }
        Write-ADTLogEntry -Message "Downloading to temp: $tmpFile" -Severity 2
        Invoke-WebRequest -Uri $downloadUrl -OutFile $tmpFile -UseBasicParsing -WebSession $webSession -MaximumRedirection 10
    
        if (-not (Test-Path -LiteralPath $tmpFile)) { throw "Download finished but temp file not found." }
    
        # If temp is HTML (e.g., still a ThankYou page), try one more hop by parsing that HTML and downloading again
        $len = (Get-Item -LiteralPath $tmpFile).Length
        $firstBytes = Get-Content -LiteralPath $tmpFile -Encoding Byte -TotalCount 128
        $firstText = [System.Text.Encoding]::ASCII.GetString($firstBytes)
    
        if ($firstText -match '(?i)<!DOCTYPE|<html|<head|<body') {
            Write-ADTLogEntry -Message "Temp download looks like HTML (size: $len). Trying to extract real binary URL from that page..." -Severity 1
    
            $html2 = Get-Content -LiteralPath $tmpFile -Raw -ErrorAction Stop
    
            $urls2 = @()
            $urls2 += [regex]::Matches($html2, '(?i)https?:\/\/[^\s"''<>]+') | ForEach-Object { $_.Value }
            $urls2 += [regex]::Matches($html2, '(?i)href\s*=\s*["''](?<u>\/[^"''<>]+)["'']') | ForEach-Object { $_.Groups['u'].Value }
            $urls2 += [regex]::Matches($html2, '(?i)\burl\s*=\s*(?<u>\/[^"''<>\s]+)') | ForEach-Object { $_.Groups['u'].Value }
            $urls2 = $urls2 | Where-Object { $_ } | Select-Object -Unique
    
            $downloadUrl2 = ($urls2 | Where-Object { $_ -match '(?i)\.exe(\?|$)' } | Select-Object -First 1)
            if (-not $downloadUrl2) { $downloadUrl2 = ($urls2 | Where-Object { $_ -match '(?i)download|dl|installer|setup|get' } | Select-Object -First 1) }
    
            if (-not $downloadUrl2) {
                Write-ADTLogEntry -Message "Second-hop extraction failed. First 25 URLs: $($urls2 | Select-Object -First 25 -join ' | ')" -Severity 3
                throw "Downloaded HTML instead of installer (size $len) and could not extract the binary URL."
            }
    
            if ($downloadUrl2 -notmatch '^https?://') { $downloadUrl2 = "$baseUrl/$($downloadUrl2.TrimStart('/'))" }
            Write-ADTLogEntry -Message "Second-hop resolved endpoint: $downloadUrl2" -Severity 2
    
            # Download again (overwrite temp)
            Invoke-WebRequest -Uri $downloadUrl2 -OutFile $tmpFile -UseBasicParsing -WebSession $webSession -MaximumRedirection 10
    
            $len2 = (Get-Item -LiteralPath $tmpFile).Length
            $firstBytes2 = Get-Content -LiteralPath $tmpFile -Encoding Byte -TotalCount 128
            $firstText2 = [System.Text.Encoding]::ASCII.GetString($firstBytes2)
    
            if ($firstText2 -match '(?i)<!DOCTYPE|<html|<head|<body') {
                throw "Second-hop still returned HTML (size $len2). Endpoint is not returning the binary."
            }
        }
    
        # Move temp to final
        if (Test-Path -LiteralPath $finalPath) { Remove-Item -LiteralPath $finalPath -Force -ErrorAction SilentlyContinue }
        Move-Item -LiteralPath $tmpFile -Destination $finalPath -Force
    
        $finalSize = (Get-Item -LiteralPath $finalPath).Length
        Write-ADTLogEntry -Message "Download completed: $finalPath (bytes: $finalSize)" -Severity 2
    }
    Catch {
        Write-ADTLogEntry -Message "Error downloading Altova MissionKit: $($_.Exception.Message)" -Severity 3
        Close-ADTSession -ExitCode 60002
    }

    # Cleanup any existing custom registry markers (including typos or old versions)
    $customRegRoot = "HKLM:\SOFTWARE\PSADTCustomDeployments"
    if (Test-Path $customRegRoot) {
        Get-ChildItem -Path $customRegRoot | Where-Object {$_.PSChildName -like "*$($adtSession.AppName)*"} | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
    }
    ##================================================
    ## MARK: Install
    ##================================================
    $adtSession.InstallPhase = $adtSession.DeploymentType

    ## Handle Zero-Config MSI installations.
    if ($adtSession.UseDefaultMsi)
    {
        $ExecuteDefaultMSISplat = @{ Action = $adtSession.DeploymentType; FilePath = $adtSession.DefaultMsiFile }
        if ($adtSession.DefaultMstFile)
        {
            $ExecuteDefaultMSISplat.Add('Transforms', $adtSession.DefaultMstFile)
        }
        Start-ADTMsiProcess @ExecuteDefaultMSISplat
        if ($adtSession.DefaultMspFiles)
        {
            $adtSession.DefaultMspFiles | Start-ADTMsiProcess -Action Patch
        }
    }

    ## <Perform Installation tasks here>
    #EXE
    [string]$installFile = Get-ChildItem -Path "$($adtSession.DirFiles)\" -Filter "*.exe" -Name
    Write-ADTLogEntry -Message "Install: `"$($adtSession.DirFiles)\$installFile`"" -Severity 2
    Start-ADTProcess -FilePath "$($adtSession.DirFiles)\$installFile" -ArgumentList "ALLUSERS=`"2`" CREATE_DESKTOP_SHORTCUT=`"NO`" /qn" -PassThru

    ##================================================
    ## MARK: Post-Install
    ##================================================
    $adtSession.InstallPhase = "Post-$($adtSession.DeploymentType)"

    ## <Perform Post-Installation tasks here>
    $progId = (Get-Item "Registry::HKEY_CLASSES_ROOT\.altova_licenses").GetValue("")
    $openCommand = (Get-Item "Registry::HKEY_CLASSES_ROOT\$progId\shell\open\command").GetValue("")
    
    Write-ADTLogEntry -Message "Altova license ProgId: $progId" -Severity 2
    Write-ADTLogEntry -Message "Altova license open command: $openCommand" -Severity 2
    
    Start-Sleep -Seconds 10
    Write-ADTLogEntry -Message "DeployMode: $($adtSession.DeployMode)" -Severity 1


    $licenseFiles = Get-ChildItem -Path "${env:ProgramData}\Altova" -Filter "*.licbin" -File -Recurse -ErrorAction SilentlyContinue

    foreach ($file in $licenseFiles)
    {
        Write-ADTLogEntry -Message "Removing Altova license file: [$($file.FullName)]" -Severity 2
        Remove-Item -LiteralPath $file.FullName -Force -ErrorAction SilentlyContinue
    }

    # License file
    $licenseFile = "$($adtSession.DirSupportFiles)\MissionKit_Enterprise_2_installed_users_from_2026-06-18_permanent.altova_licenses"
    #Start-ADTProcessAsUser -FilePath "$env:ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" -ArgumentList "`"$licenseFile`"" -WindowStyle Normal -IgnoreExitCodes "1" -PassThru
    Start-ADTProcessAsUser -FilePath "$env:ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" -ArgumentList $licenseFile -WindowStyle Normal -IgnoreExitCodes "1" -PassThru

    #PSADTCustomDeployments reg
    #if (Test-Path -Path "$env:PUBLIC\Desktop\APPNAME.lnk") {Remove-ADTFile -LiteralPath  "$env:PUBLIC\Desktop\APPNAME.lnk" -ErrorAction SilentlyContinue}
    # Generic Registry Stamp for "Set and Forget" Updates
    $regPath = "HKLM:\SOFTWARE\PSADTCustomDeployments\$($adtSession.AppName)"
    if (!(Test-Path $regPath)) { New-Item $regPath -Force }
    Set-ItemProperty -Path $regPath -Name "LastScriptRun" -Value (Get-Date -Format "yyyyMMdd")

    <## Display a message at the end of the install.
    if (!$adtSession.UseDefaultMsi)
    {
        Show-ADTInstallationPrompt -Message 'You can customize text to appear at the end of an install or remove it completely for unattended installations.' -ButtonRightText 'OK' -NoWait
    }#>
}

function Uninstall-ADTDeployment
{
    [CmdletBinding()]
    param
    (
    )

    ##================================================
    ## MARK: Pre-Uninstall
    ##================================================
    $adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"

    <# KEEP THIS, but use '=' (Assignment) NOT '.Add()' ig @saiwParams populated variables in the top of the script.
    if ($adtSession.AppProcessesToClose.Count -gt 0)
    {
        $saiwParams.CloseProcesses = $adtSession.AppProcessesToClose
    }
    
    Show-ADTInstallationWelcome @saiwParams 
    #>
    
    Show-ADTInstallationWelcome -CloseProcesses $adtSession.AppProcessesToClose -ForceCloseProcessesCountdown 600

    ## Show Progress Message (with the default message).
    Show-ADTInstallationProgress

    ## <Perform Pre-Uninstallation tasks here>


    ##================================================
    ## MARK: Uninstall
    ##================================================
    $adtSession.InstallPhase = $adtSession.DeploymentType

    ## Handle Zero-Config MSI uninstallations.
    if ($adtSession.UseDefaultMsi)
    {
        $ExecuteDefaultMSISplat = @{ Action = $adtSession.DeploymentType; FilePath = $adtSession.DefaultMsiFile }
        if ($adtSession.DefaultMstFile)
        {
            $ExecuteDefaultMSISplat.Add('Transforms', $adtSession.DefaultMstFile)
        }
        Start-ADTMsiProcess @ExecuteDefaultMSISplat
    }

    ## <Perform Uninstallation tasks here>
    #MSI AND EXE for majority it works
    Uninstall-ADTApplication -Name "Altova MissionKit" -FilterScript { $_.Publisher -like 'Altova*' } -ErrorAction SilentlyContinue
    Uninstall-ADTApplication -Name "Altova XML-Schema Manager" -FilterScript { $_.Publisher -like 'Altova*' } -ErrorAction SilentlyContinue    

    ##================================================
    ## MARK: Post-Uninstallation
    ##================================================
    $adtSession.InstallPhase = "Post-$($adtSession.DeploymentType)"

    ## <Perform Post-Uninstallation tasks here>
    # Cleanup any existing custom registry markers (including typos or old versions)
    $customRegRoot = "HKLM:\SOFTWARE\PSADTCustomDeployments"
    if (Test-Path $customRegRoot) {
        Get-ChildItem -Path $customRegRoot | Where-Object {$_.PSChildName -like "*$($adtSession.AppName)*"} | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
    }
}

function Repair-ADTDeployment
{
    [CmdletBinding()]
    param
    (
    )

    ##================================================
    ## MARK: Pre-Repair
    ##================================================
    $adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"

    ## If there are processes to close, show Welcome Message with a 60 second countdown before automatically closing.
    if ($adtSession.AppProcessesToClose.Count -gt 0)
    {
        Show-ADTInstallationWelcome -CloseProcesses $adtSession.AppProcessesToClose -CloseProcessesCountdown 60
    }

    ## Show Progress Message (with the default message).
    Show-ADTInstallationProgress

    ## <Perform Pre-Repair tasks here>


    ##================================================
    ## MARK: Repair
    ##================================================
    $adtSession.InstallPhase = $adtSession.DeploymentType

    ## Handle Zero-Config MSI repairs.
    if ($adtSession.UseDefaultMsi)
    {
        $ExecuteDefaultMSISplat = @{ Action = $adtSession.DeploymentType; FilePath = $adtSession.DefaultMsiFile }
        if ($adtSession.DefaultMstFile)
        {
            $ExecuteDefaultMSISplat.Add('Transforms', $adtSession.DefaultMstFile)
        }
        Start-ADTMsiProcess @ExecuteDefaultMSISplat
    }

    ## <Perform Repair tasks here>


    ##================================================
    ## MARK: Post-Repair
    ##================================================
    $adtSession.InstallPhase = "Post-$($adtSession.DeploymentType)"

    ## <Perform Post-Repair tasks here>
}


##================================================
## MARK: Initialization
##================================================

# Set strict error handling across entire operation.
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$ProgressPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue
Set-StrictMode -Version 1

# Import the module and instantiate a new session.
try
{
    # Import the module locally if available, otherwise try to find it from PSModulePath.
    if (Test-Path -LiteralPath "$PSScriptRoot\PSAppDeployToolkit\PSAppDeployToolkit.psd1" -PathType Leaf)
    {
        Get-ChildItem -LiteralPath "$PSScriptRoot\PSAppDeployToolkit" -Recurse -File | Unblock-File -ErrorAction Ignore
        Import-Module -FullyQualifiedName @{ ModuleName = "$PSScriptRoot\PSAppDeployToolkit\PSAppDeployToolkit.psd1"; Guid = '8c3c366b-8606-4576-9f2d-4051144f7ca2'; ModuleVersion = '4.1.8' } -Force
    }
    else
    {
        Import-Module -FullyQualifiedName @{ ModuleName = 'PSAppDeployToolkit'; Guid = '8c3c366b-8606-4576-9f2d-4051144f7ca2'; ModuleVersion = '4.1.8' } -Force
    }

    # Open a new deployment session, replacing $adtSession with a DeploymentSession.
    $iadtParams = Get-ADTBoundParametersAndDefaultValues -Invocation $MyInvocation
    $adtSession = Remove-ADTHashtableNullOrEmptyValues -Hashtable $adtSession
    $adtSession = Open-ADTSession @adtSession @iadtParams -PassThru
}
catch
{
    $Host.UI.WriteErrorLine((Out-String -InputObject $_ -Width ([System.Int32]::MaxValue)))
    exit 60008
}


##================================================
## MARK: Invocation
##================================================

# Commence the actual deployment operation.
try
{
    # Import any found extensions before proceeding with the deployment.
    Get-ChildItem -LiteralPath $PSScriptRoot -Directory | & {
        process
        {
            if ($_.Name -match 'PSAppDeployToolkit\..+$')
            {
                Get-ChildItem -LiteralPath $_.FullName -Recurse -File | Unblock-File -ErrorAction Ignore
                Import-Module -Name $_.FullName -Force
            }
        }
    }

    # Invoke the deployment and close out the session.
    & "$($adtSession.DeploymentType)-ADTDeployment"
    Close-ADTSession
}
catch
{
    # An unhandled error has been caught.
    $mainErrorMessage = "An unhandled error within [$($MyInvocation.MyCommand.Name)] has occurred.`n$(Resolve-ADTErrorRecord -ErrorRecord $_)"
    Write-ADTLogEntry -Message $mainErrorMessage -Severity 3

    ## Error details hidden from the user by default. Show a simple dialog with full stack trace:
    # Show-ADTDialogBox -Text $mainErrorMessage -Icon Stop -NoWait

    ## Or, a themed dialog with basic error message:
    # Show-ADTInstallationPrompt -Message "$($adtSession.DeploymentType) failed at line $($_.InvocationInfo.ScriptLineNumber), char $($_.InvocationInfo.OffsetInLine):`n$($_.InvocationInfo.Line.Trim())`n`nMessage:`n$($_.Exception.Message)" -ButtonRightText OK -Icon Error -NoWait

    Close-ADTSession -ExitCode 60001
}

This has solved the issue and UI now start in user context when executed by Intune:

    # License file
    Copy-ADTFile -Path "$($adtSession.DirSupportFiles)\MissionKit_Enterprise_2_installed_users_from_2026-06-18_permanent.altova_licenses" -Destination "${env:ProgramData}\Altova" -ContinueFileCopyOnError
    $licenseFile = "${env:ProgramData}\Altova\MissionKit_Enterprise_2_installed_users_from_2026-06-18_permanent.altova_licenses"
    Start-ADTProcessAsUser -FilePath "$env:ProgramData\Altova\SharedBetweenVersions\LicenseWizard.exe" -ArgumentList $licenseFile -WindowStyle Normal -IgnoreExitCodes "1" -PassThru

So it literally was the quotes? All I can say is: https://www.youtube.com/watch?v=C2cMG33mWVY

No, it was location of the file when moved it this new location, it could be executed :rofl:

So the file existed in a certain location, could be executed without error, but it just didn't run right where it was? I need to link that OMC music video again haha.

I'm glad it's all sorted all the same! Have a good weekend.