fix(desktop): 打包元数据还是 wails3 脚手架模板值,app 根本起不来

现象:wails3 package 出来的 .app 双击报「可执行文件不存在」,macOS 直接拒绝启动。

根因是我迁移 v3 时埋的:build/darwin/Info.plist 里 CFBundleExecutable 写着
"wails3ref"、bundle ID 是 "com.example.wails3ref",全是脚手架模板默认值,
而实际二进制叫 sundynix_desktop —— 对不上,macOS 认为 bundle 坏了。

我当时在 build/config.yml 里填了正确的产品信息(com.sundynix.agentix /
sundynix-agentix),但漏了那个文件顶部写明的一步:改了 info 要跑
`wails3 task common:update:build-assets` 重新生成资产。补跑之后不只 macOS,
Linux 的 desktop/nfpm、Windows 的 info.json/nsis/manifest 里的
"My Product"/"My Company"/"wails3ref" 也一并换成了真实产品信息 ——
这些留到打包分发才发现就麻烦了。

Assets.car/icons.icns 一并提交:体积变化大(1.63→2.03MB / 52→45KB)不是噪声,
是真被重新生成了;但逐像素比对确认图案没变(平均差 0.6/255),无回归。

顺带删掉重生成又造出来的 build/ios —— 项目是 desktop-only。这次它只有
plist/storyboard/pbxproj、没有 .go 文件,不会像当初那样让 go build ./... 挂掉,
但也没必要留。已验 go build ./... 通过。

已知待办(非本次引入):app 图标至今是 Wails 默认的 "W" logo,从没做过自定义。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-16 11:42:21 +08:00
parent bfbca08d72
commit d52af12f3d
9 changed files with 82 additions and 80 deletions
+5 -5
View File
@@ -5,11 +5,11 @@
"info": {
"0000": {
"ProductVersion": "0.1.0",
"CompanyName": "My Company",
"FileDescription": "A wails3ref application",
"LegalCopyright": "© 2026, My Company",
"ProductName": "My Product",
"Comments": "This is a comment"
"CompanyName": "sundynix",
"FileDescription": "事件驱动的 AI Agent 工作台",
"LegalCopyright": "(c) 2026, sundynix",
"ProductName": "sundynix-agentix",
"Comments": "sundynix-agentix desktop"
}
}
}
@@ -5,19 +5,19 @@
!include "FileFunc.nsh"
!ifndef INFO_PROJECTNAME
!define INFO_PROJECTNAME "wails3ref"
!define INFO_PROJECTNAME "sundynix_desktop"
!endif
!ifndef INFO_COMPANYNAME
!define INFO_COMPANYNAME "My Company"
!define INFO_COMPANYNAME "sundynix"
!endif
!ifndef INFO_PRODUCTNAME
!define INFO_PRODUCTNAME "My Product"
!define INFO_PRODUCTNAME "sundynix-agentix"
!endif
!ifndef INFO_PRODUCTVERSION
!define INFO_PRODUCTVERSION "0.1.0"
!endif
!ifndef INFO_COPYRIGHT
!define INFO_COPYRIGHT "© 2026, My Company"
!define INFO_COPYRIGHT "(c) 2026, sundynix"
!endif
!ifndef PRODUCT_EXECUTABLE
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity type="win32" name="com.example.wails3ref" version="0.1.0" processorArchitecture="*"/>
<assemblyIdentity type="win32" name="com.sundynix.agentix" version="0.1.0" processorArchitecture="*"/>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>