pkgbuild允许降级

时间:2015-04-07 06:57:48

标签: macos pkgbuild

我有以下两个.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时,它很高兴降级。

如何阻止降级?

0 个答案:

没有答案