v1.1.1: 构建修复,优化警告,新增自动脚本

This commit is contained in:
雾启工作室
2026-06-28 09:51:56 +08:00
parent 4b797a982d
commit 6bddb75904
7 changed files with 138 additions and 8 deletions

View File

@@ -7,8 +7,8 @@
<Nullable>enable</Nullable>
<RootNamespace>BetterEN5</RootNamespace>
<AssemblyName>Better-EN5</AssemblyName>
<Version>1.1.0</Version>
<FileVersion>1.1.0</FileVersion>
<Version>1.1.1</Version>
<FileVersion>1.1.1</FileVersion>
<Authors>雾启工作室</Authors>
<Author>雾启工作室</Author>
<Company>雾启工作室</Company>

View File

@@ -35,7 +35,7 @@ namespace BetterEN5
private async void Run()
{
await Task.Delay(TimeSpan.FromSeconds(3));
TouchFixService.ApplyFixAsync();
await TouchFixService.ApplyFixAsync();
ExportUIItems();
}

View File

@@ -11,11 +11,11 @@ namespace BetterEN5.Services
{
await Task.Run(() =>
{
dynamic? board = GetENProperty("CurrentBoardApi");
var board = GetENProperty("CurrentBoardApi");
if (board == null) return;
dynamic? slides = board.Slides;
if (slides == null || slides.Count == 0) return;
dynamic slides = board.Slides;
if (slides == null) return;
var inkData = new InkPackage();
foreach (var slide in slides)
@@ -58,7 +58,7 @@ namespace BetterEN5.Services
var inkData = System.Text.Json.JsonSerializer.Deserialize<InkPackage>(json);
if (inkData == null) return;
dynamic? board = GetENProperty("CurrentBoardApi");
var board = GetENProperty("CurrentBoardApi");
if (board == null) return;
foreach (var slideData in inkData.Slides)

View File

@@ -24,5 +24,5 @@ Preinstalled
False
>
Version
1.1.0
1.1.1
>

View File

@@ -252,6 +252,39 @@ Better-EN5/bin/Release/net6.0-windows/
## 许可证
## 构建方法
### 前置条件
1. 已安装 **希沃白板 5**(版本 5.2.2.653 ~ 5.3.0.0
2. 已安装 **.NET SDK 6.0**(推荐 `C:\Program Files\dotnet`
3. 确保 `dotnet``PATH` 中,或使用完整路径
### 构建 Release
```powershell
# 方式一:确保 dotnet 在 PATH
set PATH=C:\Program Files\dotnet;%PATH%
dotnet build -c Release Better-EN5
# 方式二:使用完整路径
& "C:\Program Files\dotnet\dotnet.exe" build -c Release Better-EN5
```
### 安装到希沃白板
```powershell
# 管理员身份运行
.\scripts\install.ps1
```
### 构建输出
| 文件 | 说明 |
|------|------|
| `Better-EN5\bin\Release\net6.0-windows\Better-EN5.dll` | 插件 DLL |
| `Better-EN5\bin\Release\net6.0-windows\Better-EN5.exe` | 宿主程序 |
| `bin\Release\Better-Seewo 增强插件.X.X.X.exe` | 安装包 |
| `bin\Release\Better-Seewo 增强插件.X.X.X.zip` | 插件包 (.enp) |
## 许可协议
本项目仅供 **学习交流** 使用。
## 致谢

43
scripts/build-release.ps1 Normal file
View File

@@ -0,0 +1,43 @@
# Better-EN5 自动构建与发布脚本
param(
[string]$Version = "1.1.0",
[switch]$Push
)
$ErrorActionPreference = "Stop"
$dotnet = "C:\Program Files\dotnet\dotnet.exe"
$repoDir = Split-Path -Parent $PSScriptRoot
echo $ENV:output_folder
# 设置 PATH
$env:Path = "C:\Program Files\dotnet;C:\Program Files\Git\bin;$env:Path"
Write-Host "=== Better-EN5 构建脚本 ===" -ForegroundColor Cyan
Write-Host "版本: $Version" -ForegroundColor White
Write-Host ""
# 1. 构建
Write-Host "[1/3] 构建项目..." -ForegroundColor Yellow
& $dotnet build -c Release "$repoDir\Better-EN5"
if (-not $?) { Write-Host "构建失败" -ForegroundColor Red; exit 1 }
Write-Host "构建成功" -ForegroundColor Green
# 2. 安装到希沃白板
Write-Host "[2/3] 安装到希沃白板..." -ForegroundColor Yellow
& "$repoDir\scripts\install.ps1" -BuildConfig Release
if (-not $?) { Write-Host "安装失败" -ForegroundColor Red; exit 1 }
Write-Host "安装成功" -ForegroundColor Green
# 3. Git 提交与推送
if ($Push) {
Write-Host "[3/3] 推送至远程仓库..." -ForegroundColor Yellow
Set-Location $repoDir
git add -A
git commit -m "v$Version: 自动构建发布"
git tag "v$Version"
git push origin main --tags
Write-Host "推送成功" -ForegroundColor Green
}
Write-Host ""
Write-Host "=== 完成 ===" -ForegroundColor Green
Write-Host "安装文件: $repoDir\bin\Release\Better-Seewo 增强插件.$Version.exe" -ForegroundColor Cyan

54
scripts/install.ps1 Normal file
View File

@@ -0,0 +1,54 @@
# Better-EN5 插件安装脚本
# 以管理员身份运行
param(
[string]$BuildConfig = "Release"
)
$ErrorActionPreference = "Stop"
$pluginName = "Better-EN5"
$seewoPath = "$env:ProgramFiles(x86)\Seewo\EasiNote5"
$dotnet = "C:\Program Files\dotnet\dotnet.exe"
# 查找最新版本目录
$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"
$sourceDir = Join-Path $PSScriptRoot "..\Better-EN5\bin\$BuildConfig\net6.0-windows"
Write-Host "安装到: $targetDir" -ForegroundColor Cyan
# 检查构建输出
if (-not (Test-Path $sourceDir)) {
Write-Host "未找到构建输出,正在构建..." -ForegroundColor Yellow
if (Test-Path $dotnet) {
$env:Path = "C:\Program Files\dotnet;$env:Path"
& $dotnet build -c $BuildConfig (Join-Path $PSScriptRoot "..\Better-EN5")
if (-not $?) { exit 1 }
} else {
Write-Host "找不到 dotnet 编译器" -ForegroundColor Red
exit 1
}
}
# 创建插件目录
New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
# 复制插件文件
Copy-Item "$sourceDir\*" $targetDir -Recurse -Force
Write-Host "插件文件已复制" -ForegroundColor Green
# 复制 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