diff --git a/README.md b/README.md index 01c9009..adb60dc 100644 --- a/README.md +++ b/README.md @@ -47,18 +47,24 @@ the installer scripts use a virtual drive of wine and makes a new `winprefix` fo first of all, you need to clone the repository with this command: ```bash git clone https://github.com/Gictorbit/illustratorCClinux.git -cd illustratorCClinux/scripts +cd illustratorCClinux +chmod +x setup.sh +./setup.sh ``` -then you can easily run `illustratorSetup.sh` script to install illustrator cc on your Linux distro +then you can easily run `setup.sh` script to install illustrator cc on your Linux distro -```bash -chmod +x illustratorSetup.sh -./illustratorSetup.sh -``` +
+ +![setup screenshot](images/setup-screenshot.png) + +
you can use `-d` to specify the installation path, and `-c` for the cache directory. for example: + ```bash +cd scripts +chmod +x illustratorSetup.sh ./illustratorSetup.sh -d /mnt/storage/illustratorSetup.sh ``` or with c flag diff --git a/images/banner b/images/banner new file mode 100644 index 0000000..b17b7d1 --- /dev/null +++ b/images/banner @@ -0,0 +1,19 @@ + +                     ┏━━━━━━━━━━━━━━━━━━━━━━━━━┫ Illustrator CC Installer ┣━━━━━━━━━━━━━━━━━━━━━━━━┓ +                     ┃                                                                             ┃ +  ███████████████████████████                                                                      ┃ +  ██                       ██        1- Install Illustrator CC            (reinstall/repair)       ┃ +  ██          ▟████ ▟█▙    ██                                                                      ┃ +  ██         ▟█████ ▜█▛    ██        2- reset Illustrator                  (reset settings)        ┃ +  ██        ▟██████        ██                                                                      ┃ +  ██       ▟██▛ ███ ███    ██        3- configure virtual drive               (winecfg)            ┃ +  ██      ▟██▛  ███ ███    ██                                                                      ┃ +  ██     ▟██▛   ███ ███    ██        4- uninstall Illustrator                                      ┃ +  ██    ▟██████████ ███    ██                                                                      ┃ +  ██   ▟██▛     ███ ███    ██        5- exit                                                       ┃ +  ██                       ██                                                                      ┃ +  ███████████████████████████                                                                      ┃ +                      ┃                                                                            ┃ +                      ┗━━━━━━━━━━━━┫ https://github.com/Gictorbit/illustratorCClinux ┣━━━━━━━━━━━━━┛ +                       +                     diff --git a/images/banner.txt b/images/banner.txt new file mode 100644 index 0000000..757e126 --- /dev/null +++ b/images/banner.txt @@ -0,0 +1,19 @@ + + ┏━━━━━━━━━━━━━━━━━━━━━━━━━┫ Illustrator CC Installer ┣━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ ┃ + ███████████████████████████ ┃ + ██ ██ 1- Install Illustrator CC (reinstall/repair) ┃ + ██ ▟████ ▟█▙ ██ ┃ + ██ ▟█████ ▜█▛ ██ 2- reset Illustrator (reset settings) ┃ + ██ ▟██████ ██ ┃ + ██ ▟██▛ ███ ███ ██ 3- configure virtual drive (winecfg) ┃ + ██ ▟██▛ ███ ███ ██ ┃ + ██ ▟██▛ ███ ███ ██ 4- uninstall Illustrator ┃ + ██ ▟██████████ ███ ██ ┃ + ██ ▟██▛ ███ ███ ██ 5- exit ┃ + ██ ██ ┃ + ███████████████████████████ ┃ + ┃ ┃ + ┗━━━━━━━━━━━━┫ https://github.com/Gictorbit/illustratorCClinux ┣━━━━━━━━━━━━━┛ + + diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..d77b60e --- /dev/null +++ b/setup.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash + +function main() { + + #print banner + banner + + #read inputs + read_input + let answer=$? + + case "$answer" in + + 1) + echo "run illustrator CC Installation..." + echo -n "using winetricks for component installation..." + run_script "scripts/illustratorSetup.sh" "illustratorSetup.sh" + ;; + 2) + echo -n "reset illustrator..." + run_script "scripts/resetIllustrator.sh" "resetIllustrator.sh" + ;; + 3) + echo "run winecfg..." + echo -n "open virtualdrive configuration..." + run_script "scripts/winecfg.sh" "winecfg.sh" + ;; + 4) + echo -n "uninstall illustrator CC ..." + run_script "scripts/uninstaller.sh" "uninstaller.sh" + ;; + 5) + echo "exit setup..." + exitScript + ;; + esac +} + +#argumaents 1=script_path 2=script_name +function run_script() { + local script_path=$1 + local script_name=$2 + + wait_second 5 + if [ -f "$script_path" ];then + echo "$script_path Found..." + chmod +x "$script_path" + else + error "$script_name not Found..." + fi + cd "./scripts/" && bash $script_name + unset script_path +} + +function wait_second() { + for (( i=0 ; i<$1 ; i++ ));do + echo -n "." + sleep 1 + done + echo "" +} + +function read_input() { + while true ;do + read -p "[choose an option]$ " choose + if [[ "$choose" =~ (^[1-5]$) ]];then + break + fi + warning "choose a number between 1 to 5" + done + + return $choose +} + +function exitScript() { + echo "Good Bye :)" +} + +function banner() { + local banner_path="$PWD/images/banner" + if [ -f $banner_path ];then + clear && echo "" + cat $banner_path + echo "" + else + error "banner not Found..." + fi + unset banner_path +} + +function error() { + echo -e "\033[1;31merror:\e[0m $@" + exit 1 +} + +function warning() { + echo -e "\033[1;33mWarning:\e[0m $@" +} + +main diff --git a/todo.txt b/todo.txt index a5cba4e..188bb02 100644 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,3 @@ -update readme -add if exist to save_path and load_path functions -add reset illustrator option -add setup.sh script add shared wine virtual drive with photoshop on one machine add link mirror in json file - +loadpath function enhancement check if file exist