none
MSI Uninstall does not remove/clean registry entries. Unable to run MsiZap

    Question

  • Hi All,

    I have been trying to install an application using the MSI generated from Visual Studio 2005 Setup Project. This MSI installs a Windows Service and a Windows application on my system.

    I had a requirement where I needed to uninstall the application irrespective of whether it was installed "Per-User" or "Per-Machine", while upgrading or removing it. In order to be able to achieve this, I used Orca and incorporated a C++ CustomAction DLL in my MSI. This DLL is called "SetUpgradeContext" and works towards removing registry entries from different registry trees: HKLM and HKCU depending on whether the product was installed "Per-User" or "Per-Machine".

    (Reference: http://www.codeproject.com/KB/install/msi_upgrade_uninstall_pt2.aspx

    This has been working fine for quite sometime now. Recently, I have started facing an issue on some machines where multiple instances of the application are found in the following registry path: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

    When I check in the working directory of the application I find only one version there. Due to multiple entries in registry or remains of a failed installation, I frequently encounter any of the following errors:

    1. A newer version is already installed (when we are trying to install).
    2. This action is valid only for products that are currently installed (while we are trying to uninstall).

    I see that due to some reason, the registry settings have corrupted and I am unable to fix it.

     

    I have also tried running MSIZAP.EXE (version 4.0.6000.16384) with different switches like:

     

    msizap TWG {ProductCode}

    msizap TW {ProductCode} 

    msizap TWA! {ProductCode}

    msizap TWPS {ProductCode}

    msizap T {ProductCode}

     

    Sometimes, the last option (switch T) works, but it does not resolve the problem permanently. Issue comes up again after some time. However, I have not been able to successfully use the switch W. It always fails with some error. Below is the Msizap log for switch TW:

     

    C:\>msizap TW {EF8E42E1-0903-4D8C-8935-D90DABDB1809}  
    MsiZap V 4.0  
    Copyright (c) Microsoft Corporation. All Rights Reserved  
     
     
     
    ***** Zapping data for user S-1-5-18 for product {EF8E42E1-0903-4D8C-8935-D90DAB  
    DB1809} *****  
    MsiZapInfo: Performing operations for user S-1-5-18  
    Searching for the product {EF8E42E1-0903-4D8C-8935-D90DABDB1809} cached package.  
     . .  
    Searching for install property data for product {EF8E42E1-0903-4D8C-8935-D90DABD  
    B1809}. . .  
    Unable to open the HKEY_USERS hive for user S-1-5-18. HKCU data for this user wi  
    ll not be modified.  The hive may not be loaded at this time. (LastError = 2)  
    Searching user's global config location for product {EF8E42E1-0903-4D8C-8935-D90  
    DABDB1809} data. . .  
      Searching for product 1E24E8FE3090C8D498539DD0BABD8190 upgrade codes in Softwa  
    re\Microsoft\Windows\CurrentVersion\Installer\\UpgradeCodes...  
      Searching for patches for product 1E24E8FE3090C8D498539DD0BABD8190 in Software  
    \Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\1E24E8FE3  
    090C8D498539DD0BABD8190\Patches  
      Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-  
    1-5-18\Products\1E24E8FE3090C8D498539DD0BABD8190 for product data. . .  
      Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-  
    1-5-18\Features\1E24E8FE3090C8D498539DD0BABD8190 for product feature data. . .  
    Searching per-machine global config location for product {EF8E42E1-0903-4D8C-893  
    5-D90DABDB1809} data. . .  
      Searching for product 1E24E8FE3090C8D498539DD0BABD8190 upgrade codes in Softwa  
    re\Microsoft\Windows\CurrentVersion\Installer\\UpgradeCodes...  
      Searching for patches for product 1E24E8FE3090C8D498539DD0BABD8190 in Software  
    \Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\1E24E8FE3  
    090C8D498539DD0BABD8190\Patches  
      Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-  
    1-5-18\Products\1E24E8FE3090C8D498539DD0BABD8190 for product data. . .  
      Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-  
    1-5-18\Features\1E24E8FE3090C8D498539DD0BABD8190 for product feature data. . .  
    Searching old global config location for product {EF8E42E1-0903-4D8C-8935-D90DAB  
    DB1809} data. . .  
      Searching for product 1E24E8FE3090C8D498539DD0BABD8190 upgrade codes in Softwa  
    re\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes...  
      Searching for patches for product 1E24E8FE3090C8D498539DD0BABD8190 in Software  
    \Microsoft\Windows\CurrentVersion\Installer\Products\1E24E8FE3090C8D498539DD0BAB  
    D8190\Patches  
      Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Products\1E  
    24E8FE3090C8D498539DD0BABD8190 for product data. . .  
      Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Features\1E  
    24E8FE3090C8D498539DD0BABD8190 for product feature data. . .  
    Searching per-machine location for product {EF8E42E1-0903-4D8C-8935-D90DABDB1809  
    } data. . .  
      Searching for product 1E24E8FE3090C8D498539DD0BABD8190 upgrade codes in Softwa  
    re\Classes\Installer\UpgradeCodes...  
      Searching for patches for product 1E24E8FE3090C8D498539DD0BABD8190 in Software  
    \Classes\Installer\Products\1E24E8FE3090C8D498539DD0BABD8190\Patches  
      Searching HKLM\Software\Classes\Installer\Components for published component d  
    ata for the product {EF8E42E1-0903-4D8C-8935-D90DABDB1809}. . .  
      Searching HKLM\Software\Classes\Installer\Assemblies for .Net assembly data fo  
    r the product {EF8E42E1-0903-4D8C-8935-D90DABDB1809}. . .  
      Searching HKLM\Software\Classes\Installer\Products\1E24E8FE3090C8D498539DD0BAB  
    D8190 for product data. . .  
      Searching HKLM\Software\Classes\Installer\Features\1E24E8FE3090C8D498539DD0BAB  
    D8190 for product feature data. . .  
    Skipping search of old per-user location for product {EF8E42E1-0903-4D8C-8935-D9  
    0DABDB1809} data since the registry hive is not available.  
    Skipping search of per-user location for product {EF8E42E1-0903-4D8C-8935-D90DAB  
    DB1809} data since the registry hive is not available.  
    Searching for product {EF8E42E1-0903-4D8C-8935-D90DABDB1809} in per-user managed  
     location. . .  
      Searching for product 1E24E8FE3090C8D498539DD0BABD8190 upgrade codes in Softwa  
    re\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-18\Installer\Upgrade  
    Codes...  
      Searching for patches for product 1E24E8FE3090C8D498539DD0BABD8190 in Software  
    \Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-18\Installer\Products\  
    1E24E8FE3090C8D498539DD0BABD8190\Patches  
      Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1  
    -5-18\Installer\Products\1E24E8FE3090C8D498539DD0BABD8190 for product data. . .  
      Searching HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1  
    -5-18\Installer\Features\1E24E8FE3090C8D498539DD0BABD8190 for product feature da  
    ta. . .  
    Searching for shared DLL counts for components tied to the product 1E24E8FE3090C  
    8D498539DD0BABD8190. . .  
       HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Components key is no  
    t present.  
    Searching for shared DLL counts for components tied to the product 1E24E8FE3090C  
    8D498539DD0BABD8190. . .  
      Searching for product 1E24E8FE3090C8D498539DD0BABD8190 client info data. . .  
      Searching for product 1E24E8FE3090C8D498539DD0BABD8190 client info data. . .  
    Searching for Installer files and folders associated with the product {EF8E42E1-  
    0903-4D8C-8935-D90DABDB1809}. . .  
      Searching for files and folders in the user's profile. . .  
      Searching for files and folders in the %WINDIR%\Installer folder  
    FAILED to clear all data.  
     
    C:\> 

    The above log is from a Windows 2000 Professional machine.

    Please suggest as to how should I go about it and how to use W switch of Msizap...

    Thanks in advance.

    • Edited by sumitlathwal Thursday, January 29, 2009 4:10 AM Edited Subject
    Wednesday, January 28, 2009 4:21 PM

Answers

  • Once you've used msizap you're in deep stuff. Are you using msizap for the version of MSI on the system? I don't know that 4.0 zap works on older OS versions. They are generally specific to the MSI version.
    "A newer version is already installed" is standard detection from the DetectNewerVersions check in your setup, so that should tell you what's going on. You can't install 1.0 if 2.0 is on the system. The other message might mean that the per-user weirdness in that article stopped working, so you have a per-user and a per-system one installed.  There should be no remains of failed installations (unless you've used msizap) because the installer is transactional - it either all works or all fails, and doesn't leave parts behind.


    Phil Wilson
    • Marked as answer by Kira Qian Wednesday, February 04, 2009 9:16 AM
    Tuesday, February 03, 2009 10:47 PM
    Moderator