我正在使用WiX工具包v3.11创建我的软件的设置。在安装过程中,我使用以下代码创建了startmenu快捷方式:
<Shortcut Id='startmenuMyProgram'
Name='$(var.MyProgramName)'
Directory='ProgramMenuFolder'
WorkingDirectory='APPLICATIONFOLDER'
Advertise='yes'
Icon='icon.exe'>
<Icon Id='icon.exe' SourceFile='$(var.Setuppath)\MyProgram.exe'/>
</Shortcut>通过这种方式,我还为其他可执行文件创建了两个快捷方式。现在,对于卸载,我想删除快捷键。
<Component Id="removeStartmenuShortcuts" Guid="803ad14a-feab-4901-b9db-2c4a1298ae8b">
<Condition>(REMOVE=ALL) AND NOT (WIX_UPGRADE_DETECTED OR UPGRADINGPRODUCTCODE)</Condition>
<RemoveFile Id="remove_startmenuProgram1" Name="startmenuMyProgram" On="uninstall" />
<RemoveFile Id="remove_startmenuProgram2" Name="startmenuMyProgram2" On="uninstall"/>
<RemoveFile Id="remove_startmenuProgram3" Name="startmenuMyProgram3" On="uninstall"/>
</Component>当我卸载软件时,这是没有任何问题的。但在执行更新时,快捷方式也会被删除。但是我想阻止这种行为,但这种情况似乎不起作用。所以当我进行更新时,Windows任务栏中的所有快捷方式都会被删除。
如何才能使我的更新进度正常工作?
下面是更新后的行为:

缺少右侧所有快捷键的组!
发布于 2017-05-22 16:42:18
您可以组合2个组件。这样你就不需要使用条件语句了。
注册表值是在component下设置一个keypath。
<Component Id="cmpstartmenuMyProgram" Guid="{67CB4F7A-5028-4697-A47F-DE99110B9645}">
<Shortcut Id="Shortcut.ApplicationName"
Name="ApplicationName"
Target="[INSTALLDIR]ApplicationName.exe"
WorkingDirectory="INSTALLDIR"
Directory="StartMenuFolder"
Icon="Icon.exe"/>
<RemoveFile Id="RemoveStartMenuShortcut.ApplicationName" Name="ApplicationName" Directory="StartMenuFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Compony\ComponyName" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>https://stackoverflow.com/questions/44065030
复制相似问题