Initialer Import der Synology Scripts

This commit is contained in:
root
2026-08-05 08:43:57 +02:00
commit 5e32a7c411
404 changed files with 79932 additions and 0 deletions
+205
View File
@@ -0,0 +1,205 @@
############################################################
# PART 5.1
#
# Part 5.1 .NET Framework prüfen
############################################################
function Test-DotNetFramework {
Write-Log "Prüfe .NET Framework"
$RegPath = "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
if(!(Test-Path $RegPath))
{
Stop-Installation ".NET Framework wurde nicht gefunden."
}
$Release = (Get-ItemProperty $RegPath).Release
Write-Log ".NET Release : $Release"
if($Release -lt 528040)
{
Stop-Installation ".NET Framework 4.8 oder höher wird benötigt."
}
Write-Log ".NET Framework OK"
}
############################################################
# PART 5.2
#
# Part 5.2 Visual C++ Redistributables prüfen
############################################################
function Test-VisualCRedistributables {
Write-Log "Prüfe Visual C++ Redistributables"
$VC = Get-ItemProperty `
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*,
HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* `
-ErrorAction SilentlyContinue |
Where-Object {
$_.DisplayName -like "*Microsoft Visual C++*"
}
if(!$VC)
{
Write-Log "Keine Visual C++ Redistributables gefunden."
Write-Log "Werden während der Veeam Installation installiert."
return
}
foreach($Item in $VC)
{
Write-Log "$($Item.DisplayName) $($Item.DisplayVersion)"
}
}
############################################################
# PART 5.3
#
# Part 5.3 Installationspfade vorbereiten
############################################################
function Initialize-InstallDirectories {
Write-Log "Erstelle Installationsverzeichnisse"
$Folders = @(
$InstallPath,
$CatalogPath,
$IRCachePath
)
foreach($Folder in $Folders)
{
if(!(Test-Path $Folder))
{
New-Item `
-ItemType Directory `
-Path $Folder `
-Force |
Out-Null
Write-Log "Ordner erstellt: $Folder"
}
else
{
Write-Log "Ordner vorhanden: $Folder"
}
}
}
############################################################
# PART 5.4
#
# Part 5.4 Schreibtest
############################################################
function Test-WritePermissions {
Write-Log "Prüfe Schreibrechte"
foreach($Folder in @($InstallPath,$CatalogPath,$IRCachePath))
{
$TestFile = Join-Path $Folder "WriteTest.tmp"
try
{
"TEST" | Set-Content $TestFile
Remove-Item $TestFile -Force
Write-Log "$Folder beschreibbar."
}
catch
{
Stop-Installation "Keine Schreibrechte auf $Folder."
}
}
}
############################################################
# PART 5.5
#
# Part 5.5 Ports prüfen
############################################################
function Test-Ports {
Write-Log "Prüfe benötigte Ports"
$Ports = @(
$VeeamServicePort,
$GuestCatalogPort,
$SecureConnectionPort,
$RestServicePort
)
foreach($Port in $Ports)
{
$Connection = Get-NetTCPConnection `
-State Listen `
-ErrorAction SilentlyContinue |
Where-Object LocalPort -eq $Port
if($Connection)
{
Write-Log "WARNUNG: Port $Port ist bereits belegt."
}
else
{
Write-Log "Port $Port verfügbar."
}
}
}
############################################################
# PART 5.6
#
# Part 5.6 Windows Firewall prüfen
############################################################
function Test-Firewall {
Write-Log "Prüfe Windows Firewall"
$Profiles = Get-NetFirewallProfile
foreach($Profile in $Profiles)
{
Write-Log "$($Profile.Name): Enabled=$($Profile.Enabled)"
}
}
############################################################
# PART 5.7
#
# Part 5.7 Voraussetzungen prüfen
############################################################
function Invoke-Prerequisites {
Write-Log ""
Write-Log "===================================="
Write-Log "Prüfung der Voraussetzungen"
Write-Log "===================================="
Test-DotNetFramework
Test-VisualCRedistributables
Initialize-InstallDirectories
Test-WritePermissions
Test-Ports
Test-Firewall
Write-Log "Voraussetzungen erfolgreich geprüft."
}