Files
desktop-plugin/windows/installer.iss
T
dzc fb399ae8f6 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 问题)。
2026-09-21 14:22:16 +08:00

54 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
; 资安信插件助手 Windows 安装包(Inno Setup 脚本)
; 构建:先在 Windows 上执行 flutter build windows --release,再用 Inno Setup 编译本脚本
; iscc windows\installer.iss
; 产物:dist\资安信插件助手-windows-setup.exe
#define AppName "资安信插件助手"
#define AppVersion "1.0.0"
#define AppExeName "desktop_plugin.exe"
[Setup]
AppId={{8C5B7A42-1F2D-4E6B-9A71-9D3A0F2C7E51}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher=zax
DefaultDirName={autopf}\{#AppName}
DefaultGroupName={#AppName}
UninstallDisplayIcon={app}\{#AppExeName}
OutputDir=..\dist
OutputBaseFilename=资安信插件助手-windows-setup
; x64compatible 需 Inno 6.3+;x64 全系 6.x 兼容
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64
Compression=lzma2/max
SolidCompression=yes
WizardStyle=modern
PrivilegesRequired=lowest
; HiTi PavoApi SDK(PavoApiW_x64.dll 等)由 CMake 构建后自动拷在 Release 目录,随 Files 段一并打包
[Languages]
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
[Tasks]
Name: "desktopicon"; Description: "创建桌面快捷方式"; GroupDescription: "附加任务:"
Name: "autostart"; Description: "开机自动启动"; GroupDescription: "附加任务:"; Flags: checkedonce
[Files]
Source: "..\build\windows\x64\runner\Release\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{group}\卸载 {#AppName}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon
[Registry]
; zaxprint:// URL scheme(HKCU 用户级,随卸载清理;应用启动时也会幂等注册)
Root: HKCU; Subkey: "Software\Classes\zaxprint"; ValueType: string; ValueData: "URL:资安信插件助手唤起"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Classes\zaxprint"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""
Root: HKCU; Subkey: "Software\Classes\zaxprint\shell\open\command"; ValueType: string; ValueData: """{app}\{#AppExeName}"" ""%1"""; Flags: uninsdeletekey
; 开机自启(Tasks 勾选时写入)
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "ZaxDesktopPlugin"; ValueData: """{app}\{#AppExeName}"""; Tasks: autostart; Flags: uninsdeletevalue
[Run]
Filename: "{app}\{#AppExeName}"; Description: "立即运行 {#AppName}"; Flags: nowait postinstall skipifsilent