I have tried many of the common approaches(MSI, PowerShell) to silently uninstalling the following application:
MSI
$ReportViewer2012 = Get-WmiObject -Class Win32_Product -Filter "Name = 'Microsoft Report Viewer 2012 Runtime'" | Select-Object -Expand IdentifyingNumber
if ($ReportViewer2012)
{
echo "Unistalling: Microsoft Report Viewer 2012 Runtime"
msiexec /passive /x $ReportViewer2012 | Out-Null
}
Powershell
(Get-WMIObject Win32_Product -Filter 'name="Microsoft Report Viewer 2012 Runtime"').Uninstall()
Without any effect, I did however get a verbose log for the output(/L*V):
MSI (s) (20:84) [14:42:57:903]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
MSI (s) (20:84) [14:42:57:903]: Note: 1: 1706 2: -2147483647 3: ReportViewer.msi
MSI (s) (20:84) [14:42:57:903]: SOURCEMGMT: Processing URL source list.
MSI (s) (20:84) [14:42:57:903]: Note: 1: 1402 2: UNKNOWN\URL 3: 2
MSI (s) (20:84) [14:42:57:903]: Note: 1: 1706 2: -2147483647 3: ReportViewer.msi
MSI (s) (20:84) [14:42:57:903]: Note: 1: 1706 2: 3: ReportViewer.msi
MSI (s) (20:84) [14:42:57:903]: SOURCEMGMT: Failed to resolve source
MSI (s) (20:84) [14:42:57:903]: MainEngineThread is returning 1612
MSI (s) (20:5C) [14:42:57:904]: User policy value 'DisableRollback' is 0
MSI (s) (20:5C) [14:42:57:904]: Machine policy value 'DisableRollback' is 0
MSI (s) (20:5C) [14:42:57:904]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (20:5C) [14:42:57:905]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
MSI (s) (20:5C) [14:42:57:905]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
MSI (s) (20:5C) [14:42:57:905]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (E8:EC) [14:42:57:906]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (E8:EC) [14:42:57:906]: MainEngineThread is returning 1612
This subject is discussed here but with no conclusion. I'm wondering what is causing the issue and how to resolve it?
Just so it is clear, it is not normal behavior for Windows Installer to ask for the installation source for an installed product to allow uninstall.
Quick Fix? Maybe look under "Uninstall MSI" below for the
Microsoft Install / Uninstall Tool
which you can use to try to resolve the situation with your un-uninstallable MSI package in a quick, automatic and - I believe - reliable fashion.
UPDATED: The Microsoft tool, should be able to resolve your problem. The rest of this answer is written in the spirit of "let's obsess over this" :-) and tries to explain potential causes as well as some other fixes.
Also see below for how to do verbose, debug logging to gather more "intel" for your particular uninstall / install problem (could pinpoint the exact culprit in the MSI - for example a specific custom action).
The likely, potential causes of your problem are:
anti-virus blocking
, disk space issues
, user / admin tinkering
, system restore
, etc...The following log entry makes me suspect an anti-virus blocking issue, however a missing resource requiring original source resolution is just as likely:
SOURCEMGMT: Source is invalid due to missing/inaccessible package.
Since the anti-virus does not seem to block the full, downloaded MSI of yours from running, I am led to believe that the issue is a missing resource that the MSI is trying to erronously resolve and retrieve from the source media during uninstall. Likely a MSI design issue - will check more tomorrow.
Full, verbose, debug logging might provide further clues:
msiexec.exe /x {ProductCode} /L*vx! C:\Your.log
(logging details from installsite.org).The text below was written before deciding to suggest the above three primary candidate causes. Leaving in the content for reference.
Microsoft Install / Uninstall Tool: there is a tool from Microsoft available for the case where unresolvable install / uninstall problems occur: Fix problems that block programs from being installed or removed.
The normal approach to uninstall an existing installation, is generally to use the product GUID of the product in question and kick off the uninstall as follows - silent uninstall with verbose logging:
msiexec.exe /x {00000000-0000-0000-0000-00000000000C} /QN /L*V "C:\My.log" REBOOT=ReallySuppress
Quick Parameter Explanation:
/X = run uninstall sequence
{00000000-0000-0000-0000-00000000000C} = product code for product to uninstall
/QN = run completely silently
/L*V "C:\My.log"= verbose logging at specified path
REBOOT=ReallySuppress = avoid unexpected, sudden reboot
You already have the list of other uninstall approaches (my favorite is section 3).
I am no good at Powershell, but here is an answer from earlier on its use to install / uninstall products: How can I use powershell to run through an installer? Maybe check that new Windows Installer PowerShell Module linked
to at the top.
The below is partially explained in the answer you link to above (section 12), but I will contextualize it here:
%SystemRoot%\Installer
during original installation. This folder is super-hidden, you may need to show operating system files to see it in Windows Explorer. Windows Key + R + paste %SystemRoot%\Installer
+ hit ENTER. Read next bullet point before searching for your MSI.View => Status Bar
).ResolveSource
. I believe this could trigger the problem you describe. I suppose the MSI could also contain custom actions that could trigger the problem as well - I am not sure.
ResolveSource
issues - frankly I am not even sure if this standard action can be used anymore. There are many custom actions though - several of which look suspicious. I can not install the MSI to test (lacking pre-reqs).%SystemRoot%\Installer
- either because it was never cached there during installation, or because it was removed or blocked by some later process or mechanism. Some possible causes (just theories):
%SystemRoot%\Installer
to network locations or other partitions because their SSD system disk is out of space. Perfectly understandable, but this can cause complete failure for MSI operations. See this answer for the problem and some suggested workarounds.Some Links: