(Wix) MSI uninstall is very slow. Log shows slowness is when shortcuts are being removed

Viewed 560

Found a similar question, but the the accepted "answer" is not actually an answer at all: MSIEXEC: "Executing op: ShortcutRemove" step is very slow

Is there a know issue with Wix / Windows Installer being very slow when uninstalling shortcuts?

I have a msi project that creates a lot (85+) of shortcuts in my installation folder. When I install, all goes very quickly and completes successfully in under a minute. However, when I uninstall, it takes in excess of 6-8 minutes. Computer is physical machine with a fast SSD. tested on Windows 10 Pro and Windows Server 2019.

All shortcuts are created on the local C: drive and target files on that same drive.

I am not very experienced with Wix and the Windows Installer, but the uninstall log looks clean to me. Only the ShortcutRemove operations taking longer then expected and every one has "Note: 1: 2318 2: C:\Config.Msi\??????.rbf" (File does not exist). Each ShortcutRemove operation takes 4 to 5 seconds, which obviously adds up because of the (admittedly high) number of shortcuts that I need to create.

From the log, there is about 3 seconds delay between every line showing error "Note: 1: 2318" and the following "Executing op: SetTargetFolder" line.

The project has had this many shortcuts for many years, but I only started noticing the slow down for uninstalls in mid 2019.

Build Environment / Tools

Visual Studio Pro 2017

Wix version 3.11.2.4516

Windows Installer. V 5.0.19041.1

UPDATE 1 - 28-Aug-2020

I suspect that this may be an issue with a Windows o/s patch or new security policy, because I have been using the same .msi and Wix project for a few years and did not see the slow down on Windows 10 prior to mid 2019 - the related post I referenced at the top is from that period as well. I also suspect that this may be happening to many other .msi projects, but the developers are not noticing because they only have a very small (normal) number of shortcuts.

Additionally, I just tested on Windows Server 2016 and found that uninstall is NOT slow on that o/s at all!

FAST: Microsoft Windows Server 2016 Datacenter, Version 1607 (OS Build 14393.3564)

Slow: Microsoft Windows Server 2019 Datacenter, Version 1809 (OS Build 17763.1397)

Slow: Microsoft Windows 10 Pro, Version 2004 (OS Build 19041.450)

This is an extract of the uninstall log:

MSI (s) (98:54) [13:09:59:071]: Using source file security for destination.
MSI (s) (98:54) [13:09:59:073]: Note: 1: 2318 2: C:\Config.Msi\13a736b0.rbf 
MSI (s) (98:54) [13:10:01:503]: Executing op: SetTargetFolder(Folder=23\My Tiny Utilities\)
MSI (s) (98:54) [13:10:01:508]: SHELL32::SHGetFolderPath returned: C:\ProgramData\Microsoft\Windows\Start Menu\Programs
MSI (s) (98:54) [13:10:01:509]: Executing op: ShortcutRemove(Name=lddyopzj|Touch)
MSI (s) (98:54) [13:10:01:513]: Verifying accessibility of file: Touch.lnk
MSI (s) (98:54) [13:10:01:515]: Using source file security for destination.
MSI (s) (98:54) [13:10:01:516]: Note: 1: 2318 2: C:\Config.Msi\13a736b1.rbf 
MSI (s) (98:54) [13:10:03:964]: Executing op: SetTargetFolder(Folder=C:\MyTinyUtilities\Shortcuts\)
MSI (s) (98:54) [13:10:03:966]: Executing op: ShortcutRemove(Name=n5w0rmgl|Touch)
MSI (s) (98:54) [13:10:03:970]: Verifying accessibility of file: Touch.lnk
MSI (s) (98:54) [13:10:03:974]: Using source file security for destination.
MSI (s) (98:54) [13:10:03:977]: Note: 1: 2318 2: C:\Config.Msi\13a736b2.rbf 

This is an extract of my shortcut creation script/code:

  <!--Start Menu Shortcuts-->
  <Fragment>
    <DirectoryRef Id="DirShortcutsStartMenu">
      <Component Win64="no" Id="CMP_Shortcuts_StartMenu" Guid="86F485AE-B257-4E8A-8D06-59EE9161B8F9">

        <RegistryValue Root="HKCU" Key="Software\MyTinyUtil" Name="Start Menu Created" Type="string" Value="Yes" KeyPath="yes" />
        <Shortcut Id="SM_Touch" Name="Touch" Description="Update file modified date" Target="[MTUINSTALLROOT]Touch.exe" />
        ...
        I create about 10 shortcuts on the Start menu path
        ...
        <RemoveFolder Id="Remove01" On="uninstall" />

      </Component>
    </DirectoryRef>
  </Fragment>

  <!-- Shortcut in installation Folder-->
  <Fragment>
    <DirectoryRef Id="DirShortcutsInstallFolder">
      <Component Win64="no" Id="CMP_Shortcuts_InstallFolder" Guid="102EC0F4-03BD-48E9-8086-6D5DA4624FA3">
      
        <RegistryValue Root="HKCU" Key="Software\MyTinyUtil" Name="Duplicate Shortcuts" Type="string" Value="yes" KeyPath="yes" />
        <Shortcut Id="IF_Touch" Name="Touch" Description="Update file modified date" Target="[MTUINSTALLROOT]Touch.exe" Directory="Dir_C_Shortcuts_File_Utils" />
        ...
        I create in excess of 85 shortcuts in a sub-folder of my installation folder.
        ...
        <RemoveFolder Id="Remove02" On="uninstall" />

      </Component>
    </DirectoryRef>
  </Fragment>
0 Answers
Related