+# Abort if the rEFInd files can't be found.
+# Also sets $ConfFile to point to the configuration file, and
+# $IconsDir to point to the icons directory
+CheckForFiles() {
+ # Note: This check is satisfied if EITHER the 32- or the 64-bit version
+ # is found, even on the wrong platform. This is because the platform
+ # hasn't yet been determined. This could obviously be improved, but it
+ # would mean restructuring lots more code....
+ if [[ ! -f $RefindDir/refind_ia32.efi && ! -f $RefindDir/refind_x64.efi ]] ; then
+ echo "The rEFInd binary file is missing! Aborting installation!"
+ exit 1
+ fi
+
+ if [[ -f $RefindDir/refind.conf-sample ]] ; then
+ ConfFile=$RefindDir/refind.conf-sample
+ elif [[ -f $ThisDir/refind.conf-sample ]] ; then
+ ConfFile=$ThisDir/refind.conf-sample
+ else
+ echo "The sample configuration file is missing! Aborting installation!"
+ exit 1
+ fi
+
+ if [[ -d $RefindDir/icons ]] ; then
+ IconsDir=$RefindDir/icons
+ elif [[ -d $ThisDir/icons ]] ; then
+ IconsDir=$ThisDir/icons
+ else
+ echo "The icons directory is missing! Aborting installation!"
+ fi
+} # CheckForFiles()
+
+# Copy the rEFInd files to the ESP or OS X root partition.
+# Sets Problems=1 if any critical commands fail.