How to run MicrosoftProgram_Install_and_Uninstall.meta.diagcab - unattended

Lukas August Jakobsen 0 Reputation points
2024-01-25T08:08:04.8766667+00:00

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.
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,633 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,067 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-04-17T15:47:09.3833333+00:00

    I need to perform an uninstall process on a huge set of workstations that got the original MSI corrupted and the only way I able to remove the software is by running the MicrosoftProgram_Install_and_Uninstall.meta.This works fine but requires me to go to each workstation, individually.I've opened the diagcab file with zip and got a bunch of PS1 files.I've tried to find a way to "hard code" the option=Uninstall and the application name=XPTO

    Nothing happens. I'm not a developer despite I understand quite well PowerShell and I'm able to do some PowerShell scripts but these... are too much for me.
    Could someone help us with that?

    0 comments No comments