Add step for installing Nextcloud

This commit is contained in:
Manuel Thalmann 2023-06-30 13:17:00 +02:00
parent af0dbf7752
commit ed2cac87ca
3 changed files with 25 additions and 0 deletions

View file

@ -2,6 +2,7 @@
. "$PSScriptRoot/../Software/git/Manage.ps1";
. "$PSScriptRoot/../Software/LGHub/Manage.ps1";
. "$PSScriptRoot/../Software/ManiaPlanet/Manage.ps1";
. "$PSScriptRoot/../Software/Nextcloud/Manage.ps1";
. "$PSScriptRoot/../Software/osu!/Manage.ps1";
. "$PSScriptRoot/../Software/osu!lazer/Manage.ps1";
. "$PSScriptRoot/../Software/PuTTY/Manage.ps1";
@ -26,5 +27,7 @@ function Backup-PersonalApps([Context] $context) {
}
function Restore-PersonalApps([Context] $context) {
choco feature enable -n useEnhancedExitCodes;
Restore-Nextcloud $context;
Restore-Git $context;
}

View file

@ -205,6 +205,10 @@ class Context {
});
}
[string] GetNextcloudConfigFile() {
return "$env:APPDATA/Nextcloud/nextcloud.cfg";
}
[void] Reboot() {
Write-Host "Restarting Computer...";
$this.RegisterReboot();

View file

@ -0,0 +1,18 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
function Restore-Nextcloud([Context] $context) {
if (-not (choco list --exact nextcloud-client)) {
choco install nextcloud-client -y --params="'/KeepUpdateCheck'";
}
while (-not (Test-Path $context.GetNextcloudConfigFile())) {
Write-Host "Nextcloud has been installed!";
Write-Host "Please log in in the Nextcloud app to continue.";
if (-not (Test-Path $context.GetNextcloudConfigFile())) {
Write-Error "The login seems to have failed. Please try again.";
}
}
}
}