|  | @@ -55,6 +55,28 @@ do
 | 
	
		
			
			| 55 | 55 |    source $f
 | 
	
		
			
			| 56 | 56 |  done
 | 
	
		
			
			| 57 | 57 |  
 | 
	
		
			
			|  | 58 | +function mark_unselected_apps_as_removed {
 | 
	
		
			
			|  | 59 | +    # Initially mark the apps not selected on first install as being removed
 | 
	
		
			
			|  | 60 | +    # otherwise they may be automatically installed on the next update
 | 
	
		
			
			|  | 61 | +    select_all_apps=$1
 | 
	
		
			
			|  | 62 | +    if [[ "$select_all_apps" != "add-all" ]]; then
 | 
	
		
			
			|  | 63 | +        return
 | 
	
		
			
			|  | 64 | +    fi
 | 
	
		
			
			|  | 65 | +
 | 
	
		
			
			|  | 66 | +    if [ -f $REMOVED_APPS_FILE ]; then
 | 
	
		
			
			|  | 67 | +        rm $REMOVED_APPS_FILE
 | 
	
		
			
			|  | 68 | +    fi
 | 
	
		
			
			|  | 69 | +
 | 
	
		
			
			|  | 70 | +    app_index=0
 | 
	
		
			
			|  | 71 | +    for app_name in "${APPS_AVAILABLE[@]}"
 | 
	
		
			
			|  | 72 | +    do
 | 
	
		
			
			|  | 73 | +        if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
 | 
	
		
			
			|  | 74 | +            echo "_${app_name}_" >> $REMOVED_APPS_FILE
 | 
	
		
			
			|  | 75 | +        fi
 | 
	
		
			
			|  | 76 | +        app_index=$[app_index+1]
 | 
	
		
			
			|  | 77 | +    done
 | 
	
		
			
			|  | 78 | +}
 | 
	
		
			
			|  | 79 | +
 | 
	
		
			
			| 58 | 80 |  function show_apps {
 | 
	
		
			
			| 59 | 81 |      select_all_apps=$1
 | 
	
		
			
			| 60 | 82 |      applist=""
 | 
	
	
		
			
			|  | @@ -199,6 +221,7 @@ if [[ ${#APPS_AVAILABLE[@]} == 0 ]]; then
 | 
	
		
			
			| 199 | 221 |  fi
 | 
	
		
			
			| 200 | 222 |  
 | 
	
		
			
			| 201 | 223 |  show_apps $1
 | 
	
		
			
			|  | 224 | +mark_unselected_apps_as_removed $1
 | 
	
		
			
			| 202 | 225 |  
 | 
	
		
			
			| 203 | 226 |  clear
 | 
	
		
			
			| 204 | 227 |  
 |