我有以下两个 .pkg 文件:
- MyApp-v1_3_0.pkg
- MyApp-v1_2_0.pkg
分别使用以下两个命令构建:
pkgbuild --identifier <my identifier> --version 1.3.0 --root ./MyAppBundle --install-location '/Applications/MyApp test' --component-plist MyAppBundle.plist MyApp-v1_3_0.pkg
pkgbuild --identifier <my identifier> --version 1.2.0 --root ./MyAppBundle --install-location '/Applications/MyApp test' --component-plist MyAppBundle.plist MyApp-v1_2_0.pkg
在 MyAppBundle.plist 文件中,我有这个:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>BundleHasStrictIdentifier</key>
<true/>
<key>BundleIsRelocatable</key>
<true/>
<key>BundleIsVersionChecked</key>
<true/>
<key>BundleOverwriteAction</key>
<string>upgrade</string>
<key>RootRelativeBundlePath</key>
<string>MyApp.app</string>
</dict>
</array>
</plist>
如您所见BundleIsVersionChecked
,设置为 true,但是当我在 MyApp-v1_3_0.pkg 之后运行 MyApp-v1_2_0.pkg 时,它会愉快地降级。
如何阻止它降级?