Question

When our product upgrades on a Windows Server 2012 machine, the old shortcut is left behind in the Start menu. The executable is removed from the system, but the old shortcut remains which causes an error when a user clicks it since it is not longer on the system.

This does not happen on windows 2008 R2, and I do not think there is a problem with how our msi is built. I am asking the question here to see if others have experienced the same issue.

In case it may help, we are building the msi with WiX and here is the code snippet:

<DirectoryRef Id="The_ShortCut">
  <Component Id="The_ShortCut" Guid="{our-guid}">
    <Shortcut Id="TheShortCut.exe"
                                Name="Config Wizard"
                                Description="$(var.ProductNameLong)"
                                Target="[ShortCutFolder]OurCompany.Product.TheShortCut.exe"
                                WorkingDirectory="ShortCutFolder"
              Icon="TheShortcutIcon.Ico">
      <Icon Id="TheShortcutIcon.Ico" SourceFile="oursourcepath"/>
    </Shortcut>
    <RegistryValue Root="HKCU" Key="Software\OurCompany\OurProduct" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
    <RemoveFolder Id="Remove_Product" Directory="OurCompany"  On="uninstall"/>
    <RemoveFolder Id="Remove_Product_ShortCut" Directory="OurProduct_ShortCut" On="uninstall"/>
  </Component>
</DirectoryRef>
Was it helpful?

Solution

I got this satisfactory answer from a coworker:

This doesn’t look like an issue with your package itself. The pinned item is just a reference to the *.lnk file at the location you had when you first pinned it. If you right-click the broken tile after upgrade and go to file location, it takes you the old shortcut folder (which no longer exists since the folder path has been changed).

It all seems like expected behavior. Judging from this thread, I’m not sure there’s a way to update the pinned item programmatically either.

Cheers!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top