我有一個用Qt構建的OSX應用程序。它是經過代碼簽名的,被打包以適應macstore並且已經被蘋果批准,並且已經準備好在mac商店中出售。productbuild路徑在安裝時被忽略
雖然在安裝它之後,它會安裝到它在打包過程中所在的位置,而不是/ 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
在產品生成後,重新定位說/應用程序,但它沒有安裝它!在隨後的運行中,它會說錯誤的路徑。我也嘗試從不同的位置安裝。
我也試着從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'。 –
@我知道,我不明白爲什麼包裝的地方與安裝路徑有關。 – tothphu
如果您的意思是構建文件的位置,那是因爲它使用它來確定將文件安裝到哪裏。 –