PortValhalla/scripts/Windows/Software/RetroArch/Manage.ps1

36 lines
1.3 KiB
PowerShell
Raw Normal View History

2023-07-12 20:37:31 +00:00
#!/bin/pwsh
. "$PSScriptRoot/../../Scripts/KnownFolders.ps1";
2024-08-07 19:05:32 +00:00
. "$PSScriptRoot/../../../Common/Scripts/Context.ps1";
2023-06-07 20:48:05 +00:00
2023-06-08 00:28:33 +00:00
$null = New-Module {
2023-07-27 01:25:42 +00:00
Import-Module "$env:ChocolateyInstall/helpers/chocolateyInstaller.psm1";
2023-06-08 00:28:33 +00:00
$path = "C:/tools/RetroArch-Win64";
$softwareName = "RetroArch";
2023-06-30 10:19:54 +00:00
function Backup-RetroArch([Context] $context) {
Write-Host "Backing up RetroArch";
2023-06-08 00:28:33 +00:00
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
}
2023-07-02 13:58:36 +00:00
function Restore-RetroArch([Context] $context) {
Write-Host "Restoring RetroArch";
Write-Information "Installing RetroArch";
choco install -y --ignore-checksums retroarch;
2023-07-02 13:58:36 +00:00
Write-Information "Restoring files";
$context.Restore($context.SoftwareArchive($softwareName), $path);
Write-Information "Adding cloud sync folders";
$context.AddNextcloudSync(
"$path\saves",
"/Saved Games/RetroArch/Saves");
$context.AddNextcloudSync(
"$path\system",
2023-07-26 23:27:47 +00:00
"/Saved Games/RetroArch/System");
Write-Information "Creating a Start Menu Icon";
2023-07-26 23:41:30 +00:00
Install-ChocolateyShortcut -ShortcutFilePath "$((Get-KnownFolder "Common Programs").Path)/RetroArch.lnk" -TargetPath ((Get-Item "$path\retroarch.exe").FullName);
2023-07-02 13:58:36 +00:00
}
2023-06-07 20:48:05 +00:00
}