我现在正在使用Visual Studio 2019,并遵循了有关使用Microsoft Extension创建安装程序项目的指南,用于创建安装程序项目。我已经创建了主项目输出,还创建了开始菜单和桌面的快捷方式。但是,我有一个要求将“桌面”快捷方式设置为可选的请求,但我看不到在哪里可以执行此操作。
还有其他人解决过这个问题吗?
对于Wix Toolset中的可选内容,请使用高级安装程序UI中的Feature element。>
WXS功能块
<Feature Id="StartMenuShortcut" Title="My StartMenuShortcut" Description="Foo Bar ... Shortcut" Level="1" AllowAdvertise="no" Display="expand" InstallDefault="local" TypicalDefault="install"> <ComponentRef Id="ShortcutsStartmenuStartProduct" /> </Feature>
快捷方式的WXS块
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Guid="nguid" Id="ApplicationShortcut">
<Shortcut Id="OptionalShortcut"
Name="FooBar"
Target="BarFoo"/>
</Component>
</DirectoryRef>