1

I have an installed product that has somehow gotten into a state in which the advertised shortcuts will trigger self healing twice and then quit. This all used to work fine, but now uninstall also won't remove the files and I can't seem to get back to a clean state.

When self healing is triggered there is an MsiInstaller 1001 Warning event: Detection of product '{79D7389C-5858-48EE-B250-E84E789F8683}', feature 'CurrentUser' failed during request for component '{789CBE30-0F16-46CA-BA06-464AD61A458E}'

The component GUID is my MainExe Component:

<Component Id="MainExe" Guid="{789CBE30-0F16-46CA-BA06-464AD61A458E}">
   <File Id="MyProgram.exe" Name="MyProgram.exe" Source="MyProgram.exe" KeyPath="yes" />
   <Shortcut Id="StartMenuShortcut" Name="My Program" Directory="StartMenuDir" Icon="Icon.exe" IconIndex="0" Advertise="yes" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
   <Shortcut Id="DesktopShortcut" Name="My Program" Directory="DesktopFolder" Icon="Icon.exe" IconIndex="0" Advertise="yes" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
</Component>

There are no other Warning events.

The MSI log for the initial installation shows:

MSI (s) (CC:64) [10:46:53:357]: Feature: CurrentUser; Installed: Absent;   Request: Local;   Action: Local
MSI (s) (CC:64) [10:46:53:357]: Feature: CoreFiles; Installed: Absent;   Request: Local;   Action: Local
MSI (s) (CC:64) [10:46:53:357]: Feature: InstallerUI; Installed: Absent;   Request: Local;   Action: Local
MSI (s) (CC:64) [10:46:53:357]: Component: MainExe; Installed: Absent;   Request: Local;   Action: Local;   Client State: Unknown

Yet the MSI log for the repair shows:

MSI (s) (CC:EC) [10:47:50:769]: Feature: CurrentUser; Installed: Advertise;   Request: Local;   Action: Local
MSI (s) (CC:EC) [10:47:50:770]: Feature: CoreFiles; Installed: Advertise;   Request: Local;   Action: Local
MSI (s) (CC:EC) [10:47:50:770]: Feature: InstallerUI; Installed: Advertise;   Request: Local;   Action: Local
MSI (s) (CC:EC) [10:47:50:770]: Component: MainExe; Installed: Absent;   Request: Local;   Action: Local;   Client State: Unknown

I tried running the Unadvertise Features script but it tells me:

$ cscript.exe //nologo Unadvertise.wsf /ProductCode:{79D7389C-5858-48EE-B250-E84E789F8683}
Checking if product {79D7389C-5858-48EE-B250-E84E789F8683} is installed
Product {79D7389C-5858-48EE-B250-E84E789F8683} is installed as AAA My Program
Checking for advertised features in product {79D7389C-5858-48EE-B250-E84E789F8683}
Found feature CurrentUser : Local
Found feature CoreFiles : Local
Found feature InstallerUI : Local
Product {79D7389C-5858-48EE-B250-E84E789F8683} does not have advertised features

How do I diagnose the issue, or at least clean the state of this product? Again, uninstall now does not remove the files, and does not solve the problem.

JMH
  • 131
  • 10
  • did you performed an upgrade? maybe that is the moment when the feature got installed as advertised, inheriting the feature install state from the previous version, during MigrateFeatureStates standard action. About cleaning the machine, that might be tricky, don't have an exact solution, usually I test on VMs so I can easily restore a snapshot when a package breaks it. – Bogdan Mitrache Jan 17 '14 at 10:44

3 Answers3

1

I think what I did wrong was use the no longer available MSI cleanup util, which is the same as or similar to MSIZAP, which can invalidate your MSI database.

Gave up trying to fix my machine, now I do all MSI testing in a VM.

JMH
  • 131
  • 10
  • Yes, it seems most MSI cleanup tools are now deprecated. I believe the only tool that can still be tried as of Aug.2017 is this one: **[Fix problems with programs that can't be installed or uninstalled](https://stackoverflow.com/questions/334490/uninstall-without-an-msi-file/11058378#11058378)** – Stein Åsmul Aug 05 '17 at 13:56
1

Having written the answer below, I have discovered I have answered a similar thread before. I think the issue that is affecting your package is that there is a key path set to a file installed to the userprofile. See full details here: How can I determine what causes repeated Windows Installer self-repair? . I will leave the answer below as an alternative way to explain the problem.


What is the name of this application? There are cases with cyclical self-repair that occur because the key-path for a component is set to an empty folder and not a full path to a file. Windows Installer has a tendency to remove empty folders unless you add a CreateFolder entry for the folder in the MSI. Quite ridiculous, but this is how the technology works.

I haven't seen this problem for years, but this is roughly what happens:

  1. A component key path is missing
  2. An advertised shortcut is invoked
  3. A component is found missing by keypath check and is scheduled for installation
  4. Something fails during the installation, and the key path is still missing
  5. The next time the advertised shortcut is invoked self-repair repeats the cycle to no avail

One reason this happens is if the target location is write protected for some reason. There are other cases too, such as when the target location is hard coded to a location in the user profile that doesn't exist for the logged on user - for example another users profile:

  • C:\Users\User\MyFile.ini
  • C:\Users\AnotherUser\MyFile.ini

Here is a good allround explanation on the issue of self-healing: http://www.installsite.org/pages/en/msifaq/a/1037.htm

Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
0

If nothing else helps you can always remove the Application manually (e.g. delete all belonging files and the shortcut) and correct the Installer Database using MSIZAP (deprecated, unsupported and unsafe tool on newer versions of Windows. Aug.2017).

Afterwards install the MSI again and check if the error persists, if so there is something wrong with the MSI itself.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
weberik
  • 2,636
  • 1
  • 18
  • 11
  • MSIZAP is [dangerous](http://robmensching.com/blog/posts/2009/3/6/more-on-haacks-troubleshooting-windows-msi-installers) and more or less how I got myself into this mess. – JMH Mar 10 '14 at 19:16