From a51999007e6bc4f44a3df2bc6897090c123e3e32 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 28 Aug 2024 05:18:52 +0200 Subject: [PATCH] Add backup support for ManiaPlanet --- .../Windows/Software/ManiaPlanet/Manage.ps1 | 45 +++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/scripts/Windows/Software/ManiaPlanet/Manage.ps1 b/scripts/Windows/Software/ManiaPlanet/Manage.ps1 index e88233a4..571fcdf4 100644 --- a/scripts/Windows/Software/ManiaPlanet/Manage.ps1 +++ b/scripts/Windows/Software/ManiaPlanet/Manage.ps1 @@ -3,13 +3,42 @@ param( [hashtable] $Arguments ) -. "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; -. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; +& { + param($Parameters) + . "$PSScriptRoot/../../Scripts/Restoration.ps1"; + . "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; + . "$PSScriptRoot/../../../Common/Scripts/System.ps1"; + $path = "$HOME/Documents/ManiaPlanet"; -Start-SoftwareInstaller @PSBoundParameters ` - -Installer { - Install-WingetPackage Nadeo.ManiaPlanet; - Remove-DesktopIcon "ManiaPlanet*"; - }; + Start-SoftwareInstaller @Parameters ` + -Installer { + Install-WingetPackage Nadeo.ManiaPlanet; + Remove-DesktopIcon "ManiaPlanet*"; + } ` + -UserBackup { + param( + [hashtable] $Arguments + ) -# ToDo: Add restoration + Add-BackupArtifacts -User $Arguments.Name -Source $path -Path "ManiaPlanet" ` + -Include @( + "Actions", + "Blocks", + "Items", + "Maps", + "Media", + "Modules", + "Packs", + "Replays", + "Scripts", + "Skins" + ); + } ` + -UserConfigurator { + param( + [hashtable] $Arguments + ) + + Expand-BackupArtifacts -User $Arguments.Name -Path "ManiaPlanet" -Target $path; + }; +} $PSBoundParameters;