PSADT 4.1.0 Remove User installed MSI with System rights not working

Hi All,

I am trying to remove a MSI which is installed with the logged-in user (see code below), but when removing using " Uninstall-ADTApplication -Name 'Program' -ApplicationType 'MSI' " i get the error that the program cannot be found. I can manually remove the program under control panel, but it asking for admin credentials which is not ideal.

Does anyone as a solution to this challenge ?

    ## Install program (MSI)
    ## Get currently logged on user
    $currentlyLoggedOnUser = (Get-ADTLoggedOnUser).username
    $CurrentlyLoggedOnUserFolder = "C:\Users\$currentlyLoggedOnUser\Pogram"
    ## Create user folder if needed
    if (!(Test-Path -Path $CurrentlyLoggedOnUserFolder)) {
    New-Item -Path $CurrentlyLoggedOnUserFolder -ItemType Directory -Force
    }
    ## Copy script file to user folder
    Copy-Item -Path "$($adtSession.DirFiles)\Program.msi" -Destination "$CurrentlyLoggedOnUserFolder" -Force		
    ## Run the script file to finalize the installation as the currently logged on user
    Start-ADTMsiProcessAsUser -Action ‘Install’ -FilePath $CurrentlyLoggedOnUserFolder\program.msi

Error :

[2025-08-20T15:27:24.6264851+02:00] [Uninstall] [Start-ADTProcess] [Error] :: Execution failed with exit code [1605] because the product is not currently installed.
[2025-08-20T15:27:24.6752844+02:00] [Uninstall] [Uninstall-ADTApplication] [Error] :: Execution failed with exit code [1605] because the product is not currently installed.
Error Record:
-------------

Message               : Execution failed with exit code [1605] because the product is not currently installed.

This is normal and has nothing to do with PSADT.

An MSI installed by a user into his/her profile is NOT a system installed package.

A User-installed MSI must be uninstalled a the SAME user.

Well that is the problem, this is also not possible because it than asks for Admin credentials. And when installing the package manual it all works, so PSADT is doing something with the installer that makes it different than a manual install.

Can be closed, resolved by using different arguments and installing as System.

1 Like