|
15 | 15 | </Directory> |
16 | 16 | </StandardDirectory> |
17 | 17 |
|
18 | | - <CustomAction Id="CA_ResetPermissions" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]icacls.exe" "." /reset" Execute="deferred" Return="ignore" Impersonate="no" /> |
19 | | - <CustomAction Id="CA_UpdatePathAdd" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]cmd.exe" /c "[INSTALL_ROOT]scripts\update-path.bat" add" Execute="deferred" Return="ignore" Impersonate="no" /> |
20 | | - <CustomAction Id="CA_UpdatePathRemove" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]cmd.exe" /c "[INSTALL_ROOT]scripts\update-path.bat" remove" Execute="deferred" Return="ignore" Impersonate="no" /> |
21 | | - <CustomAction Id="CA_MigrateConfig" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]cmd.exe" /c "[INSTALL_ROOT]scripts\migrate-config.bat"" Execute="deferred" Return="ignore" Impersonate="no" /> |
22 | | - <CustomAction Id="CA_FirewallAdd" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]cmd.exe" /c "[INSTALL_ROOT]scripts\add-firewall-rule.bat"" Execute="deferred" Return="ignore" Impersonate="no" /> |
23 | | - <CustomAction Id="CA_FirewallRemove" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]cmd.exe" /c "[INSTALL_ROOT]scripts\delete-firewall-rule.bat"" Execute="deferred" Return="ignore" Impersonate="no" /> |
24 | | - <CustomAction Id="CA_ServiceInstall" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]cmd.exe" /c "[INSTALL_ROOT]scripts\install-service.bat"" Execute="deferred" Return="ignore" Impersonate="no" /> |
25 | | - <CustomAction Id="CA_ServiceAutostart" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]cmd.exe" /c "[INSTALL_ROOT]scripts\autostart-service.bat"" Execute="deferred" Return="ignore" Impersonate="no" /> |
26 | | - <CustomAction Id="CA_ServiceUninstall" Directory="INSTALL_ROOT" ExeCommand=""[SystemFolder]cmd.exe" /c "[INSTALL_ROOT]scripts\uninstall-service.bat"" Execute="deferred" Return="ignore" Impersonate="no" /> |
27 | | - <CustomAction Id="CA_RestoreNvPrefs" Directory="INSTALL_ROOT" ExeCommand=""[INSTALL_ROOT]sunshine.exe" --restore-nvprefs-undo" Execute="deferred" Return="ignore" Impersonate="no" /> |
| 18 | + <!-- Install: Run sunshine-setup.ps1 with -Action install, add -Silent if UILevel <= 3 (silent/basic UI) --> |
| 19 | + <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" /> |
| 20 | + <CustomAction Id="CA_SunshineInstallSilent" Directory="INSTALL_ROOT" ExeCommand="powershell.exe -NoProfile -ExecutionPolicy Bypass -File "[INSTALL_ROOT]scripts\sunshine-setup.ps1" -Action install -Silent" Execute="deferred" Return="ignore" Impersonate="no" /> |
| 21 | + |
| 22 | + <!-- Uninstall: Run sunshine-setup.ps1 with -Action uninstall, add -Silent if UILevel <= 3 (silent/basic UI) --> |
| 23 | + <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" /> |
| 24 | + <CustomAction Id="CA_SunshineUninstallSilent" Directory="INSTALL_ROOT" ExeCommand="powershell.exe -NoProfile -ExecutionPolicy Bypass -File "[INSTALL_ROOT]scripts\sunshine-setup.ps1" -Action uninstall -Silent" Execute="deferred" Return="ignore" Impersonate="no" /> |
28 | 25 |
|
29 | 26 | <InstallExecuteSequence> |
30 | | - <Custom Action="CA_ResetPermissions" After="InstallFiles" Condition="NOT Installed" /> |
31 | | - <Custom Action="CA_UpdatePathAdd" After="CA_ResetPermissions" Condition="NOT Installed" /> |
32 | | - <Custom Action="CA_MigrateConfig" After="CA_UpdatePathAdd" Condition="NOT Installed" /> |
33 | | - <Custom Action="CA_FirewallAdd" After="CA_MigrateConfig" Condition="NOT Installed" /> |
34 | | - <Custom Action="CA_ServiceInstall" After="CA_FirewallAdd" Condition="NOT Installed" /> |
35 | | - <Custom Action="CA_ServiceAutostart" After="CA_ServiceInstall" Condition="NOT Installed" /> |
| 27 | + <!-- Run installation script after files are installed --> |
| 28 | + <!-- UILevel > 3 means Full UI (interactive), UILevel <= 3 means Silent/Basic UI --> |
| 29 | + <Custom Action="CA_SunshineInstall" After="InstallFiles" Condition="NOT Installed AND UILevel > 3" /> |
| 30 | + <Custom Action="CA_SunshineInstallSilent" After="InstallFiles" Condition="NOT Installed AND UILevel <= 3" /> |
36 | 31 |
|
37 | | - <Custom Action="CA_FirewallRemove" Before="RemoveFiles" Condition="REMOVE="ALL"" /> |
38 | | - <Custom Action="CA_ServiceUninstall" Before="CA_FirewallRemove" Condition="REMOVE="ALL"" /> |
39 | | - <Custom Action="CA_RestoreNvPrefs" After="CA_ServiceUninstall" Condition="REMOVE="ALL"" /> |
40 | | - <Custom Action="CA_UpdatePathRemove" After="CA_RestoreNvPrefs" Condition="REMOVE="ALL"" /> |
| 32 | + <!-- Run uninstallation script before files are removed --> |
| 33 | + <Custom Action="CA_SunshineUninstall" Before="RemoveFiles" Condition="REMOVE="ALL" AND UILevel > 3" /> |
| 34 | + <Custom Action="CA_SunshineUninstallSilent" Before="RemoveFiles" Condition="REMOVE="ALL" AND UILevel <= 3" /> |
41 | 35 | </InstallExecuteSequence> |
42 | 36 |
|
43 | 37 | <!-- We need this in order to actually run our custom actions, but let's hide it --> |
|
0 commit comments