feat(launcher): SimpleLite 进程独立化与 DLL 热更新
- FollowParent=false 时在 Windows 用 cmd /c start 脱离父进程组,关闭 MiGu.Server 不再连带结束 SimpleLite - 新增 SimpleLiteBuildSync:SimpleLite 未运行时把 obj/Debug 最新 DLL 同步到 bin/Debug,并探测「前往站点」API 是否可用 - 新增 RestartForUpdate 与 POST /api/health/simplelite/restart-for-update:一键关闭、同步、重启以加载新 API - 诊断增加 FollowParent / GotoSiteApiAvailable / DeployHint;新增 scripts/redeploy-simplelite.ps1 部署脚本 - Dispose 增加 _disposed 幂等保护,避免重复释放
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# 将最新编译的 SimpleLite 部署到 bin\Debug 并提示重启。
|
||||
# 用法:先关闭 SimpleLite(任务管理器或托盘退出),再运行本脚本。
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path
|
||||
$slProj = Join-Path $repoRoot 'Simple\SimpleLite\SimpleLite.csproj'
|
||||
$outDir = Join-Path $repoRoot 'Simple\SimpleLite\bin\Debug'
|
||||
$objDll = Join-Path $repoRoot 'Simple\SimpleLite\obj\Debug\SimpleLite.dll'
|
||||
|
||||
Write-Host '==> 编译 SimpleLite (DisableFody)...' -ForegroundColor Cyan
|
||||
dotnet build $slProj -c Debug -p:DisableFody=true
|
||||
if ($LASTEXITCODE -ne 0) { throw "dotnet build 失败 (exit $LASTEXITCODE)" }
|
||||
|
||||
$builtDll = if (Test-Path $objDll) { $objDll } else { Join-Path $outDir 'SimpleLite.dll' }
|
||||
|
||||
if (Get-Process SimpleLite -ErrorAction SilentlyContinue) {
|
||||
Write-Host ''
|
||||
Write-Host 'SimpleLite 仍在运行,无法覆盖 DLL。请先关闭 SimpleLite.exe,再重新运行本脚本。' -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
Copy-Item $builtDll (Join-Path $outDir 'SimpleLite.dll') -Force
|
||||
$objExe = Join-Path $repoRoot 'Simple\SimpleLite\obj\Debug\SimpleLite.exe'
|
||||
if (Test-Path $objExe) {
|
||||
Copy-Item $objExe (Join-Path $outDir 'SimpleLite.exe') -Force
|
||||
}
|
||||
|
||||
Write-Host '==> 已更新' $outDir -ForegroundColor Green
|
||||
Write-Host '请重新登录迷榖平台(或手动启动 SimpleLite.exe)以加载新 API。'
|
||||
Reference in New Issue
Block a user