我在设置作为WiX脚本一部分创建的快捷方式的工作目录时遇到问题。这里有最基础的:为WiX快捷方式设置工作目录
<!-- create a start menu shortcut. -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="My Name">
<Component Id="ApplicationShortcut" Guid="822A26AF-5231-4EDA-A18D-5DF15020BD94">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="My Name"
Description="My Description"
Target="[INSTALLLOCATION]My.exe"
WorkingDirectory="INSTALLLOCATION" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
</Component>
</Directory>
</Directory>
<!-- Install the app. -->
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="My Name">
<Component Id="ProductComponent" Guid="4740357A-69D3-4626-A0F7-D0667C93A2CE">
<File Id="My.exe" Name="My.exe" Source="My.exe" />
</Component>
</Directory>
</Directory>
这jives与我见过的例子,在弹出的快捷被创建,并指向正确的exe文件,但该快捷方式有没有指定的工作目录,因此应用程序没有按”找到它的本地资源。
这会在程序文件目录中创建快捷方式,而不是在开始菜单中 - 但该快捷方式至少设置了正确的工作目录。 – 2010-10-06 21:56:27
其实这非常有用 - 我想你打算有嵌套在文件元素中的快捷方式元素。谢谢! – 2010-10-06 22:26:15
其实我把它选错了。不要成为File的子项是正确的,因为作为广告的快捷方式,它指向组件的密钥文件。看到这个例子:http://iswix.codeplex.com/SourceControl/changeset/view/53668#841603 – 2010-10-06 22:38:47