$Host.UI.RawUI.WindowTitle = "EndBalkan DayZ Fix Tool v2.4" # ============================================ # CONFIG - SCHIMBA DOAR LINIILE ASTEA DACA AI NEVOIE # ============================================ # Aici pui linkul catre scriptul tau PowerShell legitim cand este gata. # Optiunea [11] il ruleaza in aceeasi fereastra PowerShell. $externalScriptUrl = "https://get.activated.win" # Linkul oficial pentru launcherul EndBalkan. $launcherUrl = "https://endbalkan.eu/endbalkan.exe" # Locatia default unde verificam daca launcherul este deja instalat. $launcherDir = "C:\Program Files (x86)\Endbalkan LAUNCHER" $launcherExe = Join-Path $launcherDir "Endbalkan Launcher.exe" function Pause-EB { Write-Host "" Read-Host "Press ENTER to continue" } function Is-Admin { $id = [Security.Principal.WindowsIdentity]::GetCurrent() $p = New-Object Security.Principal.WindowsPrincipal($id) return $p.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) } function Header { Clear-Host Write-Host "" Write-Host " ███████╗███╗ ██╗██████╗ ██████╗ █████╗ ██╗ ██╗ ██╗ █████╗ ███╗ ██╗" -ForegroundColor Cyan Write-Host " ██╔════╝████╗ ██║██╔══██╗██╔══██╗██╔══██╗██║ ██║ ██╔╝██╔══██╗████╗ ██║" -ForegroundColor Cyan Write-Host " █████╗ ██╔██╗ ██║██║ ██║██████╔╝███████║██║ █████╔╝ ███████║██╔██╗ ██║" -ForegroundColor Cyan Write-Host " ██╔══╝ ██║╚██╗██║██║ ██║██╔══██╗██╔══██║██║ ██╔═██╗ ██╔══██║██║╚██╗██║" -ForegroundColor Cyan Write-Host " ███████╗██║ ╚████║██████╔╝██████╔╝██║ ██║███████╗██║ ██╗██║ ██║██║ ╚████║" -ForegroundColor Cyan Write-Host " ╚══════╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝" -ForegroundColor Cyan Write-Host "" Write-Host " EndBalkan DayZ Fix Tool v2.4" -ForegroundColor Yellow Write-Host " https://check.endbalkan.eu" -ForegroundColor DarkGray Write-Host "" } function Check-File($path) { return (Test-Path $path) } function Status-Line($name, $ok) { if ($ok) { Write-Host (" {0,-32}" -f $name) -NoNewline Write-Host "[ OK ]" -ForegroundColor Green } else { Write-Host (" {0,-32}" -f $name) -NoNewline Write-Host "[ MISSING ]" -ForegroundColor Red } } function Check-Winget { if (-not (Get-Command winget -ErrorAction SilentlyContinue)) { Write-Host "" Write-Host "[ERROR] Winget is not installed." -ForegroundColor Red Write-Host "Install App Installer from Microsoft Store." -ForegroundColor Yellow Pause-EB return $false } return $true } function Get-EndbalkanLauncherPath { if (Test-Path $launcherExe) { return $launcherExe } if (Test-Path $launcherDir) { $foundExe = Get-ChildItem -Path $launcherDir -Filter "*Launcher*.exe" -File -ErrorAction SilentlyContinue | Select-Object -First 1 if ($foundExe) { return $foundExe.FullName } } $registryPaths = @( "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" ) foreach ($registryPath in $registryPaths) { $app = Get-ItemProperty -Path $registryPath -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like "*Endbalkan*" -and $_.InstallLocation } | Select-Object -First 1 if ($app) { $possibleExe = Join-Path $app.InstallLocation "Endbalkan Launcher.exe" if (Test-Path $possibleExe) { return $possibleExe } $possibleFoundExe = Get-ChildItem -Path $app.InstallLocation -Filter "*Launcher*.exe" -File -ErrorAction SilentlyContinue | Select-Object -First 1 if ($possibleFoundExe) { return $possibleFoundExe.FullName } } } return $null } function Test-EndbalkanLauncher { return [bool](Get-EndbalkanLauncherPath) } function Verify-System { $msvcp = Check-File "C:\Windows\System32\msvcp140.dll" $vcruntime = Check-File "C:\Windows\System32\vcruntime140.dll" $xapofx = Check-File "C:\Windows\System32\XAPOFX1_5.dll" $winget = Get-Command winget -ErrorAction SilentlyContinue $launcherInstalledPath = Get-EndbalkanLauncherPath Write-Host " ================= SYSTEM STATUS =================" -ForegroundColor DarkCyan Status-Line "Visual C++ MSVCP140" $msvcp Status-Line "Visual C++ VCRUNTIME140" $vcruntime Status-Line "DirectX XAPOFX1_5" $xapofx Status-Line "Winget Package Manager" ([bool]$winget) Status-Line "EndBalkan Launcher" ([bool]$launcherInstalledPath) Write-Host " =================================================" -ForegroundColor DarkCyan Write-Host "" } function Download-EBFile($sourceUrl, $destinationPath) { if (Test-Path $destinationPath) { Remove-Item $destinationPath -Force -ErrorAction SilentlyContinue } [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 try { if (Get-Command Start-BitsTransfer -ErrorAction SilentlyContinue) { Start-BitsTransfer -Source $sourceUrl -Destination $destinationPath -ErrorAction Stop return } } catch { Write-Host "[!] BITS download failed, trying standard download..." -ForegroundColor Yellow } Invoke-WebRequest -Uri $sourceUrl -OutFile $destinationPath -UseBasicParsing -ErrorAction Stop } function Install-VCRedist { if (-not (Check-Winget)) { return } Write-Host "" Write-Host "[+] Installing Visual C++..." -ForegroundColor Yellow winget install -e --id Microsoft.VCRedist.2015+.x64 --silent --accept-package-agreements --accept-source-agreements --disable-interactivity winget install -e --id Microsoft.VCRedist.2015+.x86 --silent --accept-package-agreements --accept-source-agreements --disable-interactivity Write-Host "" Write-Host "[OK] Visual C++ installation completed." -ForegroundColor Green } function Install-DirectX { if (-not (Check-Winget)) { return } Write-Host "" Write-Host "[+] Installing DirectX Runtime..." -ForegroundColor Yellow winget install -e --id Microsoft.DirectX --silent --force --accept-package-agreements --accept-source-agreements --disable-interactivity Write-Host "" Write-Host "[OK] DirectX installation completed." -ForegroundColor Green } function Install-OnlyMissing-Core { $needVC = $false $needDX = $false if (-not (Test-Path "C:\Windows\System32\msvcp140.dll")) { $needVC = $true } if (-not (Test-Path "C:\Windows\System32\vcruntime140.dll")) { $needVC = $true } if (-not (Test-Path "C:\Windows\System32\XAPOFX1_5.dll")) { $needDX = $true } if ($needVC) { Install-VCRedist } else { Write-Host "[OK] Visual C++ already installed." -ForegroundColor Green } if ($needDX) { Install-DirectX } else { Write-Host "[OK] DirectX already installed." -ForegroundColor Green } } function Install-OnlyMissing { Install-OnlyMissing-Core Pause-EB } function Clean-DayZ-NoPause { $dayzPath = "$env:LOCALAPPDATA\DayZ" if (-not (Test-Path $dayzPath)) { return } $files = @() $files += Get-ChildItem $dayzPath -Recurse -Include *.log, *.RPT, *.mdmp -ErrorAction SilentlyContinue if (Test-Path "$dayzPath\DataCache") { $files += Get-ChildItem "$dayzPath\DataCache" -Recurse -Include *.ch -ErrorAction SilentlyContinue } foreach ($file in $files) { try { Remove-Item $file.FullName -Force -ErrorAction Stop } catch {} } Write-Host "[OK] DayZ cache cleaned." -ForegroundColor Green } function Clean-DayZ { Header $dayzPath = "$env:LOCALAPPDATA\DayZ" Write-Host "[+] Cleaning DayZ cache / logs..." -ForegroundColor Yellow Write-Host "" if (-not (Test-Path $dayzPath)) { Write-Host "[ERROR] DayZ folder not found." -ForegroundColor Red Pause-EB return } $files = @() $files += Get-ChildItem $dayzPath -Recurse -Include *.log, *.RPT, *.mdmp -ErrorAction SilentlyContinue if (Test-Path "$dayzPath\DataCache") { $files += Get-ChildItem "$dayzPath\DataCache" -Recurse -Include *.ch -ErrorAction SilentlyContinue } if ($files.Count -eq 0) { Write-Host "[OK] No useless files found." -ForegroundColor Green Pause-EB return } Write-Host "Files found: $($files.Count)" -ForegroundColor Yellow Write-Host "" $confirm = Read-Host "Delete files? Y/N" if ($confirm -notin @("Y", "y")) { Write-Host "Cancelled." -ForegroundColor Red Pause-EB return } $deleted = 0 foreach ($file in $files) { try { Remove-Item $file.FullName -Force -ErrorAction Stop $deleted++ } catch {} } Write-Host "" Write-Host "[OK] Cleanup completed. Files deleted: $deleted" -ForegroundColor Green Pause-EB } function Update-Programs { if (-not (Check-Winget)) { return } Header Write-Host "[+] Updating installed programs..." -ForegroundColor Yellow Write-Host "" winget source update winget upgrade --all --include-unknown --silent --accept-package-agreements --accept-source-agreements --disable-interactivity Write-Host "" Write-Host "[OK] Program updates completed." -ForegroundColor Green Pause-EB } function Update-WindowsAndDrivers { Header Write-Host "[+] Updating Windows + drivers..." -ForegroundColor Yellow Write-Host "" $confirm = Read-Host "Continue? Y/N" if ($confirm -notin @("Y", "y")) { Write-Host "Cancelled." -ForegroundColor Red Pause-EB return } try { Set-ExecutionPolicy Bypass -Scope Process -Force Install-PackageProvider -Name NuGet -Force -ErrorAction SilentlyContinue Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted -ErrorAction SilentlyContinue Install-Module PSWindowsUpdate -Force -AllowClobber -Scope CurrentUser Import-Module PSWindowsUpdate Add-WUServiceManager -MicrosoftUpdate -Confirm:$false -ErrorAction SilentlyContinue Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -Install -IgnoreReboot Install-WindowsUpdate -MicrosoftUpdate -Category Drivers -AcceptAll -Install -IgnoreReboot -ErrorAction SilentlyContinue Write-Host "" Write-Host "[OK] Windows / driver update completed." -ForegroundColor Green Write-Host "[!] Restart recommended." -ForegroundColor Yellow } catch { Write-Host "" Write-Host "[ERROR] Windows Update failed." -ForegroundColor Red Write-Host $_.Exception.Message -ForegroundColor DarkRed } Pause-EB } # NOUA OPTIUNE - VERIFICA, DESCARCA SI PORNESTE LAUNCHERUL function Install-Or-Open-EndbalkanLauncher { Header $installedLauncherPath = Get-EndbalkanLauncherPath Write-Host "[+] EndBalkan Launcher" -ForegroundColor Yellow Write-Host "" Write-Host "Expected path:" -ForegroundColor DarkGray Write-Host $launcherExe -ForegroundColor Cyan Write-Host "" if ($installedLauncherPath) { Write-Host "[OK] Launcher is already installed." -ForegroundColor Green Write-Host "Found at:" -ForegroundColor DarkGray Write-Host $installedLauncherPath -ForegroundColor Cyan Write-Host "" $open = Read-Host "Open launcher now? Y/N" if ($open -in @("Y", "y")) { Start-Process -FilePath $installedLauncherPath Write-Host "[OK] Launcher started." -ForegroundColor Green } Pause-EB return } Write-Host "[MISSING] Launcher is not installed." -ForegroundColor Red Write-Host "" Write-Host "Download URL:" -ForegroundColor DarkGray Write-Host $launcherUrl -ForegroundColor Cyan Write-Host "" $confirm = Read-Host "Download and run installer? Y/N" if ($confirm -notin @("Y", "y")) { Write-Host "Cancelled." -ForegroundColor Red Pause-EB return } $installerPath = Join-Path $env:TEMP "endbalkan-launcher.exe" try { Write-Host "" Write-Host "[+] Downloading launcher..." -ForegroundColor Yellow Download-EBFile $launcherUrl $installerPath if (-not (Test-Path $installerPath)) { throw "Download failed. Installer file was not created." } $downloadedFile = Get-Item $installerPath if ($downloadedFile.Length -lt 1024) { throw "Downloaded file is too small. Check the launcher URL." } Write-Host "[OK] Download completed." -ForegroundColor Green Write-Host "[+] Starting installer..." -ForegroundColor Yellow Start-Process -FilePath $installerPath -Wait Write-Host "" $installedLauncherPath = Get-EndbalkanLauncherPath if ($installedLauncherPath) { Write-Host "[OK] Launcher installed successfully." -ForegroundColor Green Write-Host "Found at:" -ForegroundColor DarkGray Write-Host $installedLauncherPath -ForegroundColor Cyan $openAfterInstall = Read-Host "Open launcher now? Y/N" if ($openAfterInstall -in @("Y", "y")) { Start-Process -FilePath $installedLauncherPath Write-Host "[OK] Launcher started." -ForegroundColor Green } } else { Write-Host "[!] Installer finished, but launcher was not found at the default path." -ForegroundColor Yellow Write-Host "Check manually:" -ForegroundColor DarkGray Write-Host $launcherDir -ForegroundColor Cyan } } catch { Write-Host "" Write-Host "[ERROR] Launcher download/install failed." -ForegroundColor Red Write-Host $_.Exception.Message -ForegroundColor DarkRed } Pause-EB } # NOUA OPTIUNE - RULEAZA AL DOILEA SCRIPT IN ACEEASI FEREASTRA POWERSHELL function Run-ExternalScript { Header Write-Host "[+] External PowerShell script selected" -ForegroundColor Yellow Write-Host "" Write-Host "Script URL:" -ForegroundColor DarkGray Write-Host $externalScriptUrl -ForegroundColor Cyan Write-Host "" if ([string]::IsNullOrWhiteSpace($externalScriptUrl)) { Write-Host '[INFO] Custom PowerShell script is not configured yet.' -ForegroundColor Yellow Write-Host "Edit the CONFIG section at the top of the script." -ForegroundColor Yellow Pause-EB return } try { Write-Host "" Write-Host "[+] Downloading and running external script..." -ForegroundColor Yellow try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch {} Invoke-RestMethod -Uri $externalScriptUrl | Invoke-Expression Write-Host "" Write-Host "[OK] External script completed." -ForegroundColor Green } catch { Write-Host "" Write-Host "[ERROR] External script failed." -ForegroundColor Red Write-Host $_.Exception.Message -ForegroundColor DarkRed } Pause-EB } function Quick-Fix { Header Write-Host "[+] Running EndBalkan Quick Fix..." -ForegroundColor Yellow Write-Host "" Install-OnlyMissing-Core Clean-DayZ-NoPause Write-Host "" Write-Host "[OK] Quick Fix completed." -ForegroundColor Green Write-Host "[!] Restart recommended." -ForegroundColor Yellow Pause-EB } function Full-Repair { Header Write-Host "[+] Running Full Repair..." -ForegroundColor Yellow Write-Host "" Install-VCRedist Install-DirectX Clean-DayZ-NoPause Write-Host "" Write-Host "[OK] Full Repair completed." -ForegroundColor Green Write-Host "[!] Restart recommended." -ForegroundColor Yellow Pause-EB } # ADMIN CHECK if (-not (Is-Admin)) { Header Write-Host "[ERROR] Please run PowerShell as Administrator." -ForegroundColor Red Write-Host "" Write-Host "Then paste:" -ForegroundColor Yellow Write-Host "irm https://check.endbalkan.eu | iex" -ForegroundColor Cyan Pause-EB exit } # MAIN LOOP while ($true) { Header Verify-System Write-Host " [1] Quick Fix recommended" Write-Host " [2] Install / Repair Visual C++" Write-Host " [3] Install / Repair DirectX" Write-Host " [4] Install EVERYTHING" Write-Host " [5] Install ONLY missing dependencies" Write-Host " [6] Clean DayZ cache / logs" Write-Host " [7] Update Windows + drivers" Write-Host " [8] Update old programs" Write-Host " [9] Verify Again" # NOILE OPTIUNI ADAUGATE IN MENIU Write-Host " [10] Check / Install EndBalkan Launcher" Write-Host " [11] Activează Windows" Write-Host " [R] Restart Computer" Write-Host " [0] Exit" Write-Host "" $choice = Read-Host "Select option" switch ($choice.ToUpper()) { "1" { Quick-Fix } "2" { Install-VCRedist; Pause-EB } "3" { Install-DirectX; Pause-EB } "4" { Full-Repair } "5" { Install-OnlyMissing } "6" { Clean-DayZ } "7" { Update-WindowsAndDrivers } "8" { Update-Programs } "9" { continue } # ACTIUNI NOI PENTRU OPTIUNILE ADAUGATE "10" { Install-Or-Open-EndbalkanLauncher } "11" { Run-ExternalScript } "R" { Restart-Computer } "0" { exit } default { Write-Host "" Write-Host "Invalid option." -ForegroundColor Red Pause-EB } } }