49 lines
1.6 KiB
PowerShell
49 lines
1.6 KiB
PowerShell
# Better-EN5 插件安装脚本
|
|
# 以管理员身份运行
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$pluginName = "Better-EN5"
|
|
$seewoPath = "$env:ProgramFiles(x86)\Seewo\EasiNote5"
|
|
|
|
# 查找最新版本目录
|
|
$versionDirs = Get-ChildItem "$seewoPath\EasiNote5_*" -Directory | Sort-Object Name -Descending
|
|
if ($versionDirs.Count -eq 0) {
|
|
Write-Host "未找到希沃白板安装目录" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
$targetDir = Join-Path $versionDirs[0].FullName "Main\Extensions\$pluginName"
|
|
|
|
Write-Host "安装到: $targetDir" -ForegroundColor Cyan
|
|
|
|
# 创建插件目录
|
|
if (-not (Test-Path $targetDir)) {
|
|
New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
|
|
}
|
|
|
|
# 复制插件文件
|
|
$sourceDir = Join-Path $PSScriptRoot "Better-EN5\bin\Release\net6.0-windows"
|
|
if (-not (Test-Path $sourceDir)) {
|
|
$sourceDir = Join-Path $PSScriptRoot "Better-EN5\bin\Debug\net6.0-windows"
|
|
}
|
|
|
|
if (Test-Path $sourceDir) {
|
|
Copy-Item "$sourceDir\*" $targetDir -Recurse -Force
|
|
Write-Host "插件文件已复制" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "未找到构建输出目录,请先构建项目" -ForegroundColor Yellow
|
|
Write-Host "期望路径: $sourceDir" -ForegroundColor Yellow
|
|
}
|
|
|
|
# 复制 manifest.coin
|
|
$manifestSource = Join-Path $PSScriptRoot "Better-EN5\manifest.coin"
|
|
if (Test-Path $manifestSource) {
|
|
Copy-Item $manifestSource $targetDir -Force
|
|
Write-Host "manifest.coin 已复制" -ForegroundColor Green
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "安装完成!请重启希沃白板以加载插件。" -ForegroundColor Green
|
|
Write-Host "在希沃白板的右键菜单中可以找到 'Better-Seewo 设置' 入口。" -ForegroundColor Cyan
|