├── LICENSE ├── README.md └── photoshop.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the \"Software\"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Adobe Photoshop CC 2021 on Linux 2 | 3 | ## Discontinued 4 | 5 | This project is no longer supported because I have lost the desire to maintain it. I remind you that this is not a standalone project, but a wrapper of [this](https://github.com/LinSoftWin/Photoshop-CC2022-Linux) repository, which in turn is maintained and actively updated. If you were a user of my project, please take a look at the work of [LinSoftWin](https://github.com/LinSoftWin). 6 | 7 | 8 | ## Disclaimer 9 | 10 | By providing this software, I do not give any guarantees of its work. This script was inspired by the work of [LinSoftWin](https://github.com/LinSoftWin/Photoshop-CC2022-Linux). This is only its adaptation. This script will be maintained and developed until I get bored and/or have free time. PR is welcome. 11 | 12 | Please note that this code is a piece of garbage. Although it works in most cases, I do not guarantee that it will work completely. Please read the source before using it. 13 | 14 | ## Showcase 15 | 16 | ![install](https://github.com/user-attachments/assets/3a4fb514-360e-4e10-a7a6-793d70b7ca91) 17 | ![delete](https://github.com/user-attachments/assets/0308a1e3-8e9d-4fb0-b7f1-409d7e961891) 18 | 19 | ### What works 20 | 21 | - Drag and drop ~~(doesn't work on Hyprland)~~ (should be fixed with recent update. Not tested) 22 | - Clipboard image pasting 23 | - Mime type association (right click menu, see [here](https://github.com/user-attachments/assets/eb5f7ab3-fb75-47e7-841b-a763ca5e3382)) 24 | - GPU acceleration (no warranty to work) 25 | 26 | **Tested on:** 27 | - Arch Linux / CachyOS / NixOS / Linux Mint 28 | - KDE Plasma 6.2 (Wayland) / Hyprland 29 | - wine 9.19+ / wine-staging 9.20+ / ~~wine-cachyos 9.20+~~ window freezes 30 | - AMD GPU 31 | 32 | ### Known issues 33 | 34 | - When hovering on toolbar item to see its instructions, black bars may appear around 35 | - Wine's experimental wayland driver is completely broken 36 | 37 | ### Notes 38 | 39 | - If you have **Papirus Icons** installed, the script will use an icon that is already in that pack. If not, the script will download an icon from the internet and use it for the `.desktop` entry. 40 | 41 | ## Usage 42 | 43 | ```bash 44 | ./photoshop.sh 45 | Usage: ./install.sh [options...] 46 | -a Use already existing Photoshop.tar.xz 47 | -i Install Photoshop 48 | -u Uninstall Photoshop 49 | -h Show this help 50 | ``` 51 | ## Support 52 | 53 | Just follow me on GitHub :) 54 | -------------------------------------------------------------------------------- /photoshop.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # vim: set tabstop=2 shiftwidth=2 expandtab: 4 | 5 | # This work and script was adapted by the work of user LinSoftWin. If it wasn't for him - it wouldn't have happened. 6 | # This script downloads a PIRATE version of Photoshop, because it is not possible to run the actual version from Adobe Creative Cloud. 7 | # Use it at your own risk. The license applies only to the files in this repository. 8 | # I am not responsible for any other files downloaded from other links using the script. 9 | # If the link becomes inactive - it will be replaced by another hosting. Checksums of uploaded files will also be updated. 10 | 11 | # In case the user does not use the XDG Base Directory Specification 12 | # https://specifications.freedesktop.org/basedir-spec/latest 13 | XDG_DATA_HOME="$HOME/.local/share" 14 | 15 | if [ ! -d "$XDG_CACHE_HOME" ]; then 16 | XDG_CACHE_HOME="$HOME/.cache" 17 | fi 18 | 19 | # LOGGING SYSTEM 20 | # ##################################################################### 21 | # 22 | 23 | BLUE="\e[1;34m" # Blue 24 | RED="\e[1;31m" # Red 25 | YELLOW="\e[1;33m" # Yellow 26 | GREEN="\e[1;32m" # Green 27 | RESET="\e[0m" # Reset colors 28 | 29 | LOG="${BLUE}[LOG]${RESET}" 30 | WARNING="${YELLOW}[WARNING]${RESET}" 31 | ERROR="${RED}[ERROR]${RESET}" 32 | SUCCES="${GREEN}[SUCCES]${RESET}" 33 | CHECK="${GREEN}[CHECK]${RESET}" 34 | 35 | # CHECKS & OTHER FUNCTIONS 36 | # ################################################################### 37 | # 38 | 39 | if [ -z "$XDG_DATA_HOME" ] && [ -z "$XDG_CACHE_HOME" ]; then 40 | echo -e "$WARNING Please set variables ${YELLOW}XDG_DATA_HOME${RESET}, ${YELLOW}XDG_CACHE_HOME${RESET} and others ${YELLOW}XDG_*${RESET} according to the XDG Base Directory specification." 41 | fi 42 | 43 | # Photoshop URL 44 | # TODO: change hosting server 45 | PHOTOSHOP_URL="https://spyderrock.com/kMnq2220-AdobePhotoshop2021.xz" 46 | 47 | # sha256 checksum 48 | CHECKSUM="8321b969161f2d2ad736067320d493c5b6ae579eaab9400cd1fda6871af2c033" 49 | 50 | LAUNCHER="$HOME/.local/bin/photoshop/photoshop.sh" 51 | LOCAL_ARCHIVE="" 52 | ICON="" 53 | 54 | trap on_interrupt SIGINT 55 | 56 | on_interrupt() { 57 | trap "exit 1" SIGINT 58 | 59 | echo -e "\n$WARNING User intrrupt!" 60 | 61 | if [ -d "$INSTALL_PATH" ]; then 62 | if ask_user "Do you want to ${RED}delete${RESET} a newly created folder?"; then 63 | if rm -rfv "${INSTALL_PATH:?}" &>>./install_log.log; then 64 | exit 0 65 | else 66 | echo -e "$ERROR The last command ended with an error." 67 | exit 1 68 | fi 69 | else 70 | echo -e "$LOG Exiting." 71 | exit 1 72 | fi 73 | else 74 | exit 1 75 | fi 76 | } 77 | 78 | get_help() { 79 | echo "Usage: $0 [options...] " 80 | echo " -a Use already existing Photoshop.tar.xz" 81 | echo " -i Install Photoshop" 82 | echo " -u Uninstall Photoshop" 83 | echo " -h Show this help" 84 | echo "" 85 | echo "Please familiarize yourself with the script code before using it." 86 | echo "I do not guarantee its correct operation. Also, it may contain potentially dangerous functions" 87 | } 88 | 89 | ask_user() { 90 | while true; do 91 | read -r -p "$(echo -e "${WARNING} $* (yes/no): ")" answer 92 | 93 | case "$answer" in 94 | [yY]|[yY][eE][sS]) 95 | return 0 96 | ;; 97 | 98 | [nN]|[nN][oO]) 99 | return 1 100 | ;; 101 | 102 | *) 103 | echo "Invalid input, try again" 104 | esac 105 | done 106 | } 107 | 108 | # Imagemagick is needed in case you are not using Papirus Icons. 109 | # One of the functions will load a Photoshop `.webp` icon and convert it to `.png`. The `.png` file will be used in the `.desktop` entry. 110 | # Keep in mind, that script will check the installation of icon pack, not an icon pack in use. 111 | # So if you have Papirus installed, but don't using it, script will not pull an icon from the internet. 112 | check_deps() { 113 | declare -A packages=( 114 | ["curl"]="curl" # Usually pre-installed on most distributions 115 | ["wine"]="wine" 116 | ["winetricks"]="winetricks" 117 | ["7z"]="p7zip" 118 | 119 | # TODO: do not install ImageMagick if the user is using Papirus. 120 | ["magick"]="imagemagick" 121 | ) 122 | 123 | missed_packages=() 124 | 125 | for bin in "${!packages[@]}"; do 126 | if ! command -v "$bin" >/dev/null; then 127 | missed_packages+=("${packages[$bin]}") 128 | fi 129 | done 130 | 131 | if [ ${#missed_packages[@]} -eq 0 ]; then 132 | echo -e "$CHECK All dependencies are installed." 133 | else 134 | echo -e "$WARNING Missing dependencies: ${YELLOW}${missed_packages[*]}${RESET}." 135 | return 1 136 | fi 137 | } 138 | 139 | install_deps() { 140 | if [ ! -f /etc/os-release ]; then 141 | echo -e "$WARNING Cannot find '${YELLOW}/etc/os-release${RESET}'." 142 | exit 1 143 | fi 144 | 145 | source /etc/os-release 146 | 147 | # Deprecated. Will not be updated. Still works for listed distros 148 | # Refer to /etc/os-release for more info 149 | case "$ID" in 150 | "arch"|"cachyos") 151 | # To display the list of packages correctly, we need to format the string. 152 | # Otherwise `read` will not display the whole list of packages and will stop in the middle of the line. 153 | missing_packages_str=$(printf "%s " "${missed_packages[@]}") 154 | # Here we can do without it, but in that case there will be an annoying space before the period at the end of the package listing. 155 | missing_packages_str=${missing_packages_str% } 156 | 157 | if ask_user "Script will execute: '${RED}sudo ${BLUE}pacman -S ${YELLOW}${missing_packages_str}${RESET}'. Proceed?"; then 158 | echo -e "$LOG Installing missing dependencies" 159 | if ! sudo pacman -S "${missed_packages[@]}"; then 160 | echo -e "$ERROR Pacman terminated with an error." 161 | exit 1 162 | else 163 | echo -e "$LOG Missing dependencies was installed" 164 | fi 165 | else 166 | echo -e "$LOG Exiting." 167 | exit 1 168 | fi 169 | ;; 170 | *) 171 | echo -e "$ERROR For now only ${BLUE}Arch Linux${RESET} is supported." 172 | exit 1 173 | ;; 174 | esac 175 | } 176 | 177 | # MAIN SCRIPT 178 | # ################################################################### 179 | # 180 | 181 | is_path_exists() { 182 | if [ -d "$1" ]; then 183 | # BUG 184 | # echo -e "$WARNING The specified path '$1' already exists." 185 | echo -e "$WARNING The specified path '${YELLOW}${1}${RESET}' already exists." 186 | 187 | if ask_user "Do you want to ${RED}delete${RESET} previous installation?"; then 188 | if rm -rfv "${1:?}" &>>./install_log.log; then 189 | echo -e "$LOG Deleted old installation." 190 | else 191 | echo -e "$ERROR Something went wrong." 192 | exit 1 193 | fi 194 | else 195 | echo -e "$LOG Exiting." 196 | exit 1 197 | fi 198 | fi 199 | } 200 | 201 | setup_wine() { 202 | export WINEPREFIX="$INSTALL_PATH" 203 | local vc_libraries=("vcrun2003" "vcrun2005" "vcrun2010" "vcrun2012" "vcrun2013" "vcrun2022") 204 | 205 | echo -e "$LOG Setting up wine prefix." 206 | winecfg /v win10 2>/dev/null 207 | 208 | echo -e "$LOG Downloading and installing core components for wine prefix. This could take some time." 209 | 210 | if ! winetricks --unattended corefonts win10 vkd3d dxvk2030 msxml3 msxml6 gdiplus &>./install_log.log; then 211 | echo -e "$ERROR Winetricks terminated with an error." 212 | echo -e "$ERROR Please open an issue by mentioning the contents of ${YELLOW}./install_log.log${RESET}." 213 | exit 1 214 | fi 215 | 216 | { 217 | echo "---------------------------------------------------------------------" 218 | echo " Downloading Visual C++ Libraries " 219 | echo "---------------------------------------------------------------------" 220 | } >>./install_log.log # Thanks to Katy248 for the idea. 221 | 222 | echo -e "$LOG Downloading and installing Visual C++ libraries." 223 | if ! winetricks --unattended "${vc_libraries[@]}" &>>./install_log.log; then 224 | echo -e "$ERROR Winetricks terminated with an error. Please, refer to ${YELLOW}install_log.log${RESET} for more info." 225 | echo -e "$ERROR If you can't solve the issue yourself, please, open an issue on the GitHub." 226 | exit 1 227 | fi 228 | } 229 | 230 | download_photoshop() { 231 | local archive_name="Photoshop.tar.xz" 232 | 233 | if [ -f "./${archive_name}" ]; then 234 | echo -e "$LOG Found existing archive in current folder." 235 | echo -e "$LOG Comparing checksums." 236 | # TODO: 237 | # separate function to avoid repeating this task 238 | local local_checksum 239 | local_checksum="$(sha256sum "$archive_name" | awk '{print $1}')" 240 | 241 | if [[ "$CHECKSUM" != "$local_checksum" ]]; then 242 | echo -e "$LOG Checksums don't match!" 243 | echo -e "$LOG Deleting corrupted archive." 244 | rm -v "${archive_name:?}" &>>./install_log.log 245 | fi 246 | 247 | return 0 248 | fi 249 | 250 | echo -e "$LOG Downloading Photoshop (1.1G)." 251 | if ! curl --progress-bar "$PHOTOSHOP_URL" -o "$archive_name"; then 252 | # TODO: 253 | # separate function to avoid repeating 254 | echo -e "$ERROR An error occurred during the download. Please, refer to ${YELLOW}install_log.log${RESET} for more info." 255 | echo -e "$ERROR If you can't solve the issue yourself, please, open an issue on the GitHub." 256 | exit 1 257 | fi 258 | 259 | # TODO: 260 | # A separate function so you don't have to write this code multiple times 261 | echo -e "$LOG Comparing checksums." 262 | local local_checksum 263 | local_checksum="$(sha256sum "$archive_name" | awk '{print $1}')" 264 | 265 | if [[ "$CHECKSUM" != "$local_checksum" ]]; then 266 | echo -e "$ERROR Checksums don't match!" 267 | exit 1 268 | 269 | # TODO 270 | # while true; do 271 | # read -p "$(echo -e "$LOG_WARNING")[WARNING]$(echo -e "$LOG_RESET") Do you want to redownload it again? (yes/no): " answer 272 | # case "$answer" in 273 | # pattern) 274 | # command ... 275 | # ;; 276 | # *) 277 | # command ... 278 | # ;; 279 | # esac 280 | # done 281 | fi 282 | } 283 | 284 | verify_path() { 285 | # test $1, if that fails test $pwd 286 | # relative paths are also working now 287 | local path="$(realpath "${1:-$(pwd)}")" 288 | 289 | # Check the validity of the path if the user has specified the absolute path manually. This is necessary in case the user accidentally misspells $HOME paths. 290 | # https://github.com/shvedes/photoshop-linux/issues/1 291 | if [[ ! "$path" == "$HOME"* ]]; then 292 | echo -e "$ERROR Cannot validate ${YELLOW}\$HOME${RESET} path." 293 | exit 1 294 | fi 295 | 296 | # Fix trailing slashes if needed 297 | path="$(echo "$path" | sed 's/\/\+$//')" 298 | INSTALL_PATH="$path" 299 | 300 | # Remove the last folder from the given path (as it will be created by wineprefix) and check the remaining path for validity. 301 | local reformatted_path 302 | reformatted_path="$(echo "$path" | sed 's/\/[^\/]*$//')" 303 | 304 | if [ -d "$reformatted_path" ]; then 305 | if [[ "$reformatted_path" == "$HOME" ]]; then 306 | return 0 307 | else 308 | echo -e "$CHECK Directory '${YELLOW}${reformatted_path}${RESET}' exist." 309 | fi 310 | else 311 | echo -e "$ERROR Path $reformatted_path does not exist!" 312 | exit 1 313 | fi 314 | } 315 | 316 | # TODO: 317 | # Do not use the same checks multiple times 318 | install_photoshop() { 319 | if [ -z "$LOCAL_ARCHIVE" ]; then 320 | # echo -e "${LOG_NORMAL}[LOG]${LOG_RESET} Installing Photoshop." 321 | local filename="Photoshop.tar.xz" 322 | 323 | echo -e "$LOG Extracting Photoshop." 324 | if ! tar xvf "$filename" &>>./install_log.log; then 325 | echo -e "$ERROR An error occurred while unpacking the archive." 326 | exit 1 327 | # TODO: 328 | # A separate function so you don't have to write this code multiple times 329 | # while true; do 330 | # read -p "Delete wine prefix?" 331 | # command ... 332 | # done 333 | fi 334 | 335 | echo -e "$LOG Installing Photoshop." 336 | if ! mv "./Adobe Photoshop 2021" "$INSTALL_PATH/drive_c/Program Files"; then 337 | echo -e "$ERROR An error occurred during installation." 338 | exit 1 339 | fi 340 | else 341 | echo -e "$LOG Using given local Photoshop archive." 342 | 343 | if [[ ! "$LOCAL_ARCHIVE" = *.tar.xz ]]; then 344 | echo -e "$ERROR Only tar.xz is accepted for now." 345 | exit 1 346 | # TODO: 347 | # Allow user to use not only tar.xz / archive from another sources 348 | fi 349 | 350 | # TODO: 351 | # A separate function so you don't have to write this code multiple times 352 | echo -e "$LOG Comparing checksums." 353 | 354 | local local_checksum 355 | local_checksum="$(sha256sum "$LOCAL_ARCHIVE" | awk '{print $1}')" 356 | 357 | # TODO: 358 | # Allow user to skip checksum comparing 359 | if [[ "$CHECKSUM" != "$local_checksum" ]]; then 360 | echo -e "$ERROR Checksums don't match!" 361 | exit 1 362 | fi 363 | 364 | echo -e "$LOG Extracting Photoshop." 365 | if ! tar xvf "$LOCAL_ARCHIVE" &>>./install_log.log; then 366 | echo -e "$ERROR An error occurred while unpacking the archive." 367 | exit 1 368 | # TODO: 369 | # A separate function so you don't have to write this code multiple times 370 | # while true; do 371 | # read -p "Delete wine prefix?" 372 | # command ... 373 | # done 374 | fi 375 | 376 | echo -e "$LOG Installing Photoshop." 377 | if ! mv "./Adobe Photoshop 2021" "$INSTALL_PATH/drive_c/Program Files"; then 378 | echo -e "$ERROR An error occurred during installation. Please, refer to ${YELLOW}install_log.log${RESET} for more info." 379 | echo -e "$ERROR If you can't solve the issue yourself, please, open an issue on the GitHub." 380 | exit 1 381 | fi 382 | fi 383 | } 384 | 385 | install_icon() { 386 | # Papirus Icon Theme already has a Photoshop icon in it. 387 | # The script will check if you have Papirus installed and use its icon. If Papirus is not installed, the script will download the icon from the Internet and use it. 388 | if find /usr/share/icons -name "Papirus*" &>/dev/null; then 389 | ICON="photoshop" 390 | else 391 | if [ -d "$XDG_DATA_HOME/icons" ]; then 392 | if find "$XDG_DATA_HOME/icons" -name "Papirus*" &>/dev/null; then 393 | ICON="photoshop" 394 | fi 395 | else 396 | mkdir "$XDG_DATA_HOME/icons" 397 | fi 398 | fi 399 | 400 | if [ -z "$ICON" ]; then 401 | local icon_url="https://cdn3d.iconscout.com/3d/premium/thumb/adobe-photoshop-file-3d-icon-download-in-png-blend-fbx-gltf-formats--logo-format-graphic-design-pack-development-icons-9831950.png" 402 | if ! curl "$icon_url" -o "icon.webp" &>>./install_log.log; then 403 | echo -e "$ERROR Failed to download icon. Please refer ${YELLOW}install_log.log${RESET} for info." 404 | exit 1 405 | fi 406 | 407 | magick "icon.webp" "icon.png" 408 | rm "./icon.webp" 409 | 410 | echo -e "$LOG Installing icon for .desktop entry." 411 | mv "./icon.png" "$XDG_DATA_HOME/icons/photoshop.png" 412 | ICON="$XDG_DATA_HOME/icons/photoshop.png" 413 | fi 414 | } 415 | 416 | install_desktop_entry() { 417 | if [ ! -d "$XDG_DATA_HOME/applications" ]; then 418 | mkdir "$XDG_DATA_HOME/applications" 419 | fi 420 | 421 | local path="$XDG_DATA_HOME/applications/photoshop.desktop" 422 | 423 | echo -e "$LOG Genarating application menu item." 424 | 425 | echo "[Desktop Entry]" >"$path" 426 | echo "Name=Adobe Photoshop CC 2021" >>"$path" 427 | echo "Exec=bash -c "$HOME/.local/bin/photoshop/photoshop.sh %F"" >>"$path" 428 | echo "Type=Application" >>"$path" 429 | echo "Comment=The industry-standard photo editing software (Wine" >>"$path" 430 | echo "Categories=Graphics" >>"$path" 431 | echo "Icon=$ICON" >>"$path" 432 | echo "MimeType=image/psd;image/x-psd;image/png;image/jpg;image/jpeg;image/webp;image/heif;image/raw" >>"$path" 433 | echo "StartupWMClass=photoshop.exe" >>"$path" 434 | } 435 | 436 | install_launcher() { 437 | mkdir -p "$HOME/.local/bin/photoshop" 438 | echo -e "$LOG Installing launcher." 439 | 440 | # Thanks to Katy248 (https://github.com/Katy248) for the idea. 441 | # Note: some variables are not used at all; TODO: remove them 442 | { 443 | echo "#!/usr/bin/env bash" 444 | echo "" 445 | echo "export WINEPREFIX=\"$WINEPREFIX\"" 446 | echo "LOG_FILE=\"$XDG_CACHE_HOME/photoshop.log\"" 447 | echo "DXVK_LOG_PATH=\"\$WINEPREFIX/dxvk_cache\"" 448 | echo "DXVK_STATE_CACHE_PATH=\"\$WINEPREFIX/dxvk_cache\"" 449 | echo "PHOTOSHOP=\"\$WINEPREFIX/drive_c/Program Files/Adobe Photoshop 2021/photoshop.exe\"" 450 | echo "" 451 | echo "echo \"All logs are saved in \$LOG_FILE\"" 452 | echo "wine \"\$PHOTOSHOP\" \"\$@\" &> \"\$LOG_FILE\" " 453 | } >"$LAUNCHER" 454 | 455 | chmod +x "$LAUNCHER" 456 | } 457 | 458 | uninstall() { 459 | if [ -d "$1" ]; then 460 | if ask_user "The script will delete '$1'. Continue?"; then 461 | echo -e "$LOG Uninstalling old installation." 462 | rm -rfv "${1:?}" &>>./uninstall_log.log 463 | 464 | echo -e "$LOG Removing launcher & app icon." 465 | [ -d "$HOME/.local/bin/photoshop" ] && rm -rfv $HOME/.local/bin/photoshop &> ./uninstall_log.log 466 | [ -f "$XDG_DATA_HOME/applications/photoshop.desktop" ] && rm -rv $XDG_DATA_HOME/applications/photoshop.desktop &> ./uninstall_log.log 467 | echo -e "$SUCCES Photoshop was successfully deleted." 468 | else 469 | exit 1 470 | fi 471 | else 472 | echo -e "$ERROR "$1" does not exist!" 473 | exit 1 474 | fi 475 | } 476 | 477 | main() { 478 | if ! check_deps; then 479 | install_deps 480 | fi 481 | 482 | verify_path "$INSTALL_PATH" 483 | is_path_exists "$INSTALL_PATH" 484 | setup_wine 485 | 486 | if [ -z "$LOCAL_ARCHIVE" ]; then 487 | download_photoshop 488 | install_photoshop 489 | else 490 | install_photoshop 491 | fi 492 | 493 | install_icon 494 | install_desktop_entry 495 | install_launcher 496 | 497 | echo -e "$SUCCES Photoshop was successfully installed." 498 | } 499 | 500 | if [[ -n $1 && $1 != -* ]]; then 501 | echo "Invalid input: options must start with '-'" 502 | get_help 503 | exit 1 504 | fi 505 | 506 | if [ -z "$1" ]; then 507 | get_help 508 | exit 1 509 | fi 510 | 511 | while getopts "a:i:u:h" opt; do 512 | case "$opt" in 513 | a) 514 | LOCAL_ARCHIVE="$OPTARG" ;; 515 | h) 516 | get_help && exit 0 ;; 517 | i) 518 | INSTALL_PATH="$OPTARG" ;; 519 | u) 520 | uninstall "$OPTARG" && exit 0;; 521 | :) 522 | echo "Option -${OPTARG} requires an argument" && exit 1 ;; 523 | ?) 524 | echo "Invalid option. Use -h for help" && exit 1 ;; 525 | esac 526 | done 527 | 528 | main 529 | --------------------------------------------------------------------------------