Fix incorrect variable overrides
This commit is contained in:
parent
24ef21e8d4
commit
e0fd6a6de7
11 changed files with 111 additions and 69 deletions
|
@ -1,7 +1,19 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$path = "$env:LOCALAPPDATA/LGHUB";
|
$path = "$env:LOCALAPPDATA/LGHUB";
|
||||||
$softwareName = "LGHub";
|
$softwareName = "LGHub";
|
||||||
|
|
||||||
function Invoke-BackupLGHub([Context] $context) {
|
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"));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i!settings.db*", "-i!icon_cache"));
|
||||||
|
|
||||||
|
if ($lghub) {
|
||||||
|
& "$lghub";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$path = "$HOME/Documents/ManiaPlanet";
|
$path = "$HOME/Documents/ManiaPlanet";
|
||||||
$softwareName = "ManiaPlanet";
|
$softwareName = "ManiaPlanet";
|
||||||
|
|
||||||
function Invoke-BackupManiaPlanet([Context] $context) {
|
function Invoke-BackupManiaPlanet([Context] $context) {
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$softwareName = "PuTTY";
|
$softwareName = "PuTTY";
|
||||||
$configFile = "${softwareName}.reg";
|
$configFile = "$($softwareName).reg";
|
||||||
|
|
||||||
function New-TempDirectory() {
|
function New-TempDirectory() {
|
||||||
$tempDir = Join-Path $([System.IO.Path]::GetTempPath()) $([System.IO.Path]::GetRandomFileName());
|
$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;
|
& reg export "HKCU\Software\SimonTatham" "$fileName" /y;
|
||||||
$context.Backup($tempDir, $context.SoftwareArchive($softwareName), @());
|
$context.Backup($tempDir, $context.SoftwareArchive($softwareName), @());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$path = "C:/tools/RetroArch-Win64";
|
$path = "C:/tools/RetroArch-Win64";
|
||||||
$softwareName = "RetroArch";
|
$softwareName = "RetroArch";
|
||||||
|
|
||||||
function Invoke-BackupRetroArch([Context] $context) {
|
function Invoke-BackupRetroArch([Context] $context) {
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$path = "$HOME/Documents/TmForever";
|
$path = "$HOME/Documents/TmForever";
|
||||||
$softwareName = "TmNationsForever";
|
$softwareName = "TmNationsForever";
|
||||||
|
|
||||||
function Invoke-BackupTmNations([Context] $context) {
|
function Invoke-BackupTmNations([Context] $context) {
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$path = "$HOME/Documents/TrackMania";
|
$path = "$HOME/Documents/TrackMania";
|
||||||
$softwareName = "TmUnitedForever";
|
$softwareName = "TmUnitedForever";
|
||||||
|
|
||||||
function Invoke-BackupTmUnited([Context] $context) {
|
function Invoke-BackupTmUnited([Context] $context) {
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
Import-Module "KnownFolders";
|
Import-Module "KnownFolders";
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$programs32Path = $(Get-KnownFolder "ProgramFilesX86").Path;
|
$programs32Path = $(Get-KnownFolder "ProgramFilesX86").Path;
|
||||||
$vsInstaller = "$programs32Path/Microsoft Visual Studio/Installer/vs_installer.exe";
|
$vsInstaller = "$programs32Path/Microsoft Visual Studio/Installer/vs_installer.exe";
|
||||||
|
|
||||||
|
@ -25,3 +27,4 @@ function Invoke-BackupVisualStudio([Context] $context) {
|
||||||
"--quiet");
|
"--quiet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$configBaseName = ".gitconfig";
|
$configBaseName = ".gitconfig";
|
||||||
$configPath = Join-Path "$HOME" "$configBaseName";
|
$configPath = Join-Path "$HOME" "$configBaseName";
|
||||||
|
|
||||||
function Invoke-BackupGit([Context] $context) {}
|
function Invoke-BackupGit([Context] $context) {}
|
||||||
|
}
|
|
@ -1,4 +1,6 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$path = "$env:LOCALAPPDATA/osu!";
|
$path = "$env:LOCALAPPDATA/osu!";
|
||||||
$softwareName = "osu!";
|
$softwareName = "osu!";
|
||||||
$genericConfigName = "osu!.User.cfg";
|
$genericConfigName = "osu!.User.cfg";
|
||||||
|
@ -8,3 +10,4 @@ function Invoke-BackupOsu([Context] $context) {
|
||||||
$context.Backup($path, $archive, @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $archive, @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
& 7z rn "$archive" "osu!.$env:USERNAME.cfg" $genericConfigName;
|
& 7z rn "$archive" "osu!.$env:USERNAME.cfg" $genericConfigName;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$path = "$env:APPDATA/osu";
|
$path = "$env:APPDATA/osu";
|
||||||
$softwareName = "osu!lazer";
|
$softwareName = "osu!lazer";
|
||||||
|
|
||||||
function Invoke-BackupOsuLazer([Context] $context) {
|
function Invoke-BackupOsuLazer([Context] $context) {
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"", "-i!*.realm", "-i!*.db"));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"", "-i!*.realm", "-i!*.db"));
|
||||||
}
|
}
|
||||||
|
}
|
|
@ -1,7 +1,10 @@
|
||||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||||
|
|
||||||
|
$null = New-Module {
|
||||||
$path = "$env:PUBLIC/Documents/reWASD";
|
$path = "$env:PUBLIC/Documents/reWASD";
|
||||||
$softwareName = "reWASD";
|
$softwareName = "reWASD";
|
||||||
|
|
||||||
function Invoke-BackupReWASD([Context] $context) {
|
function Invoke-BackupReWASD([Context] $context) {
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-x@`"$PSScriptRoot/exclude.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-x@`"$PSScriptRoot/exclude.txt`""));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue