Changeset 1041

Show
Ignore:
Timestamp:
04/10/09 14:56:04 (1 year ago)
Author:
gbooker
Message:

An initial pass at a generic commandline installer; needs testing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Release/Commandline-Perian-Install.sh

    r900 r1041  
    33# Stupid little Apple TV installer script for the Perian components using the 
    44# zip files in the distribution preference pane. 
    5 # 
    6 # Should be wrapped up with the zip files using makeself: 
    7 #  makeself --nocrc --nocomp --nox11 ATVComponents Perian-ATV.run Perian ./ATV-Perian-Install.sh 
    85# 
    96# New for 1.1: $0 [action] [prefix] 
     
    129# 
    1310# Install/uninstall take a prefix of the root to handle (for such as a patchstick) 
     11# 
     12# New for 1.2: Added install for Computer 
    1413 
    1514SRCDIR="$PWD" 
     
    1716PERIAN_DEST="${PREFIX}/Library/QuickTime" 
    1817A52_DEST="${PREFIX}/Library/Audio/Plug-Ins/Components" 
     18FINDER="/System/Library/CoreServices/Finder.app" 
    1919 
    2020ACTION=${1:-install} 
     
    3535fi 
    3636 
     37ATV=0 
     38for FILE in "${FINDER}"/Contents/PlugIns/*.frappliance; do 
     39  if [[ -d $FILE ]]; then 
     40    ATV=1 
     41  fi 
     42done 
     43if (( $ATV == 1 )); then 
     44  echo "ATV" 
     45else 
     46  echo "Computer" 
     47fi 
     48 
    3749# make sure we're running as root 
    3850if [ "$USER" != "root" ]; then 
     
    4052  echo 
    4153  echo "Please enter your password below to authorize as root." 
    42   echo "In most cases, this password is \"frontrow\"." 
     54  if (( $ATV == 1 )); then 
     55    echo "In most cases, this password is \"frontrow\"." 
     56  fi 
    4357  sudo "$0" $* 
    4458  exit 0 
     
    6276  /bin/rm -rf "$A52_DEST/A52Codec.component" 
    6377   
    64   if [[ -d "${PREFIX}/System/Library/QuickTime (disabled)/QuickTimeH264.component" && ! -d "${PREFIX}/System/Library/QuickTime/QuickTimeH264.component" ]]; then 
    65     echo 
    66     echo "You have previously disabled Apple's H.264 component." 
    67     echo 
    68     echo -n "Do you wish to restore it? (Y/n)" 
    69     read -e restoreapple 
    70     if [[ "$restoreapple" == "" || "$restoreapple" == "Y" || "$restoreapple" == "y" ]]; then 
    71       mv "${PREFIX}/System/Library/QuickTime (disabled)/QuickTimeH264.component" "${PREFIX}/System/Library/QuickTime" 
     78  if (( $ATV == 1 )); then 
     79    if [[ -d "${PREFIX}/System/Library/QuickTime (disabled)/QuickTimeH264.component" && ! -d "${PREFIX}/System/Library/QuickTime/QuickTimeH264.component" ]]; then 
     80      echo 
     81      echo "You have previously disabled Apple's H.264 component." 
     82      echo 
     83      echo -n "Do you wish to restore it? (Y/n)" 
     84      read -e restoreapple 
     85      if [[ "$restoreapple" == "" || "$restoreapple" == "Y" || "$restoreapple" == "y" ]]; then 
     86        mv "${PREFIX}/System/Library/QuickTime (disabled)/QuickTimeH264.component" "${PREFIX}/System/Library/QuickTime" 
     87      fi 
    7288    fi 
    7389  fi 
     
    85101  /usr/bin/ditto -k -x --rsrc "$SRCDIR/A52Codec.zip" "$A52_DEST" 
    86102 
    87   # Warn about Apple H.264 if it exists 
    88   if [ -d "${PREFIX}/System/Library/QuickTime/QuickTimeH264.component" ]; then 
    89     echo 
    90     echo "You currently have Apple's H.264 component installed." 
    91     echo 
    92     echo "If you wish to play high-profile H.264, you need to disable Apple's decoder to" 
    93     echo "allow Perian to take over." 
    94     echo 
    95     echo -n "Do you wish to do this now? (Y/n) " 
    96     read -e removeapple 
    97     if [[ "$removeapple" == "" || "$removeapple" == "Y" || "$removeapple" == "y" ]]; then 
    98       mkdir -p "${PREFIX}/System/Library/QuickTime (disabled)" 
    99       mv "${PREFIX}/System/Library/QuickTime/QuickTimeH264.component" "${PREFIX}/System/Library/QuickTime (disabled)" 
     103  if (( $ATV == 1 )); then 
     104    # Warn about Apple H.264 if it exists 
     105    if [ -d "${PREFIX}/System/Library/QuickTime/QuickTimeH264.component" ]; then 
     106      echo 
     107      echo "You currently have Apple's H.264 component installed." 
     108      echo 
     109      echo "If you wish to play high-profile H.264, you need to disable Apple's decoder to" 
     110      echo "allow Perian to take over." 
     111      echo 
     112      echo "You may use the following command to revert: $0 uninstall ${PREFIX}" 
     113      echo 
     114      echo -n "Do you wish to do this now? (Y/n) " 
     115      read -e removeapple 
     116      if [[ "$removeapple" == "" || "$removeapple" == "Y" || "$removeapple" == "y" ]]; then 
     117        mkdir -p "${PREFIX}/System/Library/QuickTime (disabled)" 
     118        mv "${PREFIX}/System/Library/QuickTime/QuickTimeH264.component" "${PREFIX}/System/Library/QuickTime (disabled)" 
     119      fi 
    100120    fi 
    101121  fi 
     
    103123 
    104124if [[ "$PREFIX" = "" ]]; then 
    105         echo "$FINDER must be restarted to complete the installation" 
    106         echo 
    107         echo -n "Would you like to do this now? (Y/n) " 
    108         read -e dorestart 
    109         if [[ "$dorestart" == "" ||  "$dorestart" == "y" ||  "$dorestart" == "Y" ]]; then 
    110                 echo 
    111                 echo "== Restarting $FINDER" 
     125  if (( $ATV == 1 )); then 
     126        echo "$FINDER must be restarted to complete the installation" 
     127        echo 
     128        echo -n "Would you like to do this now? (Y/n) " 
     129        read -e dorestart 
     130        if [[ "$dorestart" == "" ||  "$dorestart" == "y" ||  "$dorestart" == "Y" ]]; then 
     131                echo 
     132                echo "== Restarting $FINDER" 
    112133                 
    113                 kill `ps awx | grep "[F]inder" | awk '{print $1}'` 
    114         fi 
     134                kill `ps awx | grep "[F]inder" | awk '{print $1}'` 
     135                open "$FINDER" 
     136        fi 
     137        else 
     138          echo "You should restart any applications using QuickTime" 
     139  fi 
    115140fi 
    116141 
  • trunk/Release/Makefile

    r985 r1041  
    88SRC_DIR=.. 
    99BUILD_DIR=build 
    10 ATV_BUILD_DIR=ATVComponents 
     10COMMAND_BUILD_DIR=CommandLineComponents 
    1111RELEASE_NAME=Perian 
    1212PERIAN_DIR=$(BUILD_DIR)/Perian 
     
    3232release: compile createfolder diskimage 
    3333 
    34 atv: compile 
     34command: compile 
    3535        @# clean build dir 
    36         rm -rf $(ATV_BUILD_DIR) 
    37         mkdir $(ATV_BUILD_DIR) 
    38         cp $(PERIAN_BUILD_DIR)/Perian.prefPane/Contents/Resources/Components/*.zip $(PERIAN_BUILD_DIR)/Perian.prefPane/Contents/Resources/Components/*/*.zip $(ATV_BUILD_DIR) 
    39         cp ATV-Perian-Install.sh $(ATV_BUILD_DIR) 
    40         makeself --nocrc --nocomp --nox11 ATVComponents Perian-ATV-$(VERSION).sh Perian ./ATV-Perian-Install.sh 
     36        rm -rf $(COMMAND_BUILD_DIR) 
     37        mkdir $(COMMAND_BUILD_DIR) 
     38        cp $(PERIAN_BUILD_DIR)/Perian.prefPane/Contents/Resources/Components/*.zip $(PERIAN_BUILD_DIR)/Perian.prefPane/Contents/Resources/Components/*/*.zip $(COMMAND_BUILD_DIR) 
     39        cp CommandLine-Perian-Install.sh $(COMMAND_BUILD_DIR) 
     40        makeself --nocrc --nocomp --nox11 $(COMMAND_BUILD_DIR) Perian-CommandLine-$(VERSION).sh Perian ./CommandLine-Perian-Install.sh 
    4141 
    4242compile: