Fix incorrect variable overrides

This commit is contained in:
Manuel Thalmann 2023-06-08 02:28:33 +02:00
parent 24ef21e8d4
commit e0fd6a6de7
11 changed files with 111 additions and 69 deletions

View file

@ -1,7 +1,19 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "$env:LOCALAPPDATA/LGHUB";
$softwareName = "LGHub";
function Invoke-BackupLGHub([Context] $context) {
$hubName = "lghub.exe";
$mainProcesses = Get-Process | Where-Object { [System.IO.Path]::GetFileName($_.Path) -eq "$hubName" };
$lghub = $mainProcesses[0].Path;
$hubProcesses = ($mainProcesses + (Get-Process | Where-Object { @("$hubName", "lghub_agent.exe", "lghub_system_tray.exe") -contains [System.IO.Path]::GetFileName($_.Path) }));
$hubProcesses | Foreach-Object { $_.Kill() };
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i!settings.db*", "-i!icon_cache"));
if ($lghub) {
& "$lghub";
}
}
}

View file

@ -1,7 +1,10 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "$HOME/Documents/ManiaPlanet";
$softwareName = "ManiaPlanet";
function Invoke-BackupManiaPlanet([Context] $context) {
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
}
}

View file

@ -1,6 +1,8 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$softwareName = "PuTTY";
$configFile = "${softwareName}.reg";
$configFile = "$($softwareName).reg";
function New-TempDirectory() {
$tempDir = Join-Path $([System.IO.Path]::GetTempPath()) $([System.IO.Path]::GetRandomFileName());
@ -14,3 +16,4 @@ function Invoke-BackupPuTTY([Context] $context) {
& reg export "HKCU\Software\SimonTatham" "$fileName" /y;
$context.Backup($tempDir, $context.SoftwareArchive($softwareName), @());
}
}

View file

@ -1,7 +1,10 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "C:/tools/RetroArch-Win64";
$softwareName = "RetroArch";
function Invoke-BackupRetroArch([Context] $context) {
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
}
}

View file

@ -1,7 +1,10 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "$HOME/Documents/TmForever";
$softwareName = "TmNationsForever";
function Invoke-BackupTmNations([Context] $context) {
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
}
}

View file

@ -1,7 +1,10 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "$HOME/Documents/TrackMania";
$softwareName = "TmUnitedForever";
function Invoke-BackupTmUnited([Context] $context) {
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
}
}

View file

@ -1,5 +1,7 @@
Import-Module "KnownFolders";
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$programs32Path = $(Get-KnownFolder "ProgramFilesX86").Path;
$vsInstaller = "$programs32Path/Microsoft Visual Studio/Installer/vs_installer.exe";
@ -25,3 +27,4 @@ function Invoke-BackupVisualStudio([Context] $context) {
"--quiet");
}
}
}

View file

@ -1,5 +1,8 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$configBaseName = ".gitconfig";
$configPath = Join-Path "$HOME" "$configBaseName";
function Invoke-BackupGit([Context] $context) {}
}

View file

@ -1,4 +1,6 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "$env:LOCALAPPDATA/osu!";
$softwareName = "osu!";
$genericConfigName = "osu!.User.cfg";
@ -8,3 +10,4 @@ function Invoke-BackupOsu([Context] $context) {
$context.Backup($path, $archive, @("-i@`"$PSScriptRoot/include.txt`""));
& 7z rn "$archive" "osu!.$env:USERNAME.cfg" $genericConfigName;
}
}

View file

@ -1,7 +1,10 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "$env:APPDATA/osu";
$softwareName = "osu!lazer";
function Invoke-BackupOsuLazer([Context] $context) {
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"", "-i!*.realm", "-i!*.db"));
}
}

View file

@ -1,7 +1,10 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "$env:PUBLIC/Documents/reWASD";
$softwareName = "reWASD";
function Invoke-BackupReWASD([Context] $context) {
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-x@`"$PSScriptRoot/exclude.txt`""));
}
}