Hi!
I have a task to make a program that gets all programs and filters them based on a keyword. then uninstall them. This I have been able to do.
The commands I used originally:
wmic product get name, identifyingnumber
msiExe.exe /x {identifyingnumber} /qb
This works but not with the program I'm tasked to uninstall.
Fault code:
There is a problem with this Windows Installer package. a program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.
To uninstall the programs I need to use MicrosoftProgram_Install_and_Uninstall.meta.diagcab. I have tried:
- Searching on the web. Many posts, but they end without an answer
- unzip the diagcab file. then use
Get-TroubleshootingPack -Path "C:\path\to\unziped\MicrosoftProgram_Install_and_Uninstall.meta" -Answerfile "C:\path\to\answerfile.xml"
Then use the answerfile:
Get-TroubleshootingPack -Path "C:\path\to\unziped\MicrosoftProgram_Install_and_Uninstall.meta" | Invoke-TroubleShootingPack -AnswerFile "C:\path\to\answerfile.xml" but I get only this response:
Checking the registry for Patch related problems -1 No problems were detected
- msdt.exe -quiet -diagcab "C:\Path\To\MicrosoftProgram_Install_and_Uninstall.meta.diagcab" /af "C:\Path\To\Your\AnswerFile.xml"
output:
Errorcode: 0x80070057
- Get-Package -Name "NI-DIM 21.0.0" | Uninstall-Package Uninstall-Package: Uninstallation operation failed. Please look at 'C:\Users\Lukas\AppData\Local\Temp\a507daf4-2c54-47b6-b4cf-1756331e3af0\msi.log' file for details. At line:1 char:37 Get-Package -Name "NI-DIM 21.0.0" | Uninstall-Package CategoryInfo : InvalidOperation: ({34B1C8E6-2BBF-4CCB-8EEB-6471449D424B}:String) [Uninstall-Package], Exception FullyQualifiedErrorId: Uninstallation operation failed. Please look at '{0}' file for details., Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage CategoryInfo : InvalidOperation: ({34B1C8E6-2BBF-4CCB-8EEB-6471449D424B}:String) [Uninstall-Package], Exception FullyQualifiedErrorId: Uninstallation operation failed. Please look at '{0}' file for details., Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage
- MSI.log: Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action nidim_OCM_remove.NIDIM, location: C:\WINDOWS\Installer\MSIF6F3.tmp, command: /file "C:\Program Files (x86)\National Instruments\Shared\niorb\nidimr.ocm"
ect data Answerfile: <?xml version="1.0" encoding="UTF-8"?>
<Answers Version="1.0">
<Interaction ID="IID_Install_Uninstall">
<Value>Uninstall</Value>
</Interaction>
<Interaction ID="ID_DidRPRWork">
<Value>NO</Value>
</Interaction>
<Interaction ID="IID_ProductRemoval">
<Value>AppsAnywhere</Value>
</Interaction>
<Interaction ID="IID_ManualProductRemoval">
<Value>{18EF2EE1-5562-43DE-8E7B-BD0BA6E8FC89}</Value>
</Interaction>
</Answers> The reason I need to do it unattended and as a script is that there are a lot of machines here that need of removed.