# ===================================================================== # dl.ztrass.com - CorelDRAW Eklenti & Program Tek Satır Hızlı Kurulumu # Kullanım: irm dl.ztrass.com | iex # ===================================================================== $ErrorActionPreference = "Stop" [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $Host.UI.RawUI.WindowTitle = "Ztrass.com v2.3 - Hizli Kurulum" Write-Host "" Write-Host "=================================================================" -ForegroundColor Cyan Write-Host " ZTRASS.COM - CORELDRAW EKLENTISI VE YONETICISI " -ForegroundColor Yellow Write-Host " Otomatik Web Kurulumu (v2.3) " -ForegroundColor White Write-Host "=================================================================" -ForegroundColor Cyan Write-Host "" # 1. Calisan Ztrass'i Kapat Get-Process -Name "Ztrass" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue # 2. Kurulum Klasörünü Belirle (%APPDATA%\Ztrass) $InstallDir = "$env:APPDATA\Ztrass" if (!(Test-Path $InstallDir)) { New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null } Write-Host "[1/4] Kurulum dizini hazirlaniyor: $InstallDir" -ForegroundColor Green # 3. Dosyaları İndir (app.ztrass.com üzerinden) $BaseUrl = "https://app.ztrass.com/downloads" $FilesToDownload = @("Ztrass.exe", "Ztrass.dat") foreach ($file in $FilesToDownload) { $targetPath = Join-Path $InstallDir $file Write-Host " -> Indiriliyor: $file ..." -ForegroundColor Gray try { Invoke-WebRequest -Uri "$BaseUrl/$file" -OutFile $targetPath -UseBasicParsing } catch { # Yerel dosya varsa fallback olarak kopyala (test ortami) if (Test-Path ".\Release_Ztrass_v2.3\$file") { Copy-Item ".\Release_Ztrass_v2.3\$file" $targetPath -Force } elseif (Test-Path ".\$file") { Copy-Item ".\$file" $targetPath -Force } else { Write-Host " [UYARI] $file indirilemedi, sunucu dosyalari kontrol edilmeli." -ForegroundColor Yellow } } } # 4. Masaüstü ve Başlat Menüsü Kısayollarını Oluştur Write-Host "[2/4] Masaustu ve Baslat Menusu kisayollari olusturuluyor..." -ForegroundColor Green $WshShell = New-Object -ComObject WScript.Shell $ExePath = Join-Path $InstallDir "Ztrass.exe" # Masaüstü Kısayolu $DesktopShortcutPath = Join-Path ([Environment]::GetFolderPath("Desktop")) "Ztrass.lnk" $Shortcut = $WshShell.CreateShortcut($DesktopShortcutPath) $Shortcut.TargetPath = $ExePath $Shortcut.WorkingDirectory = $InstallDir $Shortcut.Description = "Ztrass.com - CorelDRAW Tas ve Kalip Eklentisi" $Shortcut.Save() # Başlat Menüsü Kısayolu $StartMenuDir = [Environment]::GetFolderPath("Programs") $StartShortcutPath = Join-Path $StartMenuDir "Ztrass.lnk" $StartShortcut = $WshShell.CreateShortcut($StartShortcutPath) $StartShortcut.TargetPath = $ExePath $StartShortcut.WorkingDirectory = $InstallDir $StartShortcut.Description = "Ztrass.com - CorelDRAW Tas ve Kalip Eklentisi" $StartShortcut.Save() # Başlat Menüsü Klasör Kısayolu $ZtrassFolder = Join-Path $StartMenuDir "Ztrass.com" if (!(Test-Path $ZtrassFolder)) { New-Item -ItemType Directory -Path $ZtrassFolder -Force | Out-Null } $StartFolderShortcut = $WshShell.CreateShortcut((Join-Path $ZtrassFolder "Ztrass.lnk")) $StartFolderShortcut.TargetPath = $ExePath $StartFolderShortcut.WorkingDirectory = $InstallDir $StartFolderShortcut.Save() # 5. Windows "Program Ekle / Kaldır" (Add/Remove Programs) Kaydını Yap Write-Host "[3/4] Windows Program Kaydi olusturuluyor..." -ForegroundColor Green $UninstallKey = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ztrass" if (!(Test-Path $UninstallKey)) { New-Item -Path $UninstallKey -Force | Out-Null } Set-ItemProperty -Path $UninstallKey -Name "DisplayName" -Value "Ztrass.com CorelDRAW Suite" Set-ItemProperty -Path $UninstallKey -Name "DisplayVersion" -Value "2.3.0" Set-ItemProperty -Path $UninstallKey -Name "Publisher" -Value "Ztrass.com" Set-ItemProperty -Path $UninstallKey -Name "DisplayIcon" -Value "$ExePath,0" Set-ItemProperty -Path $UninstallKey -Name "InstallLocation" -Value $InstallDir Set-ItemProperty -Path $UninstallKey -Name "UninstallString" -Value "powershell -Command `"irm app.ztrass.com/uninstall | iex`"" Write-Host "[4/4] Kurulum basariyla tamamlandi!" -ForegroundColor Green Write-Host "" Write-Host "=================================================================" -ForegroundColor Cyan Write-Host " [TEBRIKLER] ZTRASS.COM BASARIYLA KURULDU! " -ForegroundColor Green Write-Host "=================================================================" -ForegroundColor Cyan Write-Host " * Kurulum Yeri : $InstallDir" -ForegroundColor White Write-Host " * Masaustune 'Ztrass' kisayolu eklendi." -ForegroundColor White Write-Host " * Baslat Menusune 'Ztrass' eklendi." -ForegroundColor White Write-Host " * Ztrass simdi baslatiliyor..." -ForegroundColor Yellow Write-Host "=================================================================" -ForegroundColor Cyan Write-Host "" # 6. Anonim Kurulum Telemetri Bildirimi (Arka planda) try { $machineGuid = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Cryptography' -Name MachineGuid -ErrorAction SilentlyContinue).MachineGuid if (-not $machineGuid) { $machineGuid = $env:COMPUTERNAME } $payload = @{ event = "install" version = "2.3" machine_id = $machineGuid os = [System.Environment]::OSVersion.VersionString corel_version = "CorelDRAW Suite" } | ConvertTo-Json Invoke-RestMethod -Uri "https://app.ztrass.com/api/telemetry" -Method Post -Body $payload -ContentType "application/json" -TimeoutSec 2 -ErrorAction SilentlyContinue | Out-Null } catch {} # Programı başlat if (Test-Path $ExePath) { Start-Process $ExePath }