我有一个用 Qt 构建的 OSX 应用程序。它经过代码设计、打包以适合 macstore,并已获得苹果的批准,可以在 mac 商店中销售。
虽然在安装后,它会安装到它在打包过程中所在的位置,而不是 /Applications。
或者,我正在创建文件的 .dmg 包,我可以将其安装到 /Applications 中。
在构建过程结束时,我正在运行这些命令:
codesign --force --deep --verify MyApp.app/ --entitlements ${INSTDIR}/Entitlements.plist -s "3rd Party Mac Developer Application: Company Name"
productbuild --component MyApp.app /Applications --sign "3rd Party Mac Developer Installer: Company Name" MyApp.pkg
结果是我试图通过安装程序安装的 pkg:
$ sudo installer -store -pkg MyApp.pkg -target /
installer: Note: running installer as an admin user (instead of root) gives better Mac App Store fidelity
installer: MyApp.pkg has valid signature for submission: 3rd Party Mac Developer Installer: Company Name (key)
installer: Installation Check: Passed
installer: Volume Check: Passed
installer: Bundle com.CompanyName.MyApp will be relocated to /Users/peti/dev/build/bin/Mac/release/MyApp.app
installer: Starting install
installer: Install 0.0% complete
installer: Install 17.1% complete
installer: Install 96.4% complete
installer: Install 100.0% complete
installer: Finished install
在 productbuild 之后,重定位说 /Applications,但它没有在那里安装它!在随后的运行中,它会说错误的路径。我也尝试过从不同的位置安装。
我也尝试从 Mac Store 安装应用程序,它的作用相同......它进入了不正确的路径。
我用过:
pkgutil --expand
提取包。PackageInfo 文件是这样说的:
<pkg-info overwrite-permissions="true" relocatable="false" identifier="com.CompanyName.MyApp" postinstall-action="none" version="3.0.0" format-version="2" generator-version="InstallCmds-502 (14F1605)" install-location="/Applications" auth="root" preserve-xattr="true">
有什么想法可能会出错吗?我试图用谷歌搜索解决方案,但没有运气。这个不正确的路径可以存储在哪里?在 productbuild 之前,我没有看到嵌入到任何文件中的路径。productbuild 是否在做一些奇怪的事情?