Sfoglia il codice sorgente

Add desktop shortcut option and improve installer appearance.

Ian Walton 3 anni fa
parent
commit
99ed54e856
4 ha cambiato i file con 31 aggiunte e 4 eliminazioni
  1. 2 0
      bundle/win/Bundle.wxs
  2. 1 0
      bundle/win/HyperlinkTheme.wxl
  3. 22 0
      bundle/win/JMP.wxs
  4. 6 4
      bundle/win/pmstheme.xml

+ 2 - 0
bundle/win/Bundle.wxs

@@ -83,6 +83,7 @@
       Path='[PreviousInstallFolder]' Variable='InstallFolder' After='PreviousInstallFolderSearch' Condition='PreviousInstallFolder' />
 
     <Variable Name="LaunchTarget" Value="[InstallFolder]\JellyfinMediaPlayer.exe"/>
+    <Variable Name="AddDesktopShortcut" Value="1" />
 
     <!-- Is Media Feature Pack present? (This should be enough for detecting if we are running on Windows N or not) -->
     <util:FileSearch Variable="FoundMfPlatDll" Path="[SystemFolder]mfplat.dll" Result="exists" />
@@ -242,6 +243,7 @@
         <MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
         <MsiProperty Name="AUTOLAUNCH" Value="[autolaunch]" />
         <MsiProperty Name="WINDOWSTYPE" Value="[WinRegInstallationType]" />
+        <MsiProperty Name="ADDDESKTOPSHORTCUT" Value="[AddDesktopShortcut]" />
       </MsiPackage>
       <ExePackage Id="vcredist_repair"
                   SourceFile="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Redist\MSVC\v142\vcredist_x64.exe"

+ 1 - 0
bundle/win/HyperlinkTheme.wxl

@@ -46,4 +46,5 @@
   <String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String>
   <String Id="FailureRestartButton">&amp;Restart</String>
   <String Id="FailureCloseButton">&amp;Close</String>
+  <String Id="DesktopShortcutCheckbox">Desktop Shortcut</String>
 </WixLocalization>

+ 22 - 0
bundle/win/JMP.wxs

@@ -5,6 +5,9 @@
   <?include Global.wxi ?>
   <?include Version.wxi ?>
 
+  <!-- https://stackoverflow.com/questions/4658220/create-shortcut-checkbox -->
+  <!-- https://stackoverflow.com/questions/11868499/create-shortcut-to-desktop-using-wix -->
+  <!-- https://michielsioen.be/2017-12-02-wix-bootstrapper-customization/ -->
 
   <?define FirstProductVersion=0.0.0 ?>
   <?define JellyfinMediaPlayerRegistryKey=Software\Jellyfin\Jellyfin Media Player?>
@@ -86,6 +89,24 @@
       <Directory Id="ProgramMenuFolder">
         <Directory Id="JellyfinStartMenuFolder" Name="Jellyfin Media Player"/>
       </Directory>
+      <Directory Id="DesktopFolder" Name="Desktop">
+        <Component Id="ApplicationShortcutDesktop" Guid="{b2a1316d-917f-433f-bd87-02ec717c2648}">
+            <Condition>ADDDESKTOPSHORTCUT=1</Condition>
+            <Shortcut Id="ApplicationDesktopShortcut"
+                Name="Jellyfin Media Player"
+                Description="Desktop client for Jellyfin"
+                Target="[INSTALLLOCATION]JellyfinMediaPlayer.exe"
+                WorkingDirectory="INSTALLLOCATION"/>
+            <RemoveFolder Id="DesktopFolder" On="uninstall"/>
+            <RegistryValue
+                Root="HKCU"
+                Key="Software\Jellyfin\Jellyfin Media Player"
+                Name="installed"
+                Type="integer"
+                Value="1"
+                KeyPath="yes"/>
+        </Component>
+      </Directory>
     </Directory>
     
     <!-- Start Menu shortcut -->
@@ -111,6 +132,7 @@
     <Feature Id="ProductFeature" Title="Jellyfin" Level="1">
       <ComponentGroupRef Id="ProgramFilesComponentGroup" />
       <ComponentRef Id="JellyfinMediaPlayerShortcuts" />
+      <ComponentRef Id="ApplicationShortcutDesktop" />
     </Feature>
 
   </Product>

+ 6 - 4
bundle/win/pmstheme.xml

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
   <Window Width="485" Height="390" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
-  <Font Id="0" Height="-12" Weight="500" Foreground="FFFFFF" Background="1F1F1F">Segoe UI</Font>
+  <Font Id="0" Height="-12" Weight="500" Foreground="FFFFFF" Background="000000">Segoe UI</Font>
   <Font Id="1" Height="-24" Weight="500" Foreground="FFFFFF">Segoe UI</Font>
   <Font Id="2" Height="-22" Weight="500" Foreground="666666">Segoe UI</Font>
-  <Font Id="3" Height="-12" Weight="500" Foreground="FFFFFF" Background="1F1F1F">Segoe UI</Font>
-  <Font Id="4" Height="-12" Weight="500" Foreground="ff0000" Background="1F1F1F" Underline="yes">Segoe UI</Font>
+  <Font Id="3" Height="-12" Weight="500" Foreground="FFFFFF" Background="000000">Segoe UI</Font>
+  <Font Id="4" Height="-12" Weight="500" Foreground="ff0000" Background="000000" Underline="yes">Segoe UI</Font>
   <Font Id="5" Height="-24" Weight="500" Foreground="a75dc3">Segoe UI</Font>
   
   <Text X="11" Y="26" Width="-11" Height="30" FontId="5" Visible="yes" DisablePrefix="yes" Center="yes">#(loc.Title)</Text>
-  <Image X="200" Y="75" Width="85" Height="85" ImageFile="jellyfin-chevron-85.png" Visible="yes" />
+  <Image X="197" Y="75" Width="85" Height="85" ImageFile="jellyfin-chevron-85.png" Visible="yes" />
 
   <Page Name="Help">
     <Text X="65" Y="180" Width="-65" Center="yes" Height="30" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Text>
@@ -26,6 +26,8 @@
     <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.InstallOptionsButton)</Button>
     <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
     <Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallCloseButton)</Button>
+    <Checkbox Name="AddDesktopShortcut" X="11" Y="-11" Width="13" Height="17" FontId="0" TabStop="yes"></Checkbox>
+    <Text X="25" Y="-10" Width="200" Height="17" FontId="0" DisablePrefix="yes">#(loc.DesktopShortcutCheckbox)</Text>
   </Page>
   <Page Name="Options">
     <Text X="11" Y="170" Width="-11" Height="30" FontId="2" DisablePrefix="yes" Center="yes">#(loc.OptionsHeader)</Text>