【发布时间】:2016-08-11 01:04:58
【问题描述】:
我有一个用 Qt 构建的 OSX 应用程序。它经过代码设计、打包以适合 macstore,并已获得苹果的批准,可以在 mac store 上销售。
虽然在安装后,它会安装到打包过程中它所在的位置,而不是 /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 是否在做一些奇怪的事情?
【问题讨论】:
-
.dmg是磁盘映像,不是包,但你当然可以在上面存储一个.pkg。 -
@I'L'I 我明白了,我不明白为什么打包的地方和安装路径有关系。
-
如果你的意思是构建文件时文件所在的位置,那是因为它使用它来确定安装位置。
-
@I'L'I 嗯,为什么?如上所述,我明确表示安装目标是 /Applications 的 productbuild。你能详细说明一下吗?
-
尝试构建您的应用程序,然后执行
mv MyApp.app /Applications。尝试cp -r一个应用程序包可能会搞砸。
标签: macos qt productbuild