photoshopCClinux/scripts/PhotoshopSetup.sh

126 lines
4.0 KiB
Bash
Raw Normal View History

2020-02-09 19:00:41 +00:00
#!/usr/bin/env bash
source "sharedFuncs.sh"
2020-02-10 09:14:38 +00:00
2021-01-02 13:15:41 +00:00
function main() {
mkdir -p $SCR_PATH
mkdir -p $CACHE_PATH
2020-02-10 10:13:07 +00:00
setup_log "================| script executed |================"
2020-12-30 21:51:21 +00:00
is64
#make sure wine and winetricks package is already installed
2020-02-10 09:14:38 +00:00
package_installed wine
2021-03-29 06:14:28 +00:00
package_installed wine64
2020-02-11 06:53:27 +00:00
package_installed md5sum
2020-04-08 12:47:51 +00:00
package_installed winetricks
2020-02-11 06:53:27 +00:00
RESOURCES_PATH="$SCR_PATH/resources"
2020-02-11 06:53:27 +00:00
WINE_PREFIX="$SCR_PATH/prefix"
2020-02-11 07:54:27 +00:00
#create new wine prefix for photoshop
rmdir_if_exist $WINE_PREFIX
2021-01-02 19:58:44 +00:00
#export necessary variable for wine
2020-02-11 07:54:27 +00:00
export_var
#config wine prefix and install mono and gecko automatic
echo -e "\033[1;93mplease install mono and gecko packages then click on OK button, do not change Windows version from Windows 7\e[0m"
2020-02-11 18:09:20 +00:00
winecfg 2> "$SCR_PATH/wine-error.log"
2020-02-11 19:10:30 +00:00
if [ $? -eq 0 ];then
show_message "prefix configured..."
sleep 5
else
error "prefix config failed :("
fi
2021-06-22 11:46:01 +00:00
sleep 5
2020-02-11 19:10:30 +00:00
if [ -f "$WINE_PREFIX/user.reg" ];then
#add dark mod
set_dark_mod
else
error "user.reg Not Found :("
fi
#create resources directory
rmdir_if_exist $RESOURCES_PATH
2020-02-12 07:41:27 +00:00
2020-04-08 12:47:51 +00:00
# winetricks atmlib corefonts fontsmooth=rgb gdiplus vcrun2008 vcrun2010 vcrun2012 vcrun2013 vcrun2015 atmlib msxml3 msxml6 gdiplus
winetricks atmlib fontsmooth=rgb vcrun2008 vcrun2010 vcrun2012 vcrun2013 atmlib msxml3 msxml6
2020-02-12 12:54:39 +00:00
#install photoshop
sleep 3
install_photoshopSE
sleep 5
2020-04-08 12:47:51 +00:00
2020-02-13 16:06:32 +00:00
replacement
2020-02-12 12:54:39 +00:00
if [ -d $RESOURCES_PATH ];then
show_message "deleting resources folder"
rm -rf $RESOURCES_PATH
else
error "resources folder Not Found"
fi
2020-02-12 19:34:41 +00:00
2020-05-04 09:56:30 +00:00
launcher
2020-02-13 08:13:15 +00:00
show_message "\033[1;33mwhen you run photoshop for the first time it may take a while\e[0m"
2020-06-29 23:35:11 +00:00
show_message "Almost finished..."
2020-02-13 08:13:15 +00:00
sleep 30
2020-02-10 10:13:07 +00:00
}
function replacement() {
local filename="replacement.tgz"
local filemd5="6441a8e77c082897a99c2b7b588c9ac4"
local filelink="https://victor.poshtiban.io/p/gictor/photoshopCC/replacement.tgz"
local filepath="$CACHE_PATH/$filename"
download_component $filepath $filemd5 $filelink $filename
mkdir "$RESOURCES_PATH/replacement"
show_message "extract replacement component..."
tar -xzf $filepath -C "$RESOURCES_PATH/replacement"
local replacefiles=("IconResources.idx" "PSIconsHighRes.dat" "PSIconsLowRes.dat")
local destpath="$WINE_PREFIX/drive_c/users/$USER/PhotoshopSE/Resources"
for f in "${replacefiles[@]}";do
local sourcepath="$RESOURCES_PATH/replacement/$f"
cp -f "$sourcepath" "$destpath" || error "cant copy replacement $f file..."
done
show_message "replace component compeleted..."
unset filename filemd5 filelink filepath
}
function install_photoshopSE() {
local filename="photoshopCC-V19.1.6-2018x64.tgz"
local filemd5="b63f6ed690343ee12b6195424f94c33f"
local filelink="https://victor.poshtiban.io/p/gictor/photoshopCC/photoshopCC-V19.1.6-2018x64.tgz"
# local filelink="http://127.0.0.1:8080/photoshopCC-V19.1.6-2018x64.tgz"
local filepath="$CACHE_PATH/$filename"
download_component $filepath $filemd5 $filelink $filename
mkdir "$RESOURCES_PATH/photoshopCC"
show_message "extract photoshop..."
tar -xzf "$filepath" -C "$RESOURCES_PATH/photoshopCC"
echo "===============| photoshop CC v19 |===============" >> "$SCR_PATH/wine-error.log"
show_message "install photoshop..."
show_message "\033[1;33mPlease don't change default Destination Folder\e[0m"
2021-03-29 06:14:28 +00:00
wine64 "$RESOURCES_PATH/photoshopCC/photoshop_cc.exe" &>> "$SCR_PATH/wine-error.log" || error "sorry something went wrong during photoshop installation"
show_message "removing useless helper.exe plugin to avoid errors"
rm "$WINE_PREFIX/drive_c/users/$USER/PhotoshopSE/Required/Plug-ins/Spaces/Adobe Spaces Helper.exe"
2021-01-09 10:57:04 +00:00
notify-send "Photoshop CC" "photoshop installed successfully" -i "photoshop"
show_message "photoshopCC V19 x64 installed..."
unset filename filemd5 filelink filepath
}
check_arg $@
save_paths
main