Uninstalling an MSI file from the command line without using msiexec
.net, command-line, installation, windows-installer, wix
Solution
Short answer: you can't. Use MSIEXEC /x
Long answer: When you run the MSI file directly at the command line, all that's happening is that it runs MSIEXEC for you. This association is stored in the registry. You can see a list of associations by (in Windows Explorer) going to Tools / Folder Options / File Types.
For example, you can run a .DOC file from the command line, and WordPad or WinWord will open it for you.
If you look in the registry under `HKEY_CLASSES_ROOT\.msi`, you'll see that .MSI files are associated with the ProgID "Msi.Package". If you look in `HKEY_CLASSES_ROOT\Msi.Package\shell\Open\command`, you'll see the command line that Windows actually uses when you "run" a .MSI file.
Problem
`msiexec` is command prompt software that installs an MSI program. But I have found that you can install an MSI file from the command line by just typing in the name of the MSI file on the command line. But in order to uninstall the MSI file, it seems you have to call the `msiexec` program and give it a `/x` or `/uninstall`. How can I uninstall an MSI from the command line without using the `msiexec` routine?
Related problems
- How can I find the product GUID of an installed MSI setup?
- Windows Installer and the creation of WiX
- What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc
- What is the purpose of administrative installation initiated using msiexec /a?
- Find GUID From MSI File
- Where the MSI file is copied after the installation?
- Why does MSI require the original .msi file to proceed with an uninstall?
- How can I uninstall an application using PowerShell?