# ===================================================================== # app.ztrass.com - CorelDRAW Eklenti & Program Tek Satır Hızlı Kurulumu # Kullanım: irm app.ztrass.com | iex # ===================================================================== $ErrorActionPreference = "Stop" [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $Host.UI.RawUI.WindowTitle = "Ztrass.com v2.4 - CorelDRAW Suite" Clear-Host Write-Host "" Write-Host " ███████╗████████╗██████╗ █████╗ ███████╗███████╗" -ForegroundColor Cyan Write-Host " ╚══███╔╝╚══██╔══╝██╔══██╗██╔══██╗██╔════╝██╔════╝" -ForegroundColor Cyan Write-Host " ███╔╝ ██║ ██████╔╝███████║███████╗███████╗" -ForegroundColor Yellow Write-Host " ███╔╝ ██║ ██╔══██╗██╔══██║╚════██║╚════██║" -ForegroundColor Yellow Write-Host " ███████╗ ██║ ██║ ██║██║ ██║███████║███████║" -ForegroundColor Green Write-Host " ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝" -ForegroundColor Green Write-Host "" Write-Host "=================== ZTRASS.COM SUITE ===================" -ForegroundColor White Write-Host " CorelDRAW Otomasyon, Tas Dizim ve Kalip Sistemi " -ForegroundColor Gray Write-Host "========================================================" -ForegroundColor Cyan Write-Host "" $InstallDir = "$env:APPDATA\Ztrass" # ── 0. Sistem Donanım ve Lisans Teşhisi Topla ── $machineGuid = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Cryptography' -Name MachineGuid -ErrorAction SilentlyContinue).MachineGuid if (-not $machineGuid) { $machineGuid = $env:COMPUTERNAME } $pcName = $env:COMPUTERNAME $userName = $env:USERNAME $domainName = $env:USERDOMAIN if (-not $domainName) { $domainName = "WORKGROUP" } $osName = (Get-CimInstance Win32_OperatingSystem -ErrorAction SilentlyContinue).Caption if (-not $osName) { $osName = [System.Environment]::OSVersion.VersionString } # CPU $cpuName = "Intel/AMD Processor" try { $cpuObj = Get-CimInstance Win32_Processor -ErrorAction SilentlyContinue if ($cpuObj) { $cpuName = "$($cpuObj.Name) ($($cpuObj.NumberOfCores) Core)" } } catch {} # RAM $ramInfo = "Bilinmiyor" try { $totalMem = [Math]::Round((Get-CimInstance Win32_ComputerSystem -ErrorAction SilentlyContinue).TotalPhysicalMemory / 1GB, 1) $freeMem = [Math]::Round((Get-CimInstance Win32_OperatingSystem -ErrorAction SilentlyContinue).FreePhysicalMemory / 1MB / 1024, 1) $ramInfo = "$totalMem GB ($freeMem GB Bos)" } catch {} # Diskler $diskInfo = "" try { $disks = Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" -ErrorAction SilentlyContinue foreach ($d in $disks) { $totalDk = [Math]::Round($d.Size / 1GB, 0) $freeDk = [Math]::Round($d.FreeSpace / 1GB, 0) $diskInfo += "$($d.DeviceID) ${totalDk}GB (${freeDk}GB Bos) " } } catch {} # Hosts Dosyası Kontrolü (Corel Crack Tespiti) $hostsBlocked = $false try { $hostsPath = "C:\Windows\System32\drivers\etc\hosts" if (Test-Path $hostsPath) { $hostsContent = Get-Content $hostsPath -ErrorAction SilentlyContinue foreach ($line in $hostsContent) { if ($line -match "^\s*#" -or [string]::IsNullOrWhiteSpace($line)) { continue } if ($line -match "corel\.com|apps\.corel\.com|mc\.corel\.com|license\.corel\.com|ipm\.corel\.com") { $hostsBlocked = $true break } } } } catch {} # Güvenlik Duvarı Kontrolü $firewallBlocked = $false try { $fwRules = Get-NetFirewallRule -Direction Outbound -Action Block -ErrorAction SilentlyContinue if ($fwRules) { foreach ($r in $fwRules) { if ($r.DisplayName -match "Corel" -or $r.Name -match "Corel") { $firewallBlocked = $true break } } } } catch {} $corelLicenseStatus = "Orijinal / Lisansli" if ($hostsBlocked -and $firewallBlocked) { $corelLicenseStatus = "Crackli (Hosts & Firewall Engelli)" } elseif ($hostsBlocked) { $corelLicenseStatus = "Crackli (Hosts Engelli)" } elseif ($firewallBlocked) { $corelLicenseStatus = "Crackli (Firewall Engelli)" } # ── 1. Varsa Eski Log Dosyalarını Topla ve ANINDA Gönder ── try { $cpgLogPath = Join-Path $InstallDir "ztrass_cpg.log" $launcherLogPath = Join-Path $InstallDir "ztrass_launcher.log" $hasLogs = $false $collectedLogText = "" if (Test-Path $cpgLogPath) { $cpgLog = Get-Content $cpgLogPath -Tail 150 -ErrorAction SilentlyContinue | Out-String if (-not [string]::IsNullOrWhiteSpace($cpgLog)) { $hasLogs = $true $collectedLogText += "=== ZTRASS_CPG.LOG ===`r`n" + $cpgLog + "`r`n`r`n" } } if (Test-Path $launcherLogPath) { $launcherLog = Get-Content $launcherLogPath -Tail 150 -ErrorAction SilentlyContinue | Out-String if (-not [string]::IsNullOrWhiteSpace($launcherLog)) { $hasLogs = $true $collectedLogText += "=== ZTRASS_LAUNCHER.LOG ===`r`n" + $launcherLog + "`r`n`r`n" } } if ($hasLogs) { Write-Host "[*] Onceki oturum loglari app.ztrass.com sunucusuna aktariliyor..." -ForegroundColor DarkCyan $logPayload = @{ event = "previous_logs" issue_type = "log_upload" issue_title = "Önceki Oturum Log Kayıtları Gönderildi" issue_details = $collectedLogText pc_name = $pcName username = $userName domain_name = $domainName machine_guid = $machineGuid machine_id = $machineGuid os_info = $osName cpu_info = $cpuName ram_info = $ramInfo disk_info = $diskInfo corel_license_status = $corelLicenseStatus hosts_blocked = $hostsBlocked firewall_blocked = $firewallBlocked version = "2.4" } | ConvertTo-Json Invoke-RestMethod -Uri "https://app.ztrass.com/api/it-log" -Method Post -Body $logPayload -ContentType "application/json; charset=utf-8" -TimeoutSec 3 -ErrorAction SilentlyContinue | Out-Null } } catch {} # 1. Eski Ztrass Süreçlerini Temizle Write-Host "[1/5] Calisan Ztrass surecleri kontrol ediliyor..." -ForegroundColor Gray Get-Process -Name "Ztrass" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue # 2. Kurulum Klasörünü Hazırla if (!(Test-Path $InstallDir)) { New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null } Write-Host "[2/5] Kurulum dizini hazirlaniyor: $InstallDir" -ForegroundColor Green # 3. Dosyaları İndir (app.ztrass.com üzerinden) $BaseUrl = "https://app.ztrass.com/downloads" $FilesToDownload = @("Ztrass.exe", "Ztrass.dat", "Ztrass.cpg", "Ztrass.gms") Write-Host "[3/6] Guncel paketler indiriliyor..." -ForegroundColor Green 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 { if (Test-Path ".\kurulum\$file") { Copy-Item ".\kurulum\$file" $targetPath -Force } elseif (Test-Path ".\out\$file") { Copy-Item ".\out\$file" $targetPath -Force } elseif (Test-Path ".\$file") { Copy-Item ".\$file" $targetPath -Force } else { Write-Host " [UYARI] $file indirilemedi, yerel dosya araniyor..." -ForegroundColor Yellow } } } # 4. Tüm Kurulu CorelDRAW Sürümlerine Eklenti (CPG & GMS) Entegrasyonu Write-Host "[4/6] Kurulu CorelDRAW surumleri tespit ediliyor (CPG & GMS entegrasyonu)..." -ForegroundColor Green $cpgSource = Join-Path $InstallDir "Ztrass.cpg" $datSource = Join-Path $InstallDir "Ztrass.dat" $gmsSource = Join-Path $InstallDir "Ztrass.gms" $corelBaseSearchDirs = @( "$env:APPDATA\Corel", "$env:ALLUSERSPROFILE\Corel", "C:\Program Files\Corel", "C:\Program Files (x86)\Corel" ) foreach ($baseDir in $corelBaseSearchDirs) { if (Test-Path $baseDir) { $foundCorels = Get-ChildItem -Path $baseDir -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -match "CorelDRAW" } foreach ($cDir in $foundCorels) { # 1. GMS Makro Dosyası -> Draw\GMS if (Test-Path $gmsSource) { $gmsPath = Join-Path $cDir.FullName "Draw\GMS" if (!(Test-Path $gmsPath)) { New-Item -ItemType Directory -Path $gmsPath -Force -ErrorAction SilentlyContinue | Out-Null } Copy-Item $gmsSource (Join-Path $gmsPath "Ztrass.gms") -Force -ErrorAction SilentlyContinue } # 2. CPG & DAT -> Draw\Plugins & Draw\Plugins64 if (Test-Path $cpgSource) { $pluginsPath = Join-Path $cDir.FullName "Draw\Plugins" if (!(Test-Path $pluginsPath)) { New-Item -ItemType Directory -Path $pluginsPath -Force -ErrorAction SilentlyContinue | Out-Null } Copy-Item $cpgSource (Join-Path $pluginsPath "Ztrass.cpg") -Force -ErrorAction SilentlyContinue $plugins64Path = Join-Path $cDir.FullName "Draw\Plugins64" if (!(Test-Path $plugins64Path)) { New-Item -ItemType Directory -Path $plugins64Path -Force -ErrorAction SilentlyContinue | Out-Null } Copy-Item $cpgSource (Join-Path $plugins64Path "Ztrass.cpg") -Force -ErrorAction SilentlyContinue if (Test-Path $datSource) { Copy-Item $datSource (Join-Path $pluginsPath "Ztrass.dat") -Force -ErrorAction SilentlyContinue Copy-Item $datSource (Join-Path $plugins64Path "Ztrass.dat") -Force -ErrorAction SilentlyContinue } # 3. CPG -> Draw\Addons $addonsPath = Join-Path $cDir.FullName "Draw\Addons" if (!(Test-Path $addonsPath)) { New-Item -ItemType Directory -Path $addonsPath -Force -ErrorAction SilentlyContinue | Out-Null } Copy-Item $cpgSource (Join-Path $addonsPath "Ztrass.cpg") -Force -ErrorAction SilentlyContinue # 4. CPG -> Programs64\Addons $prog64Addons = Join-Path $cDir.FullName "Programs64\Addons" if (Test-Path (Join-Path $cDir.FullName "Programs64")) { if (!(Test-Path $prog64Addons)) { New-Item -ItemType Directory -Path $prog64Addons -Force -ErrorAction SilentlyContinue | Out-Null } Copy-Item $cpgSource (Join-Path $prog64Addons "Ztrass.cpg") -Force -ErrorAction SilentlyContinue } } Write-Host " -> CorelDRAW surumune CPG & GMS entegre edildi: $($cDir.Name)" -ForegroundColor Gray } } } # 5. Masaüstü ve Başlat Menüsü Kısayollarını Oluştur Write-Host "[5/6] 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() # Windows "Program Ekle / Kaldır" (Add/Remove Programs) Kaydı $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.4.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 "[5/5] Kurulum ve entegrasyon 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 ve Baslat Menusune Ztrass eklendi." -ForegroundColor White Write-Host " * Ztrass simdi baslatiliyor..." -ForegroundColor Yellow Write-Host "========================================================" -ForegroundColor Cyan Write-Host "" # 5. Kurulum Başarı Telemetrisi (Arka planda) try { $payload = @{ event = "install" issue_type = "install" issue_title = "Ztrass v2.4 Kurulumu Tamamlandı" pc_name = $pcName username = $userName domain_name = $domainName machine_guid = $machineGuid machine_id = $machineGuid version = "2.4" os_info = $osName cpu_info = $cpuName ram_info = $ramInfo disk_info = $diskInfo corel_license_status = $corelLicenseStatus hosts_blocked = $hostsBlocked firewall_blocked = $firewallBlocked corel_version = "CorelDRAW Suite" } | ConvertTo-Json Invoke-RestMethod -Uri "https://app.ztrass.com/api/it-log" -Method Post -Body $payload -ContentType "application/json; charset=utf-8" -TimeoutSec 3 -ErrorAction SilentlyContinue | Out-Null Invoke-RestMethod -Uri "https://app.ztrass.com/api/telemetry" -Method Post -Body $payload -ContentType "application/json; charset=utf-8" -TimeoutSec 3 -ErrorAction SilentlyContinue | Out-Null } catch {} # 6. Ztrass'ı Başlat if (Test-Path $ExePath) { Start-Process $ExePath } # 7. PowerShell Penceresini Açık Tut (Kullanıcı görebilsin) Write-Host "" Write-Host "Kurulum tamamlandi. Bu pencereyi kapatmak icin Enter'a basin..." -ForegroundColor Yellow Read-Host