Index: branches/blackosx/package/Distribution =================================================================== --- branches/blackosx/package/Distribution (revision 1632) +++ branches/blackosx/package/Distribution (revision 1633) @@ -27,7 +27,7 @@ my.result.type = 'Fatal'; return false; } - system.log('installCheckScript: Passed.'); + system.log('installCheckScript: Failed.'); return false; } @@ -37,18 +37,6 @@ return true; } - function upgrade_allowed(){ - var upgradable = true; - var upgradeAction = my.choice.packageUpgradeAction; - - if((upgradeAction == "downgrade") || (upgradeAction == "mixed")){ - my.choice.tooltip = system.localizedString('Newer_Package_Installed_message'); - upgradable = false; - } - - return upgradable; - } - function systemHasGPT(){ var obj = system.ioregistry.matchingName("EFI System Partition"); if (obj) Index: branches/blackosx/package/Changes.txt =================================================================== --- branches/blackosx/package/Changes.txt (revision 1632) +++ branches/blackosx/package/Changes.txt (revision 1633) @@ -1,3 +1,5 @@ +- Set exclusive 'None' option to default choice. + - Add code to detect and make necessary changes to avoid possibility of a b1f:error or boot1:error should the user decide to install a secondary boot partition. - Fix bug installing to /Volumes/EFI Index: branches/blackosx/package/OptionalSettings/Resolution.txt =================================================================== --- branches/blackosx/package/OptionalSettings/Resolution.txt (revision 1632) +++ branches/blackosx/package/OptionalSettings/Resolution.txt (revision 1633) @@ -21,7 +21,7 @@ # B) User can select only one of the options from the list. # Set Exclusive=False for A, or Exclusive=True for B. # -Exclusive=False +Exclusive=True # --------------------------------------------- # Note: There must be a carriage return at end of last line # --------------------------------------------- Index: branches/blackosx/package/Scripts/Main/Post/postinstall =================================================================== --- branches/blackosx/package/Scripts/Main/Post/postinstall (revision 1632) +++ branches/blackosx/package/Scripts/Main/Post/postinstall (revision 1633) @@ -111,7 +111,7 @@ value="${options[$arrayCount]#*=}" # escape any spaces keyToUse=$( echo $keyRead | sed 's/ /\\ /g' ) - if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "USE" ]; then + if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "ADD" ]; then sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP" returnValue=$? if [ ${returnValue} -ne 1 ]; then @@ -123,7 +123,19 @@ fi (( arrayCount++ )) done < <(ls "${chamTemp}"/options ) - + + # If exclusive options were used and the 'None' option was chosen, + # then a dummy file named DONT=ADD would be in /$chamTemp/Extra/options. + # If that was the only option then the above code would have made a + # temporary Extra folder with a default org.chameleon.Boot.plist + # In this case we don't need it and should discard it otherwise the folder + # will be copied to the users / directory when it's not wanted. + if [ ${arrayCount} == 1 ] && [ "${keyToUse}" == "DONT" ] && [ "${value}" == "ADD" ]; then + if [ -e "${chamTemp}"/Extra ] && [ ! -e "${chamTemp}"/Extra/Themes ] && [ ! -e "${chamTemp}"/Extra/Modules ]; then + rm -r -f "$chamTemp"/Extra + fi + fi + if [ $kernelFlagCount -gt 0 ]; then # Add kernel flags for (( i=0 ; i < $kernelFlagCount ; i++ )) @@ -185,7 +197,7 @@ done fi else - echo "Removing /.ChameleonExists file" + #echo "Removing /.ChameleonExists file" "$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 4" rm "$dest_vol"/.ChameleonExists fi @@ -196,21 +208,21 @@ # delete the temporary Chameleon folder if [ -e "$chamTemp" ]; then - echo "Removing $chamTemp directory" + #echo "Removing $chamTemp directory" "$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 1" rm -rf "$chamTemp" fi # Remove /.ChameleonEFI file if [ -f "$dest_vol"/.ChameleonEFI ]; then - echo "Removing /.ChameleonEFI file" + #echo "Removing /.ChameleonEFI file" "$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 2" rm "$dest_vol"/.ChameleonEFI fi # Remove /.ChameleonLogFlag file if [ -f "$dest_vol"/.ChameleonLogFlag ]; then - echo "Removing /.ChameleonLogFlag file" + #echo "Removing /.ChameleonLogFlag file" "$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 3" # we have to add the final install log messages before Index: branches/blackosx/package/buildpkg.sh =================================================================== --- branches/blackosx/package/buildpkg.sh (revision 1632) +++ branches/blackosx/package/buildpkg.sh (revision 1633) @@ -108,7 +108,7 @@ ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Standard/Scripts/Resources/revision ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Standard/Scripts/Resources/version echo " [BUILD] Standard " - buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1 + buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1 # End build standard package # build efi package @@ -120,13 +120,13 @@ ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/EFI/Scripts/Resources/revision ditto --noextattr --noqtn ${1%/*/*}/version ${1}/EFI/Scripts/Resources/version echo " [BUILD] EFI " - buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1 + buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" selected=\"exclusive(choices['Standard']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1 # End build efi package # build reset choice package mkdir -p ${1}/noboot/Root echo " [BUILD] Reset choice " - buildpackage "${1}/noboot" "/$chamTemp" "" "start_visible=\"true\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) && exclusive(choices['EFI'])\"" >/dev/null 2>&1 + buildpackage "${1}/noboot" "/$chamTemp" "" "selected=\"exclusive(choices['Standard']) && exclusive(choices['EFI'])\"" >/dev/null 2>&1 # End build reset choice package ((xmlindent--)) @@ -270,7 +270,7 @@ done # to indicate exclusive option, call buildoptionalsettings with the 2nd parameter set to 1 . - buildoptionalsettings "$1" "0" "keylayout" + buildoptionalsettings "$1" "1" "keylayout" ((xmlindent--)) outline[$((outlinecount++))]="${indent[$xmlindent]}" @@ -412,7 +412,15 @@ fi done x="${x}${stringEnd}" - buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\" ${x}" >/dev/null 2>&1 + + # First exclusive option is the 'no choice' option, so let's make that selected by default. + if [ $c = 0 ]; then + initialChoice="true" + else + initialChoice="false" + fi + + buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"${initialChoice}\" ${x}" >/dev/null 2>&1 else buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1 fi