Make desktop shortcut optional

This commit is contained in:
Christoph Stahl 2025-02-16 15:33:10 +01:00
parent 6db66b1488
commit 1d4ae2de84

View file

@ -9,7 +9,14 @@
Version="2.1.0"> Version="2.1.0">
<MediaTemplate EmbedCab="yes" /> <MediaTemplate EmbedCab="yes" />
<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." /> <MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" /> <Property Id="INSTALLDESKTOPSHORTCUT" Value="0"/>
<UI>
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" />
<ui:WixUIDialog Id="ExitDialog">
<Control Id="DesktopShortcutCheckbox" Type="CheckBox" X="15" Y="180" Width="320" Height="17"
Property="INSTALLDESKTOPSHORTCUT" CheckBoxValue="1" Text="Create a desktop shortcut"/>
</ui:WixUIDialog
</UI>
<WixVariable Id="WixUILicenseRtf" Value="agpl-3.0.rtf" /> <WixVariable Id="WixUILicenseRtf" Value="agpl-3.0.rtf" />
<Icon Id="syng.ico" SourceFile="..\syng.ico"/> <Icon Id="syng.ico" SourceFile="..\syng.ico"/>
<Property Id="ARPPRODUCTICON" Value="syng.ico" /> <Property Id="ARPPRODUCTICON" Value="syng.ico" />
@ -19,7 +26,7 @@
<File KeyPath="yes" Source="syng\syng.exe" Name="syng.exe"></File> <File KeyPath="yes" Source="syng\syng.exe" Name="syng.exe"></File>
<Shortcut Id="startmenuShortcut" <Shortcut Id="startmenuShortcut"
Directory="ProgramMenuDir" Directory="ProgramMenuDir"
Name="syng" Name="Syng Karaoke Player"
WorkingDirectory='INSTALLFOLDER' WorkingDirectory='INSTALLFOLDER'
Icon="syng.ico" Icon="syng.ico"
IconIndex="0" IconIndex="0"
@ -29,13 +36,6 @@
Target="[SystemFolder]msiexec.exe" Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]" Arguments="/x [ProductCode]"
Description="Uninstalls Syng" /> Description="Uninstalls Syng" />
<Shortcut Id="desktopShortcut"
Directory="DesktopFolder"
Name="syng"
WorkingDirectory='INSTALLFOLDER'
Icon="syng.ico"
IconIndex="0"
Advertise="yes" />
</Component> </Component>
<Directory Id="DataDir" Name="data"> <Directory Id="DataDir" Name="data">
</Directory> </Directory>
@ -46,6 +46,17 @@
<Exclude Files="syng\syng.exe" /> <Exclude Files="syng\syng.exe" />
</Files> </Files>
</ComponentGroup> </ComponentGroup>
<Component Id="DesktopShortcut">
<Shortcut Id="desktopShortcut"
Directory="DesktopFolder"
Name="Syng Karaoke Player"
WorkingDirectory='INSTALLFOLDER'
Icon="syng.ico"
IconIndex="0"
Advertise="yes" />
<RegistryValue Root="HKCU" Key="Software\rocks.syng.Syng" Name="Installed" Type="integer" Value="1" KeyPath="yes"/>
<Condition><![CDATA[INSTALLDESKTOPSHORTCUT=1]]></Condition>
</Component>
<StandardDirectory Id="ProgramMenuFolder"> <StandardDirectory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="syng"/> <Directory Id="ProgramMenuDir" Name="syng"/>
</StandardDirectory> </StandardDirectory>
@ -53,5 +64,7 @@
<Feature Id="syng"> <Feature Id="syng">
<ComponentRef Id="ProductComponent" /> <ComponentRef Id="ProductComponent" />
<ComponentGroupRef Id="DataFiles" /> <ComponentGroupRef Id="DataFiles" />
<Condition Level="1"><![CDATA[INSTALLDESKTOPSHORTCUT=1]]></Condition>
<ComponentRef Id="DesktopShortcut"/>
</Feature></Package> </Feature></Package>
</Wix> </Wix>