# ============================================================================== # Desk360 — Windows Masaustu Programi ve Uzaktan Erisim Otomatik Kurulum Araci # Web Paneli: https://desk360.web.app # ============================================================================== $ErrorActionPreference = "Continue" $ServerHost = "136.71.136.94" $IdServer = "136.71.136.94:21116" $PublicKey = "HgCOZuLs1ihX5MIFScVpqTeTiU7mcmVg0QryhyKVJRg=" $Utf8NoBom = New-Object System.Text.UTF8Encoding $false Write-Host "=================================================================" -ForegroundColor DarkCyan Write-Host " Desk360 — Otomatik Windows Istemci ve Masaustu Kurulumu " -ForegroundColor White Write-Host "=================================================================" -ForegroundColor DarkCyan Write-Host "[*] Bulut Sunucu : $ServerHost" -ForegroundColor Cyan # 1. Eski arka plan sureclerini durdur (yeni sunucu ve anahtarin uygulanmasi icin) Get-Process -Name "Desk360", "rustdesk", "rustdesk-engine" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue Start-Sleep -Milliseconds 800 # 2. RustDesk2.toml Yapilandirmasi (BOM'suz UTF-8) $ConfigDir = Join-Path $env:APPDATA "RustDesk\config" New-Item -ItemType Directory -Force -Path $ConfigDir | Out-Null $TomlPath = Join-Path $ConfigDir "RustDesk2.toml" $TomlContent = @" rendezvous_server = '$IdServer' nat_type = 1 serial = 0 [options] custom-rendezvous-server = '$ServerHost' relay-server = '$ServerHost' key = '$PublicKey' "@ $TomlContent = ($TomlContent -replace "`r`n", "`n") [System.IO.File]::WriteAllText($TomlPath, $TomlContent, $Utf8NoBom) Write-Host "[+] Desk360 bulut sunucu ve sifreleme anahtari yapilandirildi!" -ForegroundColor Green # Eger sistemde RustDesk Windows servisi kuruluysa yeniden baslat $RdService = Get-Service -Name "RustDesk" -ErrorAction SilentlyContinue if ($RdService) { try { Restart-Service -Name "RustDesk" -Force -ErrorAction SilentlyContinue Write-Host "[+] RustDesk Windows servisi yeni sunucuyla yeniden baslatildi." -ForegroundColor Green } catch {} } # 3. Desk360.exe Masaustu Programini Indir ve Masaustune Kaydet $DeskDir = Join-Path $env:LOCALAPPDATA "Desk360" New-Item -ItemType Directory -Force -Path $DeskDir | Out-Null $ExePath = Join-Path $DeskDir "Desk360.exe" try { Write-Host "[*] Desk360.exe Masaustu Programi indiriliyor..." -ForegroundColor Cyan Invoke-WebRequest -Uri "https://desk360.web.app/Desk360.exe" -OutFile $ExePath -UseBasicParsing $DesktopShortcut = Join-Path ([Environment]::GetFolderPath("Desktop")) "Desk360.exe" Copy-Item -Path $ExePath -Destination $DesktopShortcut -Force Write-Host "[+] Desk360.exe Masaustunuze kaydedildi!" -ForegroundColor Green } catch { Write-Host "[!] Desk360.exe indirilemedi: $($_.Exception.Message)" -ForegroundColor Yellow } # 4. Uzak erisim motorunu indir/baslat ve gercek cihaz ID'sini ekranda goster $EngineCandidates = @( (Join-Path $env:LOCALAPPDATA "rustdesk\rustdesk.exe"), (Join-Path $env:ProgramFiles "RustDesk\rustdesk.exe"), (Join-Path $DeskDir "rustdesk-engine.exe") ) $EnginePath = $EngineCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1 if (-not $EnginePath) { $EnginePath = Join-Path $DeskDir "rustdesk-engine.exe" Write-Host "[*] Uzaktan erisim motoru indiriliyor..." -ForegroundColor Cyan try { Invoke-WebRequest -Uri "https://github.com/rustdesk/rustdesk/releases/download/1.5.0/rustdesk-1.5.0-x86_64.exe" -OutFile $EnginePath -UseBasicParsing } catch { Write-Host "[!] Motor indirilemedi: $($_.Exception.Message)" -ForegroundColor Yellow } } if ($EnginePath -and (Test-Path $EnginePath)) { Start-Process -FilePath $EnginePath -ArgumentList "--server" -WindowStyle Hidden Start-Sleep -Seconds 3 $InstalledExe = Join-Path $env:LOCALAPPDATA "rustdesk\rustdesk.exe" $IdQueryExe = if (Test-Path $InstalledExe) { $InstalledExe } else { $EnginePath } try { $psi = New-Object System.Diagnostics.ProcessStartInfo $psi.FileName = $IdQueryExe $psi.Arguments = "--get-id" $psi.RedirectStandardOutput = $true $psi.UseShellExecute = $false $psi.CreateNoWindow = $true $proc = [System.Diagnostics.Process]::Start($psi) $deviceId = $proc.StandardOutput.ReadToEnd().Trim() $null = $proc.WaitForExit(5000) if ($deviceId -match "^\d{6,12}$") { Write-Host "[+] BU BILGISAYARIN DESK360 ID'SI: $deviceId" -ForegroundColor Cyan } } catch {} } $DesktopExe = Join-Path ([Environment]::GetFolderPath("Desktop")) "Desk360.exe" if (Test-Path $DesktopExe) { Start-Process -FilePath $DesktopExe } elseif (Test-Path $ExePath) { Start-Process -FilePath $ExePath }