我們爲我們的Java應用程序創建了.pkg安裝程序,並且每次運行最新的.pkg安裝程序時,都會刪除此應用程序的以前的開發版本。我注意到,這個最新的安裝程序在刪除舊的開發版本時打印出「刪除舊文件...」。對於那些經常希望保留多個開發版本進行比較的測試人員來說,這非常煩人。OSX .pkg刪除其他開發版本
有沒有辦法強制安裝程序不刪除舊文件?
要創建我的最終安裝我首先用電話幾個子的.pkg的對PKGBUILD:
pkgbuild --root "./Temp" --identifier "com.agentsheets.agentsheets" --install-location "/Applications" --sign "Developer ID Installer: AgentSheets, Inc." "./build_dir/temp.pkg"
pkgbuild --root "$APP_FOLDER/AgentSheets.app" --identifier "com.agentsheets.agentsheets.app" --install-location "/Applications/$APP_FOLDER_NAME/AgentSheets.app" --sign "Developer ID Installer: AgentSheets, Inc." "./build_dir/asj_app.pkg"
pkgbuild --root "./AgentSheetsCameraHelper.app" --identifier "com.agentsheets.agentsheets.camera" --install-location "/Applications/$APP_FOLDER_NAME/Resources/AgentSheetsCameraHelper.app" --sign "Developer ID Installer: AgentSheets, Inc." "./build_dir/camera.pkg"
然後,我創建productbuild最終的.pkg:
productbuild --package-path "./build_dir" --distribution "./Distribution.xml" --resources "./Resources" --sign "Developer ID Installer: AgentSheets, Inc." "$FINAL_PKG"
這裏是我的distribution.xml:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<title>AgentSheets</title>
<background file="background.png" scaling="toFit"/>
<options customize="never" require-scripts="false"/>
<pkg-ref id="com.agentsheets.agentsheets"/>
<pkg-ref id="com.agentsheets.agentsheets.app"/>
<pkg-ref id="com.agentsheets.agentsheets.camera"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="com.agentsheets.agentsheets"/>
<line choice="com.agentsheets.agentsheets.app"/>
<line choice="com.agentsheets.agentsheets.camera"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.agentsheets.agentsheets" visible="false">
<pkg-ref id="com.agentsheets.agentsheets"/>
</choice>
<pkg-ref id="com.agentsheets.agentsheets" version="0" onConclusion="none">temp.pkg</pkg-ref>
<choice id="com.agentsheets.agentsheets.app" visible="false">
<pkg-ref id="com.agentsheets.agentsheets.app"/>
</choice>
<pkg-ref id="com.agentsheets.agentsheets.app" version="0" onConclusion="none">asj_app.pkg</pkg-ref>
<choice id="com.agentsheets.agentsheets.camera" visible="false">
<pkg-ref id="com.agentsheets.agentsheets.camera"/>
</choice>
<pkg-ref id="com.agentsheets.agentsheets.camera" version="0" onConclusion="none">camera.pkg</pkg-ref>
</installer-gui-script>
您想如何在同一時間維護多個版本?通過重命名? App.app應用程序(1).app等。?或者問題是首選項文件被刪除? – DNax