|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +echo "==> Setting Variables ..." |
| 4 | +echo Enter Adobe media folder location: |
| 5 | +read source_directory |
| 6 | +echo Enter 7-Zip Console binary path: |
| 7 | +read sevenzip_bin |
| 8 | +adobetempinstaller=~/adobetempinstaller |
| 9 | +adobeworkfolder=~/adobeworkfolder |
| 10 | + |
| 11 | +echo "==> Deleting Previously Failed Instance ..." |
| 12 | +rm -rf $adobetempinstaller |
| 13 | +rm -rf $adobeworkfolder |
| 14 | + |
| 15 | +echo "==> Creating Directories ..." |
| 16 | +mkdir $adobetempinstaller |
| 17 | +mkdir $adobetempinstaller/products |
| 18 | +mkdir $adobeworkfolder |
| 19 | +folder_create=$(ls -d "$source_directory"/products/*/) |
| 20 | +echo "$folder_create" > $adobeworkfolder/folder_create.txt |
| 21 | +while IFS= read -r line |
| 22 | +do |
| 23 | + folder_name=$(basename "$line") |
| 24 | + mkdir "$adobetempinstaller/products/$folder_name" |
| 25 | +done < $adobeworkfolder/folder_create.txt |
| 26 | + |
| 27 | +echo "==> Creating Exclusion File ..." |
| 28 | +folder_exclude=$(ls -d "$source_directory"/products/*/*/) |
| 29 | +echo "$folder_exclude" > $adobeworkfolder/folder_exclude.txt |
| 30 | + |
| 31 | +echo "==> Compressing Unpacked Products ..." |
| 32 | +folder_compress=$(ls -d "$source_directory"/products/*/*/) |
| 33 | +echo "$folder_compress" > $adobeworkfolder/folder_compress.txt |
| 34 | +echo "Edit file" |
| 35 | +echo "Leave only <AdobeSAPCode>/<FolderThat'sGonneBeCompressed>" |
| 36 | +echo "Each line should like this:" |
| 37 | +echo "LRCC/AdobeLightroomCC-mul" |
| 38 | +open -e "$adobeworkfolder/folder_compress.txt" |
| 39 | +echo "Press any key to continue after necessary changes made..." |
| 40 | +read -n 1 |
| 41 | +while IFS= read -r line |
| 42 | +do |
| 43 | + folder_compress=$line |
| 44 | + "$sevenzip_bin" a -bd -snh -snl -tzip "$adobetempinstaller/products/$folder_compress.zip" -mx5 -r "$source_directory/products/$folder_compress/*" |
| 45 | +done < $adobeworkfolder/folder_compress.txt |
| 46 | + |
| 47 | +echo "==> Copying Installer" |
| 48 | +echo "Edit file" |
| 49 | +echo "Leave only <AdobeSAPCode>/<FolderThat'sGonnaBeExcluded>/" |
| 50 | +echo "Each line should like this:" |
| 51 | +echo "LRCC/AdobeLightroomCC-mul/" |
| 52 | +open -e "$adobeworkfolder/folder_exclude.txt" |
| 53 | +echo "Press any key to continue after necessary changes made..." |
| 54 | +read -n 1 |
| 55 | +rsync -av --progress "$source_directory/Install.app" "$adobetempinstaller" |
| 56 | +rsync -av --progress "$source_directory/packages" "$adobetempinstaller" |
| 57 | +rsync -av --progress --exclude-from="$adobeworkfolder/folder_exclude.txt" "$source_directory/products" "$adobetempinstaller" |
| 58 | +rsync -av --progress "$source_directory/resources" "$adobetempinstaller" |
| 59 | + |
| 60 | +echo "==> Installing Product ..." |
| 61 | +open -a "$adobetempinstaller/Install.app" |
| 62 | +echo "Press any key to continue..." |
| 63 | +read -n 1 |
0 commit comments