fix(windows): 全量代码审查修复——中文乱码风险/Inno 兼容/ffi 布局自检/部署说明

系统性把 mac 踩过的坑逐一在 Windows 对应路径排查后修复四处:

1. runner 加 /utf-8 编译选项(高危):MSVC 默认按系统代码页(中文 Windows=GBK)
   解析 UTF-8 源码,main.cpp 的 L"资安信插件助手" 窗口标题会乱码
2. installer.iss 的 x64compatible → x64:前者需 Inno 6.3+,旧版 iscc 直接报错
3. PavoApi 构造加结构体布局 assert(80/32/16/48 字节,对齐 C# 实机验证值),
   Windows 首跑(debug)即暴露 ffi 对齐差异
4. README 补 Windows 部署注意:VC++ Redistributable(PavoApiW_x64.dll 可能
   动态依赖 vcruntime140.dll)、SmartScreen 未签名提示、Inno 6.x 要求

其余复查项确认无问题:reg 命令引号(空格路径安全)、Dart/Inno 的 Run 键名
一致(ZaxDesktopPlugin)、vendor DLL 拷贝用生成器表达式(Debug/Release 通用)、
pavo 全部 ffi 调用在 Isolate.run、scheme 注册表路径拼接、关窗拦截走
window_manager 的 WM_CLOSE 主路径(无 mac 的 _close: 私有 selector 问题)。
This commit is contained in:
dzc committed 2026-09-21 14:22:16 +08:00
1 parent 78d6b82305
commit fb399ae8f6
4 files changed
+20 -2

No files matched your search

+6
View File
@@ -19,6 +19,12 @@ class PavoApi {
_getDeviceInfo =
_tryGetDeviceInfo('PAVO_GetDeviceInfoW') ?? _tryGetDeviceInfo('PAVO_GetDeviceInfo')!;
_printOneCard = _tryPrintOneCard('PAVO_PrintOneCardW') ?? _tryPrintOneCard('PAVO_PrintOneCard')!;
// 布局自检:Dart Struct 按 C ABI 自然对齐,与 C# 版(已实机验证)的
// sizeof 逐一核对;首个 Windows 环境首跑即暴露对齐差异
assert(sizeOf<HitiCardPrintParameter>() == 80, 'HitiCardPrintParameter 布局异常');
assert(sizeOf<GdiBitmap>() == 32, 'GdiBitmap 布局异常');
assert(sizeOf<HitiHeatingEnergy>() == 16, 'HitiHeatingEnergy 布局异常');
assert(sizeOf<HitiSettings>() == 48, 'HitiSettings 布局异常');
}
static const String _dllName = 'PavoApiW_x64.dll';