feat(installer/windows): add wix installer (#3916)
This commit is contained in:
parent
e2652fa52b
commit
cdc444314f
7 changed files with 208 additions and 4 deletions
5
cmake/packaging/wix_resources/patch.xml
Normal file
5
cmake/packaging/wix_resources/patch.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<CPackWiXPatch>
|
||||
<CPackWiXFragment Id="CM_G_Core">
|
||||
<FeatureRef Id="RunSunshineInstallScripts"/>
|
||||
</CPackWiXFragment>
|
||||
</CPackWiXPatch>
|
||||
83
cmake/packaging/wix_resources/sunshine-installer.wxs
Normal file
83
cmake/packaging/wix_resources/sunshine-installer.wxs
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
|
||||
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
|
||||
<Fragment>
|
||||
<StandardDirectory Id="ProgramMenuFolder">
|
||||
<Component Id="ApplicationShortcutRoot" Guid="*">
|
||||
<Shortcut Id="ApplicationStartMenuShortcutRoot"
|
||||
Name="Sunshine"
|
||||
Description="Sunshine Game Stream Host"
|
||||
Target="[INSTALL_ROOT]sunshine.exe"
|
||||
Arguments="--shortcut"
|
||||
WorkingDirectory="INSTALL_ROOT"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="installed_root" Type="integer" Value="1" KeyPath="yes"/>
|
||||
</Component>
|
||||
<Directory Id="ProgramMenuSubfolder" Name="LizardByte">
|
||||
<Directory Id="ProgramMenuSunshineFolder" Name="Sunshine">
|
||||
<Component Id="ApplicationShortcut" Guid="*">
|
||||
<Shortcut Id="ApplicationStartMenuShortcut"
|
||||
Name="Sunshine"
|
||||
Description="Sunshine Game Stream Host"
|
||||
Target="[INSTALL_ROOT]sunshine.exe"
|
||||
Arguments="--shortcut"
|
||||
WorkingDirectory="INSTALL_ROOT"/>
|
||||
<RemoveFolder Id="CleanUpShortCut" Directory="ProgramMenuSunshineFolder" On="uninstall"/>
|
||||
<RemoveFolder Id="CleanUpShortCutParent" Directory="ProgramMenuSubfolder" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
|
||||
</Component>
|
||||
<Component Id="DocumentationShortcut" Guid="*">
|
||||
<util:InternetShortcut Id="DocumentationLink"
|
||||
Name="Sunshine Documentation"
|
||||
Target="https://docs.lizardbyte.dev/projects/sunshine"
|
||||
Type="url"/>
|
||||
<RemoveFolder Id="CleanUpDocsShortCut" Directory="ProgramMenuSunshineFolder" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="docs_shortcut" Type="integer" Value="1" KeyPath="yes"/>
|
||||
</Component>
|
||||
<Component Id="WebsiteShortcut" Guid="*">
|
||||
<util:InternetShortcut Id="WebsiteLink"
|
||||
Name="LizardByte Web Site"
|
||||
Target="https://app.lizardbyte.dev"
|
||||
Type="url"/>
|
||||
<RemoveFolder Id="CleanUpWebsiteShortCut" Directory="ProgramMenuSunshineFolder" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="website_shortcut" Type="integer" Value="1" KeyPath="yes"/>
|
||||
</Component>
|
||||
<Component Id="SupportShortcut" Guid="*">
|
||||
<util:InternetShortcut Id="SupportLink"
|
||||
Name="LizardByte Support"
|
||||
Target="https://app.lizardbyte.dev/support"
|
||||
Type="url"/>
|
||||
<RemoveFolder Id="CleanUpSupportShortCut" Directory="ProgramMenuSunshineFolder" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\LizardByte\Sunshine" Name="support_shortcut" Type="integer" Value="1" KeyPath="yes"/>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</StandardDirectory>
|
||||
|
||||
<!-- Install: Run sunshine-setup.ps1 with -Action install, add -Silent if UILevel <= 3 (silent/basic UI) -->
|
||||
<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" />
|
||||
<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" />
|
||||
|
||||
<!-- Uninstall: Run sunshine-setup.ps1 with -Action uninstall, add -Silent if UILevel <= 3 (silent/basic UI) -->
|
||||
<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" />
|
||||
<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" />
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<!-- Run installation script after files are installed -->
|
||||
<!-- UILevel > 3 means Full UI (interactive), UILevel <= 3 means Silent/Basic UI -->
|
||||
<Custom Action="CA_SunshineInstall" After="InstallFiles" Condition="NOT Installed AND UILevel > 3" />
|
||||
<Custom Action="CA_SunshineInstallSilent" After="InstallFiles" Condition="NOT Installed AND UILevel <= 3" />
|
||||
|
||||
<!-- Run uninstallation script before files are removed -->
|
||||
<Custom Action="CA_SunshineUninstall" Before="RemoveFiles" Condition="REMOVE="ALL" AND UILevel > 3" />
|
||||
<Custom Action="CA_SunshineUninstallSilent" Before="RemoveFiles" Condition="REMOVE="ALL" AND UILevel <= 3" />
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<!-- We need this in order to actually run our custom actions, but let's hide it -->
|
||||
<Feature Id="RunSunshineInstallScripts" Title="Run Sunshine Installation Scripts" Level="1" Display="hidden">
|
||||
<ComponentRef Id="ApplicationShortcutRoot" />
|
||||
<ComponentRef Id="ApplicationShortcut" />
|
||||
<ComponentRef Id="DocumentationShortcut" />
|
||||
<ComponentRef Id="WebsiteShortcut" />
|
||||
<ComponentRef Id="SupportShortcut" />
|
||||
</Feature>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
Loading…
Add table
Add a link
Reference in a new issue