为什么Major upgrade(迁移)后有两个快捷方式? [英] why two shortcuts after Major upgrade (migration)?

查看:16
本文介绍了为什么Major upgrade(迁移)后有两个快捷方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 WiX 进行 Windows 安装.

We are using WiX for our windows installation.

我们一直支持重大升级,直到最近才出现任何问题.

We were supporting major upgrade without any issues until recently.

当我们更改产品名称时,我被要求更改快捷方式名称.所以我改了.

I was asked to change the shortcut name as we changed our product name. So i changed it.

重大升级后,显示的是 2 个快捷方式,而不是一个.

After a major upgrade, 2 shortcuts are being displayed instead of one.

美妙的是,当我们在同一台机器上安装所有迁移的功能时,它似乎正确地删除了旧的快捷方式.

The beauty is while we are installing all the feature migrated in same machine ,it deleted the old shortcut properly it seems.

但是当我们在 (webserver) 机器上安装其中一项功能 (webserver feature) 时,会出现 2 个快捷方式.

But when we are installing one of the features (webserver feature ) in (webserver) machine, 2 shortcuts appear.

我确认在 webserver 功能中也添加了快捷方式组件.

I verified that the shortcut component is also added in webserver feature.

 <DirectoryRef Id="ProgramMenu.OrganizationName.MyProj">
          <Component Id="CoreInterface_Shortcuts" Guid="3e3c3733-9b53-42cf-a641-b5b3e3da88cf">
            <Shortcut Id="MyOrgMESUrl" Name="Home" Description="MyOrg Intuition URL" Target="[INSTALLDIR]MyOrg MES.url" WorkingDirectory="INSTALLDIR"/>
            <RemoveFolder Id="RemProgramMenu.MyOrg" Directory="ProgramMenu.MyOrg" On="uninstall"/>
            <RemoveFolder Id="RemProgramMenu.MyOrg.MyProj" Directory="ProgramMenu.MyOrg.MyProj" On="uninstall"/>
            <RegistryValue Root="HKCU" Key="Software\MyOrg\MyProj" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
          </Component>
        </DirectoryRef>

<Feature Id="WEBSERVER" Title="WEBSERVER Customized Component(s)" Level="1">
      <ComponentRef Id="CoreInterface_Shortcuts"/>
</Feature>

为什么它会保留旧的快捷方式(如果单击旧的快捷方式则不起作用)?如何避免这种情况?

Why does it maintain old shortcut (If old shortcut is clicked it is not working)? How to avoid this?

推荐答案

原因很简单.您没有遵循最佳做法.

the reason is easy. you are not following the best practices.

更改名称时,必须更改组件 guid.

When you change names, you have to change the component guid.

查看文档:

任何未通过测试显示与组件以前版本兼容的更改.在这种情况下,您还必须更改组件中每个资源的名称或目标位置.

Any change that has not been shown by testing to be compatible with previous versions of the component. In this case, you must also change the name or target location of every resource in the component.

组件中任何文件、注册表项、快捷方式或其他资源的名称或目标位置的更改.在这种情况下,您还必须更改组件中每个资源的名称或目标位置.

A change in the name or target location of any file, registry key, shortcut, or other resource in the component. In this case, you must also change the name or target location of every resource in the component.

从组件中添加或删除任何文件、注册表项、快捷方式或其他资源.在这种情况下,您还必须更改组件中每个资源的名称或目标位置.

The addition or removal of any file, registry key, shortcut, or other resource from the component. In this case, you must also change the name or target location of every resource in the component.

更改组件代码 (视窗)

更新只会重新安装/覆盖文件.源文件和名称取自新的 msi.当您重命名文件/快捷方式时,对旧文件名的引用会丢失.这就是为什么旧链接没有被安装程序覆盖的原因.

A update only reinstalls/overwrites files. the sourcefiles and names are taken from the new msi. the reference to the old filename gets lost, when you are rename a file/shortcut. this is the reason why the old link is untouched und not overwritten by the installer.

这篇关于为什么Major upgrade(迁移)后有两个快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆