Downgrade options - hewigovens/hewigovens.github.com GitHub Wiki

old metapackage method(from http://lists.apple.com/archives/installer-dev/2008/Aug/msg00112.html):

<?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">
<dict>
<key>IFPkgFlagAllowBackRev</key>
<true/>
</dict>
</plist>

flat package workaround (from http://prod.lists.apple.com/archives/installer-dev/2012/Oct/msg00003.html):

<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
    <title>MyPackage</title>
    <background alignment="topleft" file="background.png" scaling="none"/>
    <welcome file="Welcome.rtf"/>
    <readme file="ReadMe.rtf"/>
    <license file="License.rtf"/>
    <options rootVolumeOnly="true" allow-external-scripts="yes" customize="never"/>
    <pkg-ref id="my.installer.package"/>
    <pkg-ref id="my.installer.package" _onConclusion_="none">MyPackage.pkg</pkg-ref>
    <choice id="choice-id.MyPackage" start_visible="false" start_enabled="false" start_selected='!choiceIsADowngrade();' title="MyPackage">
        <pkg-ref id="my.installer.package"/>
    </choice>
    <choices-outline>
        <line choice="choice-id.MyPackage"/>
    </choices-outline>
    <installation-check script="pm_install_check();"/>
    
    <script>
        function pm_install_check() {
            try {
                var checkResult = system.run("InstallationCheck")
                
                // Check for system version.
                if (checkResult == 113) {
                    my.result.title = system.localizedString('Error');
                    my.result.message = system.localizedString('OperatingSystemTooOld');
                    my.result.type = 'Fatal';
                    return false;
                }
                
                // Check for architecture.
                if (checkResult == 114) {
                    my.result.title = system.localizedString('Error');
                    my.result.message = system.localizedString('IntelOnly');
                    my.result.type = 'Fatal';
                    return false;
                }
                
              } catch (e) {}
              
              return true;
            }
    </script>
    
    <script>
                function choiceIsADowngrade() {
                        return  checkChoiceUpgradeAction() 
                }
    </script>
    
    <script>
                function checkChoiceUpgradeAction() {
                        var result = false
                        try {
                                result = my.choice.packageUpgradeAction == 'downgrade' || my.choice.packageUpgradeAction == 'mixed'
                        } catch (e) {}
        
                        return result
                }
    </script>
</installer-gui-script>
⚠️ **GitHub.com Fallback** ⚠️