# Starts the patched launcher directly, without updater.exe. # # updater.exe re-downloads app.jar whenever its hash differs from the # manifest, which is exactly what a patched jar looks like - so launching # through the desktop shortcut silently undoes the patch. This runs the # launcher itself, with the JavaFX runtime that ships next to it. $ErrorActionPreference = 'Stop' $LauncherHome = Join-Path $env:APPDATA 'kjstudio\launcher' $Java = Join-Path $LauncherHome 'runtime\java\bin\javaw.exe' $Jar = Join-Path $LauncherHome 'app.jar' $FxLib = Join-Path $LauncherHome 'runtime\javafx\lib' $FxBin = Join-Path $LauncherHome 'runtime\javafx\bin' if (-not (Test-Path $Java) -or -not (Test-Path $Jar)) { Write-Host " Нет лаунчера: $Jar" -ForegroundColor Red exit 1 } Remove-Item (Join-Path $LauncherHome 'app.lock') -Force -ErrorAction SilentlyContinue $env:JAVA_TOOL_OPTIONS = '' Write-Host ' Запускаю лаунчер напрямую (без updater.exe)...' Start-Process -FilePath $Java -ArgumentList @( '--module-path', "`"$FxLib`"", '--add-modules', 'ALL-MODULE-PATH', "-Djava.library.path=`"$FxBin`"", '-Dprism.order=sw', '-cp', "`"$Jar`"", 'application.Main' ) -WorkingDirectory $LauncherHome | Out-Null Start-Sleep -Seconds 12 $up = Get-Process -ErrorAction SilentlyContinue | Where-Object { $_.MainWindowTitle -like '*Koptojop*' } if ($up) { Write-Host ' Лаунчер запущен, окно должно появиться.' -ForegroundColor Green } else { Write-Host ' Лаунчер не поднялся, смотри logs в папке лаунчера.' -ForegroundColor Yellow exit 1 }