Add log messages for all installation steps
This commit is contained in:
parent
9ffa903626
commit
c6907d6eec
12 changed files with 31 additions and 0 deletions
|
@ -12,6 +12,7 @@ $null = New-Module {
|
||||||
function Stop-LogitechGHUB() {
|
function Stop-LogitechGHUB() {
|
||||||
[OutputType([string])]
|
[OutputType([string])]
|
||||||
param();
|
param();
|
||||||
|
Write-Host "Killing Logitech G HUB process";
|
||||||
$hubName = Get-LogitechGHUBName;
|
$hubName = Get-LogitechGHUBName;
|
||||||
$lghubPath = $(Get-Process | Where-Object { [System.IO.Path]::GetFileName($_.Path) -eq $hubName })[0].Path;
|
$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) {
|
function Backup-LogitechGHUB([Context] $context) {
|
||||||
|
Write-Host "Backing Up Logitech G HUB";
|
||||||
$hubPath = Stop-LogitechGHUB;
|
$hubPath = Stop-LogitechGHUB;
|
||||||
|
|
||||||
|
Write-Information "Backing up important files";
|
||||||
$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 ($hubPath) {
|
if ($hubPath) {
|
||||||
|
Write-Information "Restarting Logitech G HUB";
|
||||||
Start-Process $hubPath;
|
Start-Process $hubPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Restore-LogitechGHUB([Context] $context) {
|
function Restore-LogitechGHUB([Context] $context) {
|
||||||
|
Write-Host "Restoring Logitech G HUB";
|
||||||
|
Write-Information "Installing the app";
|
||||||
choco install -y lghub;
|
choco install -y lghub;
|
||||||
$hubPath = Stop-LogitechGHUB;
|
$hubPath = Stop-LogitechGHUB;
|
||||||
|
Write-Information "Restoring important files";
|
||||||
$context.Restore($context.SoftwareArchive($softwareName), $path);
|
$context.Restore($context.SoftwareArchive($softwareName), $path);
|
||||||
|
Write-Information "Restarting Logitech G HUB";
|
||||||
Start-Process $hubPath;
|
Start-Process $hubPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ $null = New-Module {
|
||||||
$softwareName = "ManiaPlanet";
|
$softwareName = "ManiaPlanet";
|
||||||
|
|
||||||
function Backup-ManiaPlanet([Context] $context) {
|
function Backup-ManiaPlanet([Context] $context) {
|
||||||
|
Write-Information "Backing up ManiaPlanet";
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,16 @@
|
||||||
$null = New-Module {
|
$null = New-Module {
|
||||||
function Restore-Nextcloud([Context] $context) {
|
function Restore-Nextcloud([Context] $context) {
|
||||||
if (-not (choco list --exact nextcloud-client)) {
|
if (-not (choco list --exact nextcloud-client)) {
|
||||||
|
Write-Information "Installing Nextcloud Client";
|
||||||
choco install nextcloud-client -y --params="'/KeepUpdateCheck'";
|
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/;
|
$null = Invoke-WebRequest https://valid-isrgrootx1.letsencrypt.org/;
|
||||||
|
|
||||||
if (-not (Test-Path $context.GetNextcloudConfigFile())) {
|
if (-not (Test-Path $context.GetNextcloudConfigFile())) {
|
||||||
|
Write-Information "Setting up Nextcloud configuration";
|
||||||
|
|
||||||
while (-not (Test-Path $context.GetNextcloudConfigFile())) {
|
while (-not (Test-Path $context.GetNextcloudConfigFile())) {
|
||||||
Write-Host "Nextcloud has been installed!";
|
Write-Host "Nextcloud has been installed!";
|
||||||
Read-Host "Please log in in the Nextcloud app and hit enter to continue";
|
Read-Host "Please log in in the Nextcloud app and hit enter to continue";
|
||||||
|
|
|
@ -5,6 +5,7 @@ $null = New-Module {
|
||||||
$configFile = "$($softwareName).reg";
|
$configFile = "$($softwareName).reg";
|
||||||
|
|
||||||
function Backup-PuTTY([Context] $context) {
|
function Backup-PuTTY([Context] $context) {
|
||||||
|
Write-Host "Backing up PuTTY";
|
||||||
$tempDir = $context.GetTempDirectory();
|
$tempDir = $context.GetTempDirectory();
|
||||||
$fileName = Join-Path "$tempDir" $configFile;
|
$fileName = Join-Path "$tempDir" $configFile;
|
||||||
& reg export "HKCU\Software\SimonTatham" "$fileName" /y;
|
& reg export "HKCU\Software\SimonTatham" "$fileName" /y;
|
||||||
|
|
|
@ -5,6 +5,7 @@ $null = New-Module {
|
||||||
$softwareName = "RetroArch";
|
$softwareName = "RetroArch";
|
||||||
|
|
||||||
function Backup-RetroArch([Context] $context) {
|
function Backup-RetroArch([Context] $context) {
|
||||||
|
Write-Host "Backing up RetroArch";
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ $null = New-Module {
|
||||||
$softwareName = "TmNationsForever";
|
$softwareName = "TmNationsForever";
|
||||||
|
|
||||||
function Backup-TmNations([Context] $context) {
|
function Backup-TmNations([Context] $context) {
|
||||||
|
Write-Host "Backing up TrackMania Nations Forever";
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ $null = New-Module {
|
||||||
$softwareName = "TmUnitedForever";
|
$softwareName = "TmUnitedForever";
|
||||||
|
|
||||||
function Backup-TmUnited([Context] $context) {
|
function Backup-TmUnited([Context] $context) {
|
||||||
|
Write-Host "Backing up TrackMania United Forever";
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,11 @@ $null = New-Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Backup-VisualStudio([Context] $context) {
|
function Backup-VisualStudio([Context] $context) {
|
||||||
|
Write-Host "Backing up Visual Studio";
|
||||||
|
|
||||||
foreach ($version in $versions) {
|
foreach ($version in $versions) {
|
||||||
|
Write-Information "Backing up $($version[1]): $($version[2])";
|
||||||
|
|
||||||
$configPath = Get-ConfigPath $context $version[0];
|
$configPath = Get-ConfigPath $context $version[0];
|
||||||
$null = New-Item -Force -ItemType Directory "$(Split-Path -Parent $configPath)";
|
$null = New-Item -Force -ItemType Directory "$(Split-Path -Parent $configPath)";
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,12 @@ $null = New-Module {
|
||||||
function Backup-Git([Context] $context) {}
|
function Backup-Git([Context] $context) {}
|
||||||
|
|
||||||
function Restore-Git([Context] $context) {
|
function Restore-Git([Context] $context) {
|
||||||
|
Write-Host "Restoring git";
|
||||||
$script = New-TemporaryFile;
|
$script = New-TemporaryFile;
|
||||||
$script = Rename-Item $script "$($script.Name).sh" -PassThru;
|
$script = Rename-Item $script "$($script.Name).sh" -PassThru;
|
||||||
|
|
||||||
|
Write-Information "Preparing setup script";
|
||||||
|
|
||||||
Set-Content $script (
|
Set-Content $script (
|
||||||
[string]::Join(
|
[string]::Join(
|
||||||
"`n",
|
"`n",
|
||||||
|
@ -14,6 +17,7 @@ $null = New-Module {
|
||||||
"bash `"$PSScriptRoot/../../../Common/Config/git/install.sh`"",
|
"bash `"$PSScriptRoot/../../../Common/Config/git/install.sh`"",
|
||||||
"bach rm ~/.bashrc")));
|
"bach rm ~/.bashrc")));
|
||||||
|
|
||||||
|
Write-Information "Running prepared script";
|
||||||
Start-Process -Wait $script;
|
Start-Process -Wait $script;
|
||||||
Remove-Item $script;
|
Remove-Item $script;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,11 @@ $null = New-Module {
|
||||||
$genericConfigName = "osu!.User.cfg";
|
$genericConfigName = "osu!.User.cfg";
|
||||||
|
|
||||||
function Backup-Osu([Context] $context) {
|
function Backup-Osu([Context] $context) {
|
||||||
|
Write-Host "Backing up osu!";
|
||||||
$archive = $context.SoftwareArchive($softwareName);
|
$archive = $context.SoftwareArchive($softwareName);
|
||||||
|
Write-Information "Backing up important files";
|
||||||
$context.Backup($path, $archive, @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $archive, @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
|
Write-Information "Renaming user configuration to $genericConfigName";
|
||||||
& 7z rn "$archive" "osu!.$env:USERNAME.cfg" $genericConfigName;
|
& 7z rn "$archive" "osu!.$env:USERNAME.cfg" $genericConfigName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ $null = New-Module {
|
||||||
$softwareName = "osu!lazer";
|
$softwareName = "osu!lazer";
|
||||||
|
|
||||||
function Backup-OsuLazer([Context] $context) {
|
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"));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"", "-i!*.realm", "-i!*.db"));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@ $null = New-Module {
|
||||||
$softwareName = "reWASD";
|
$softwareName = "reWASD";
|
||||||
|
|
||||||
function Backup-reWASD([Context] $context) {
|
function Backup-reWASD([Context] $context) {
|
||||||
|
Write-Host "Backing up reWASD";
|
||||||
$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