使用Windows Server 2012时,在产品升级时未从开始菜单中删除旧快捷方式

时间:2014-01-10 00:19:12

标签: wix windows-installer windows-server-2012

当我们的产品在Windows Server 2012计算机上升级时,旧的快捷方式将保留在“开始”菜单中。可执行文件将从系统中删除,但旧的快捷方式仍然存在,当用户单击它时会导致错误,因为它不在系统上。

这不会发生在Windows 2008 R2上,我认为msi的构建方式不存在问题。我在这里问这个问题,看看其他人是否遇到过同样的问题。

如果有帮助,我们正在使用WiX构建msi,这是代码片段:

<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>

1 个答案:

答案 0 :(得分:0)

我从同事那里得到了这个令人满意的答案:

这看起来不像你的包本身的问题。固定项只是您第一次固定它时所在位置的* .lnk文件的引用。如果在升级后右键单击损坏的磁贴并转到文件位置,则会显示旧的快捷方式文件夹(由于文件夹路径已更改,因此不再存在)。

这似乎都是预期的行为。从this thread判断,我不确定是否有办法以编程方式更新固定项目。

干杯!