Hi community,
I have trouble figuring out where I’m wrong. Error 60002 appears when i’m trying to uninstall something using the UninstallString value from the Uninstall registry key but works just fine when i’m writing the path by myself. Just to understand better, I’m trying to run this piece of code:
$maxonpathkey = (Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Maxon Cinema 4D R*")
$maxonpath = (Get-RegistryKey -key $maxonpathkey -Value 'UninstallString')
Write-Log $maxonpath // this is to understand if the value is saved and it is .
Execute-Process -Path "$maxonpath" -Arguments "--mode unattended --debugtrace $configMSILogDir\Maxon_Cinema_Uninstall.log"
Also for the Path argument I tried with quotes and without and with ’ and nothing worked, but it worked when I changed the variable $maxonpath with the actual path like this :
Execute-Process -Path "C:\Program Files\Maxon Cinema 4D R25\uninstall.exe" -Arguments "--mode unattended --debugtrace $configMSILogDir\Maxon_Cinema_Uninstall.log"
And i used this line Write-Log $maxonpath
to se if the correct value is saved in the variable and it is…
Error code from the log:
"C:\Program Files\Maxon Cinema 4D R25\uninstall.exe"]LOG]!><time="14:09:42.394120" date="12-21-2021" component="Deploy" context="NT AUTHORITY\SYSTEM" type="1" thread="10260" file="Deploy.ps1">
<![LOG[[Uninstallation] :: Function failed, setting exit code to [60002].
Error Record:
-------------At C:\Program Files (x86)\PSAppDeployToolkit_v3.8.4\AppDeployToolkitMain.ps1:3090 char:35
+ ... ifiedPath = Get-Command -Name $Path -CommandType 'Application' -Total ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]LOG]!><time="14:09:43.159120" date="12-21-2021" component="Execute-Process" context="NT AUTHORITY\SYSTEM" type="3" thread="10260" file="Deploy.ps1">
<![LOG[[Uninstallation] :: UNINSTALLATION phase failed Function failed, setting exit code to [60002].
Error Record:
-------------At C:\Program Files (x86)\PSAppDeployToolkit_v3.8.4\AppDeployToolkitMain.ps1:3090 char:35
+ ... ifiedPath = Get-Command -Name $Path -CommandType 'Application' -Total ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(at Execute-Process<Process>, C:\Program Files (x86)\PSAppDeployToolkit_v3.8.4\AppDeployToolkitMain.ps1: line 3331
at <ScriptBlock>, C:\Users\User\Desktop\ADOBE_CREATIVECLOUD_5.6.0.788_WIN10_MUI_R01\Files\Deploy.ps1: line 234)]LOG]!><time="14:09:43.191120" date="12-21-2021" component="Deploy" context="NT AUTHORITY\SYSTEM" type="1" thread="10260" file="Deploy.ps1">
<![LOG[[Uninstallation] :: The installation progress dialog does not exist. Waiting up to 5 seconds...]LOG]!><time="14:09:43.222120" date="12-21-2021" component="Close-InstallationProgress" context="NT AUTHORITY\SYSTEM" type="1" thread="10260" file="Deploy.ps1">