|
| 1 | +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" |
| 2 | + xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> |
| 3 | + <Fragment> |
| 4 | + <StandardDirectory Id="ProgramMenuFolder"> |
| 5 | + <Component Id="ApplicationShortcutRoot" Guid="*"> |
| 6 | + <Shortcut Id="ApplicationStartMenuShortcutRoot" |
| 7 | + Name="Sunshine" |
| 8 | + Description="Sunshine Game Stream Host" |
| 9 | + Target="[INSTALL_ROOT]sunshine.exe" |
| 10 | + Arguments="--shortcut" |
| 11 | + WorkingDirectory="INSTALL_ROOT"/> |
| 12 | + <RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="installed_root" Type="integer" Value="1" KeyPath="yes"/> |
| 13 | + </Component> |
| 14 | + <Directory Id="ProgramMenuSubfolder" Name="LizardByte"> |
| 15 | + <Directory Id="ProgramMenuSunshineFolder" Name="Sunshine"> |
| 16 | + <Component Id="ApplicationShortcut" Guid="*"> |
| 17 | + <Shortcut Id="ApplicationStartMenuShortcut" |
| 18 | + Name="Sunshine" |
| 19 | + Description="Sunshine Game Stream Host" |
| 20 | + Target="[INSTALL_ROOT]sunshine.exe" |
| 21 | + Arguments="--shortcut" |
| 22 | + WorkingDirectory="INSTALL_ROOT"/> |
| 23 | + <RemoveFolder Id="CleanUpShortCut" Directory="ProgramMenuSunshineFolder" On="uninstall"/> |
| 24 | + <RemoveFolder Id="CleanUpShortCutParent" Directory="ProgramMenuSubfolder" On="uninstall"/> |
| 25 | + <RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="installed" Type="integer" Value="1" KeyPath="yes"/> |
| 26 | + </Component> |
| 27 | + <Component Id="DocumentationShortcut" Guid="*"> |
| 28 | + <util:InternetShortcut Id="DocumentationLink" |
| 29 | + Name="Sunshine Documentation" |
| 30 | + Target="https://docs.lizardbyte.dev/projects/sunshine" |
| 31 | + Type="url"/> |
| 32 | + <RemoveFolder Id="CleanUpDocsShortCut" Directory="ProgramMenuSunshineFolder" On="uninstall"/> |
| 33 | + <RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="docs_shortcut" Type="integer" Value="1" KeyPath="yes"/> |
| 34 | + </Component> |
| 35 | + <Component Id="WebsiteShortcut" Guid="*"> |
| 36 | + <util:InternetShortcut Id="WebsiteLink" |
| 37 | + Name="LizardByte Web Site" |
| 38 | + Target="https://app.lizardbyte.dev" |
| 39 | + Type="url"/> |
| 40 | + <RemoveFolder Id="CleanUpWebsiteShortCut" Directory="ProgramMenuSunshineFolder" On="uninstall"/> |
| 41 | + <RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="website_shortcut" Type="integer" Value="1" KeyPath="yes"/> |
| 42 | + </Component> |
| 43 | + <Component Id="SupportShortcut" Guid="*"> |
| 44 | + <util:InternetShortcut Id="SupportLink" |
| 45 | + Name="LizardByte Support" |
| 46 | + Target="https://app.lizardbyte.dev/support" |
| 47 | + Type="url"/> |
| 48 | + <RemoveFolder Id="CleanUpSupportShortCut" Directory="ProgramMenuSunshineFolder" On="uninstall"/> |
| 49 | + <RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="support_shortcut" Type="integer" Value="1" KeyPath="yes"/> |
| 50 | + </Component> |
| 51 | + </Directory> |
| 52 | + </Directory> |
| 53 | + </StandardDirectory> |
| 54 | + |
| 55 | + <!-- Install: Run sunshine-setup.ps1 with -Action install, add -Silent if UILevel <= 3 (silent/basic UI) --> |
| 56 | + <CustomAction Id="CA_SunshineInstall" Directory="INSTALL_ROOT" ExeCommand="powershell.exe -NoProfile -ExecutionPolicy Bypass -File "[INSTALL_ROOT]scripts\sunshine-setup.ps1" -Action install" Execute="deferred" Return="ignore" Impersonate="no" /> |
| 57 | + <CustomAction Id="CA_SunshineInstallSilent" Directory="INSTALL_ROOT" ExeCommand="powershell.exe -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -File "[INSTALL_ROOT]scripts\sunshine-setup.ps1" -Action install -Silent" Execute="deferred" Return="ignore" Impersonate="no" /> |
| 58 | + |
| 59 | + <!-- Uninstall: Run sunshine-setup.ps1 with -Action uninstall, add -Silent if UILevel <= 3 (silent/basic UI) --> |
| 60 | + <CustomAction Id="CA_SunshineUninstall" Directory="INSTALL_ROOT" ExeCommand="powershell.exe -NoProfile -ExecutionPolicy Bypass -File "[INSTALL_ROOT]scripts\sunshine-setup.ps1" -Action uninstall" Execute="deferred" Return="ignore" Impersonate="no" /> |
| 61 | + <CustomAction Id="CA_SunshineUninstallSilent" Directory="INSTALL_ROOT" ExeCommand="powershell.exe -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -File "[INSTALL_ROOT]scripts\sunshine-setup.ps1" -Action uninstall -Silent" Execute="deferred" Return="ignore" Impersonate="no" /> |
| 62 | + |
| 63 | + <InstallExecuteSequence> |
| 64 | + <!-- Run installation script after files are installed --> |
| 65 | + <!-- UILevel > 3 means Full UI (interactive), UILevel <= 3 means Silent/Basic UI --> |
| 66 | + <Custom Action="CA_SunshineInstall" After="InstallFiles" Condition="NOT Installed AND UILevel > 3" /> |
| 67 | + <Custom Action="CA_SunshineInstallSilent" After="InstallFiles" Condition="NOT Installed AND UILevel <= 3" /> |
| 68 | + |
| 69 | + <!-- Run uninstallation script before files are removed --> |
| 70 | + <Custom Action="CA_SunshineUninstall" Before="RemoveFiles" Condition="REMOVE="ALL" AND UILevel > 3" /> |
| 71 | + <Custom Action="CA_SunshineUninstallSilent" Before="RemoveFiles" Condition="REMOVE="ALL" AND UILevel <= 3" /> |
| 72 | + </InstallExecuteSequence> |
| 73 | + |
| 74 | + <!-- We need this in order to actually run our custom actions, but let's hide it --> |
| 75 | + <Feature Id="RunSunshineInstallScripts" Title="Run Sunshine Installation Scripts" Level="1" Display="hidden"> |
| 76 | + <ComponentRef Id="ApplicationShortcutRoot" /> |
| 77 | + <ComponentRef Id="ApplicationShortcut" /> |
| 78 | + <ComponentRef Id="DocumentationShortcut" /> |
| 79 | + <ComponentRef Id="WebsiteShortcut" /> |
| 80 | + <ComponentRef Id="SupportShortcut" /> |
| 81 | + </Feature> |
| 82 | + </Fragment> |
| 83 | +</Wix> |
0 commit comments