Добавить создание контекстного меню в шаблон WixUI_Mondo по умолчанию
У меня есть следующая (по умолчанию) разметка для моего проекта установщика WiX:
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='Acme' Name='Acme'>
<Directory Id='INSTALLDIR' Name='Foobar 1.0'>
<Component Id='MainExecutable' Guid='*'>
<File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1'
Source='FoobarAppl10.exe' KeyPath='yes'>
<Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir"
Name="Foobar 1.0" WorkingDirectory='INSTALLDIR'
Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
<Shortcut Id="desktopFoobar10" Directory="DesktopFolder"
Name="Foobar 1.0" WorkingDirectory='INSTALLDIR'
Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
</File>
</Component>
<Component Id='HelperLibrary' Guid='*'>
<File Id='HelperDLL' Name='Helper.dll' DiskId='1'
Source='Helper.dll' KeyPath='yes' />
</Component>
<Component Id='Manual' Guid='*'>
<File Id='Manual' Name='Manual.pdf' DiskId='1'
Source='Manual.pdf' KeyPath='yes'>
<Shortcut Id="startmenuManual" Directory="ProgramMenuDir"
Name="Instruction Manual" Advertise="yes" />
</File>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="Foobar 1.0">
<Component Id="ProgramMenuDir" Guid="*">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]'
Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
Он компилируется в следующий MSI:
Мне интересно, могу ли я добавить опцию "Создать ярлыки на рабочем столе" в это дерево установки, чтобы пользователи могли выбрать или удалить ее?
1 ответ
Вам просто нужно переместить элементы Shortcut в их собственные компоненты и добавить их в новую функцию.
Это руководство делает это следующим образом: Как: создать ярлык в меню "Пуск"