我想在程序菜单中添加一个快捷方式。我试过了:
<Component Id='myId' Guid='E4DED108-0129-4a5b-83FE-C9D1E3025B00'>
<File Id='MyFileID' Name='Prog.exe' DiskId='1' Source='.\Prog.exe' KeyPath='yes'>
<Shortcut Id='myShortcut' Name='Prog' Icon='MyIcon.exe' IconIndex='0' Directory='ProgramMenuDir' Advertise='yes' />
</File>
</Component>
但安装程序在程序菜单的子文件夹中添加快捷方式!为什么以及如何避免这种情况?
谢谢Micha
答案 0 :(得分:2)
您可以尝试将Directory ='ProgramMenuDir'更改为Directory ='ProgramMenuFolder',否则创建一个单独的快捷方式组件;
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramMenuFolder">
<Component Id="Shortcuts" Guid="{}">
<Shortcut Id='myShortcut' Name='Prog' Icon='MyIcon.exe' IconIndex='0' Directory='ProgramMenuFolder' WorkingDirectory='INSTALLDIR' Target="[INSTALLDIR]Prog.exe" />
<RegistryValue Root='HKCU' Key='SOFTWARE\prog\prog' Type='string' Value='1' KeyPath='yes' />
</Component>
</Directory>
<!-- other files -->
</Directory>