diff --git a/1_Install.ps1 b/1_Install.ps1 index 3311f95..2b6634f 100644 --- a/1_Install.ps1 +++ b/1_Install.ps1 @@ -57,11 +57,12 @@ function Update-Scripts { Write-Host "Failed to download from URL: $_" -ForegroundColor DarkGray return $false # Failed to download } - + # Check if the download was successful (file exists and is not empty) if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) { Write-Host "Download successful!" -ForegroundColor Green - + + try { # Extract the zip file Write-Host "Extracting update package..." -ForegroundColor Cyan Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force @@ -115,6 +116,7 @@ function Update-Scripts { return $false # Update failed } } +} # Call the update function at the beginning $scriptUpdated = Update-Scripts diff --git a/2_ConfigUpdate.ps1 b/2_ConfigUpdate.ps1 index 78847b9..3e75143 100644 --- a/2_ConfigUpdate.ps1 +++ b/2_ConfigUpdate.ps1 @@ -57,11 +57,12 @@ function Update-Scripts { Write-Host "Failed to download from URL: $_" -ForegroundColor DarkGray return $false # Failed to download } - + # Check if the download was successful (file exists and is not empty) if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) { Write-Host "Download successful!" -ForegroundColor Green - + + try { # Extract the zip file Write-Host "Extracting update package..." -ForegroundColor Cyan Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force @@ -115,6 +116,7 @@ function Update-Scripts { return $false # Update failed } } +} # Call the update function at the beginning $scriptUpdated = Update-Scripts diff --git a/3_ConfigAfterNextcloud.ps1 b/3_ConfigAfterNextcloud.ps1 index 295b22c..363be86 100644 --- a/3_ConfigAfterNextcloud.ps1 +++ b/3_ConfigAfterNextcloud.ps1 @@ -57,11 +57,12 @@ function Update-Scripts { Write-Host "Failed to download from URL: $_" -ForegroundColor DarkGray return $false # Failed to download } - + # Check if the download was successful (file exists and is not empty) if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) { Write-Host "Download successful!" -ForegroundColor Green - + + try { # Extract the zip file Write-Host "Extracting update package..." -ForegroundColor Cyan Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force