From 35b093c4e171f84aa2752722d6daf40aeaa548f0 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 30 Jun 2023 14:23:20 +0200 Subject: [PATCH] Add log messages for all installation steps --- scripts/Windows/Software/LGHub/Manage.ps1 | 9 +++++++++ scripts/Windows/Software/ManiaPlanet/Manage.ps1 | 1 + scripts/Windows/Software/Nextcloud/Manage.ps1 | 4 ++++ scripts/Windows/Software/PuTTY/Manage.ps1 | 1 + scripts/Windows/Software/RetroArch/Manage.ps1 | 1 + .../Software/TrackMania Nations Forever/Manage.ps1 | 1 + .../Software/TrackMania United Forever/Manage.ps1 | 1 + scripts/Windows/Software/VisualStudio/Manage.ps1 | 4 ++++ scripts/Windows/Software/git/Manage.ps1 | 4 ++++ scripts/Windows/Software/osu!/Manage.ps1 | 3 +++ scripts/Windows/Software/osu!lazer/Manage.ps1 | 1 + scripts/Windows/Software/reWASD/Manage.ps1 | 1 + 12 files changed, 31 insertions(+) diff --git a/scripts/Windows/Software/LGHub/Manage.ps1 b/scripts/Windows/Software/LGHub/Manage.ps1 index 9959b88a..ef585cd6 100644 --- a/scripts/Windows/Software/LGHub/Manage.ps1 +++ b/scripts/Windows/Software/LGHub/Manage.ps1 @@ -12,6 +12,7 @@ $null = New-Module { function Stop-LogitechGHUB() { [OutputType([string])] param(); + Write-Host "Killing Logitech G HUB process"; $hubName = Get-LogitechGHUBName; $lghubPath = $(Get-Process | Where-Object { [System.IO.Path]::GetFileName($_.Path) -eq $hubName })[0].Path; @@ -23,18 +24,26 @@ $null = New-Module { } function Backup-LogitechGHUB([Context] $context) { + Write-Host "Backing Up Logitech G HUB"; $hubPath = Stop-LogitechGHUB; + + Write-Information "Backing up important files"; $context.Backup($path, $context.SoftwareArchive($softwareName), @("-i!settings.db", "-i!icon_cache")); if ($hubPath) { + Write-Information "Restarting Logitech G HUB"; Start-Process $hubPath; } } function Restore-LogitechGHUB([Context] $context) { + Write-Host "Restoring Logitech G HUB"; + Write-Information "Installing the app"; choco install -y lghub; $hubPath = Stop-LogitechGHUB; + Write-Information "Restoring important files"; $context.Restore($context.SoftwareArchive($softwareName), $path); + Write-Information "Restarting Logitech G HUB"; Start-Process $hubPath; } } diff --git a/scripts/Windows/Software/ManiaPlanet/Manage.ps1 b/scripts/Windows/Software/ManiaPlanet/Manage.ps1 index 8b98d1ed..484334c5 100644 --- a/scripts/Windows/Software/ManiaPlanet/Manage.ps1 +++ b/scripts/Windows/Software/ManiaPlanet/Manage.ps1 @@ -5,6 +5,7 @@ $null = New-Module { $softwareName = "ManiaPlanet"; function Backup-ManiaPlanet([Context] $context) { + Write-Information "Backing up ManiaPlanet"; $context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"")); } } diff --git a/scripts/Windows/Software/Nextcloud/Manage.ps1 b/scripts/Windows/Software/Nextcloud/Manage.ps1 index b0b93329..4be93b10 100644 --- a/scripts/Windows/Software/Nextcloud/Manage.ps1 +++ b/scripts/Windows/Software/Nextcloud/Manage.ps1 @@ -3,12 +3,16 @@ $null = New-Module { function Restore-Nextcloud([Context] $context) { if (-not (choco list --exact nextcloud-client)) { + Write-Information "Installing Nextcloud Client"; choco install nextcloud-client -y --params="'/KeepUpdateCheck'"; } + Write-Information "Ensuring all Let's Encrypt certificates are cached"; $null = Invoke-WebRequest https://valid-isrgrootx1.letsencrypt.org/; if (-not (Test-Path $context.GetNextcloudConfigFile())) { + Write-Information "Setting up Nextcloud configuration"; + while (-not (Test-Path $context.GetNextcloudConfigFile())) { Write-Host "Nextcloud has been installed!"; Read-Host "Please log in in the Nextcloud app and hit enter to continue"; diff --git a/scripts/Windows/Software/PuTTY/Manage.ps1 b/scripts/Windows/Software/PuTTY/Manage.ps1 index 9deef9f9..b6d7fb00 100644 --- a/scripts/Windows/Software/PuTTY/Manage.ps1 +++ b/scripts/Windows/Software/PuTTY/Manage.ps1 @@ -5,6 +5,7 @@ $null = New-Module { $configFile = "$($softwareName).reg"; function Backup-PuTTY([Context] $context) { + Write-Host "Backing up PuTTY"; $tempDir = $context.GetTempDirectory(); $fileName = Join-Path "$tempDir" $configFile; & reg export "HKCU\Software\SimonTatham" "$fileName" /y; diff --git a/scripts/Windows/Software/RetroArch/Manage.ps1 b/scripts/Windows/Software/RetroArch/Manage.ps1 index b7b21600..f26c0284 100644 --- a/scripts/Windows/Software/RetroArch/Manage.ps1 +++ b/scripts/Windows/Software/RetroArch/Manage.ps1 @@ -5,6 +5,7 @@ $null = New-Module { $softwareName = "RetroArch"; function Backup-RetroArch([Context] $context) { + Write-Host "Backing up RetroArch"; $context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"")); } } diff --git a/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 b/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 index 430d0ea1..3e1d8a02 100644 --- a/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 +++ b/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 @@ -5,6 +5,7 @@ $null = New-Module { $softwareName = "TmNationsForever"; function Backup-TmNations([Context] $context) { + Write-Host "Backing up TrackMania Nations Forever"; $context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"")); } } diff --git a/scripts/Windows/Software/TrackMania United Forever/Manage.ps1 b/scripts/Windows/Software/TrackMania United Forever/Manage.ps1 index 81d68006..93fd1d06 100644 --- a/scripts/Windows/Software/TrackMania United Forever/Manage.ps1 +++ b/scripts/Windows/Software/TrackMania United Forever/Manage.ps1 @@ -5,6 +5,7 @@ $null = New-Module { $softwareName = "TmUnitedForever"; function Backup-TmUnited([Context] $context) { + Write-Host "Backing up TrackMania United Forever"; $context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"")); } } diff --git a/scripts/Windows/Software/VisualStudio/Manage.ps1 b/scripts/Windows/Software/VisualStudio/Manage.ps1 index 5e0da22b..af6d7303 100644 --- a/scripts/Windows/Software/VisualStudio/Manage.ps1 +++ b/scripts/Windows/Software/VisualStudio/Manage.ps1 @@ -13,7 +13,11 @@ $null = New-Module { } function Backup-VisualStudio([Context] $context) { + Write-Host "Backing up Visual Studio"; + foreach ($version in $versions) { + Write-Information "Backing up $($version[1]): $($version[2])"; + $configPath = Get-ConfigPath $context $version[0]; $null = New-Item -Force -ItemType Directory "$(Split-Path -Parent $configPath)"; diff --git a/scripts/Windows/Software/git/Manage.ps1 b/scripts/Windows/Software/git/Manage.ps1 index 93d182b1..ef0f9549 100644 --- a/scripts/Windows/Software/git/Manage.ps1 +++ b/scripts/Windows/Software/git/Manage.ps1 @@ -4,9 +4,12 @@ $null = New-Module { function Backup-Git([Context] $context) {} function Restore-Git([Context] $context) { + Write-Host "Restoring git"; $script = New-TemporaryFile; $script = Rename-Item $script "$($script.Name).sh" -PassThru; + Write-Information "Preparing setup script"; + Set-Content $script ( [string]::Join( "`n", @@ -14,6 +17,7 @@ $null = New-Module { "bash `"$PSScriptRoot/../../../Common/Config/git/install.sh`"", "bach rm ~/.bashrc"))); + Write-Information "Running prepared script"; Start-Process -Wait $script; Remove-Item $script; } diff --git a/scripts/Windows/Software/osu!/Manage.ps1 b/scripts/Windows/Software/osu!/Manage.ps1 index 7c1ee9ac..1ab9a7bb 100644 --- a/scripts/Windows/Software/osu!/Manage.ps1 +++ b/scripts/Windows/Software/osu!/Manage.ps1 @@ -6,8 +6,11 @@ $null = New-Module { $genericConfigName = "osu!.User.cfg"; function Backup-Osu([Context] $context) { + Write-Host "Backing up osu!"; $archive = $context.SoftwareArchive($softwareName); + Write-Information "Backing up important files"; $context.Backup($path, $archive, @("-i@`"$PSScriptRoot/include.txt`"")); + Write-Information "Renaming user configuration to $genericConfigName"; & 7z rn "$archive" "osu!.$env:USERNAME.cfg" $genericConfigName; } } diff --git a/scripts/Windows/Software/osu!lazer/Manage.ps1 b/scripts/Windows/Software/osu!lazer/Manage.ps1 index 37695785..a929d4bd 100644 --- a/scripts/Windows/Software/osu!lazer/Manage.ps1 +++ b/scripts/Windows/Software/osu!lazer/Manage.ps1 @@ -5,6 +5,7 @@ $null = New-Module { $softwareName = "osu!lazer"; function Backup-OsuLazer([Context] $context) { + Write-Host "Backing up osu!lazer"; $context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"", "-i!*.realm", "-i!*.db")); } } \ No newline at end of file diff --git a/scripts/Windows/Software/reWASD/Manage.ps1 b/scripts/Windows/Software/reWASD/Manage.ps1 index 941c94a3..60d7bae0 100644 --- a/scripts/Windows/Software/reWASD/Manage.ps1 +++ b/scripts/Windows/Software/reWASD/Manage.ps1 @@ -5,6 +5,7 @@ $null = New-Module { $softwareName = "reWASD"; function Backup-reWASD([Context] $context) { + Write-Host "Backing up reWASD"; $context.Backup($path, $context.SoftwareArchive($softwareName), @("-x@`"$PSScriptRoot/exclude.txt`"")); } }