我正在尝试使用wix在某个文件夹下添加多个快捷方式。代码如下:
<DirectoryRef Id ="TARGETDIR">
<Directory Id="DesktopFolder" Name="DesktopFolder">
<Component Id="DesktopP" Guid="61AE5ABE-9ED2-43B0-98C4-3050A40BF061">
<Shortcut Id="DesktopMyProgramShortcut" Name="$(var.MyProgramLabelShortcut)" Target="[#MyProgramcsproja015777b77a239eeb0bd49c2dafdbe31]" WorkingDirectory="bin"/>
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="SOFTWARE\Example\Shortcuts" Name="167CE804-4A37-45B8-B010-EB6B3E73BE54" Type="string" Value="" KeyPath="yes"/>
</Component>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id ="ProgramMenuFolderMyProgram" Name ="$(var.MyProgramLabelShortcut)">
<Component Id="ProgramMenuMyProgram" Guid="A7B4A27B-9367-4AFF-B8CC-D6651B18FBFD">
<Shortcut Id="ProgramMenuMyProgramShortcut" Name="$(var.MyProgramLabelShortcut)" Target="[#MyProgramcsproja015777b77a239eeb0bd49c2dafdbe31]" WorkingDirectory="bin"/>
<Shortcut Id="ProgramMenuMyProgramManual" Name="$(var.MyProgramLabelShortcut)" Target="[documents]" Icon="shell32.dll" IconIndex="45"/>
<RemoveFolder Id="ProgramMenuFolderMyProgram" On="uninstall"/>
<RegistryValue Root="HKCU" Key="SOFTWARE\Example\Shortcuts" Name="167CE804-4A37-45B8-B010-EB6B3E73BE54" Type="string" Value="" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
</DirectoryRef>
奇怪的行为是,当我尝试放置多个快捷方式时,只添加了第二个快捷方式。我试过把
Shortcut
分开
Components
但仍然是这样。顺便说一下,在Windows7中工作得很好。
有什么关于如何修理的建议吗?
事先谢谢!