加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

wix – 为什么在重大升级(迁移)后有两个快捷方式?

发布时间:2020-12-14 02:01:03 所属栏目:Windows 来源:网络整理
导读:我们正在使用WiX进行 Windows安装. 直到最近,我们才支持主要升级,没有任何问题. 当我们更改产品名称时,我被要求更改快捷方式名称.所以我改变了它. 主要升级后,显示2个快捷方式而不是一个. 美妙的是,当我们安装在同一台机器上迁移的所有功能时,它似乎正确地删
我们正在使用WiX进行 Windows安装.

直到最近,我们才支持主要升级,没有任何问题.

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

主要升级后,显示2个快捷方式而不是一个.

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

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

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

<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="SoftwareMyOrgMyProj" 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>

为什么它保持旧的快捷方式(如果单击旧的快捷方式它不起作用)?怎么避免这个?

解决方法

原因很简单.
你没有遵循最佳实践.

更改名称时,必须更改组件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,or other resource from the component. In this case,you must also change the name or target location of every resource in the component.

Changing the Component Code (Windows)

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读