Photoshop CS2 Downloader script

Paint programs, vector editors, 3d modelers, animation editors, etc.
Post Reply
Message
Author
User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

Photoshop CS2 Downloader script

#1 Post by Geoffrey »

Hi, haven't been around for awhile.
Here's a script I wrote some time back that downloads and installs Photoshop CS2, this version in free to download, the serial number is provided by Adobe: 1045-1412-5685-1654-6343-1431

The script already has the serial number so all you have to follow the prompts.

You need wine(obvious), winetricks and cabextract installed, the script downloads the other dependencies.

You are given the option to download either English, French, German or Japanese versions.

Hope it's of use, let me know if there is a problem.

Code: Select all

#!/bin/sh
# Photoshop Downloader Installer
# By Geoffrey Saturday 29th January 2017
# serial number 1045-1412-5685-1654-6343-1431

NAME="Photoshop Downloader Installer"

MESSAGE_BOX(){
export Message_Box='
<window title="" border-width="30" icon-name="emblem-downloads" resizable="false" skip_taskbar_hint="true"> 
<vbox> 
<text wrap="false" justify="2" use-markup="true"> 
         <label>"'$MESSAGE'"</label> 
         </text> 
</vbox> 
<timer seconds="true" interval="10" visible="false"> 
    <action>EXIT:exit</action> 
</timer>
    <action signal="focus-out-event">EXIT:exit</action>
</window>'
gtkdialog -p Message_Box 
}
export -f  MESSAGE_BOX

PHOTOSHOP_DOWNLOADER="$(readlink -e "$0")"
sleep 0.3
if [ `pidof "$(basename "$PHOTOSHOP_DOWNLOADER")" -o %PPID | wc -w` -gt 1 ]; then
export MESSAGE="<big><b>$NAME is running.</b></big>"
MESSAGE_BOX
exit 1
fi

if [ -f '/root/.wine/drive_c/Program Files/Adobe/Adobe Photoshop CS2/Photoshop.exe' ]; then
export MESSAGE="<big><b>Adobe Photoshop CS2 already installed</b></big>"
MESSAGE_BOX
exit 1
fi	

if [ ! -f /usr/bin/wine ]; then 
WINE="Wine";
fi
if [ -f /usr/bin/winetricks ] || [ -f /usr/sbin/winetricks ]; then 
WINETRICKS=""
else
WINETRICKS="Winetricks";
fi
if [ ! -f /usr/bin/cabextract ]; then 
CABEXTRACT="Cabextract";
fi
if [ ! -f /usr/bin/wine ] || [ ! -f /usr/bin/cabextract ] || [ ! -f /usr/sbin/winetricks ] && [ ! -f /usr/bin/winetricks ]; then
export MESSAGE="<big><b>The following need to be installed

"$WINE" "$WINETRICKS" "$CABEXTRACT"</b></big>"
MESSAGE_BOX
exit 1
fi	

function DOWNLOAD(){
if [ "$USERNAME" = "" ] || [ "$COMPANYNAME" = "" ]; then
export MESSAGE="<big><b>Names are required</b></big>"
MESSAGE_BOX
exit 1
fi
export MESSAGE="<big><b>Installing Dependencies</b></big>"
MESSAGE_BOX

rxvt -e winetricks vcrun6 corefonts

[ "$LANGUAGE" = "English" ]	&& EXE="PhSp_CS2_English.exe" && EXEDIR="PhSp_CS2_UE_Ret"
[ "$LANGUAGE" = "French" ] && EXE="PS_CS2_FR_NonRet.exe" && EXEDIR="PS_CS2_FR_NonRet"
[ "$LANGUAGE" = "German" ] && EXE="PS_CS2_Gr_NonRet.exe" && EXEDIR="PS_CS2_Gr_NonRet"
[ "$LANGUAGE" = "Japanese" ] &&	EXE="PS_CS2_JP_NonRet.exe" && EXEDIR="PS_CS2_JP_NonRet"

mkdir -p /tmp/PHOTOSHOP

URL='http://download.adobe.com/pub/adobe/magic/creativesuite/CS2_EOL/PHSP/'$EXE''
wget -t 2 -T 20 --waitretry=20 --spider -S "$URL" > /tmp/PHOTOSHOP/filesize 2>&1   
SIZE=`echo $(awk '/^Length: / {print $3}' /tmp/PHOTOSHOP/filesize) | sed 's/^.\(.*\).$/\1/'`

export DOWNLOADER_GUI='
<window title="Download Photoshop '$LANGUAGE'" icon-name="emblem-downloads" border-width="10" resizable="false">
<vbox>
<progressbar width-request="450">
<label>Please Wait...</label>
<input>wget --no-check-certificate -4 -c -t 5 -w 5 -P ~/Downloads '$URL' 2>&1 | sed -nru "s|.* ([0-9]+%) +([^ ]+).*$|\1\nDownloading \1  of '$EXE' '$SIZE' @ \2B/sec |p" 2>/dev/null</input>
<action type="exit">Ready</action>
</progressbar>
<hbox homogeneous="true">
<button use-underline="true">
   <label>"_Cancel "</label>
   <input file stock="gtk-close"></input>   
   <action>func_terminate_service</action>
   <action>EXIT:exit</action>
   </button>
</hbox>
</vbox>
</window>'
I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog --program=DOWNLOADER_GUI); do
   eval $STATEMENTS
done
IFS=$I
[ $EXIT = exit ] && exit 1

export MESSAGE="<big><b>'$EXE' is Downloaded
Preparing to install....</b></big>"
MESSAGE_BOX &

7z x  ~/Downloads/$EXE -o/root/.wine/drive_c/$EXEDIR

echo ";***************************************************************
;Adobe Installer External Configuration File: Abcpy.ini
;***************************************************************

;***************************************************************
;Main Section
;The (Product) key is a required key
;***************************************************************
[MAIN]
Product=Adobe(R) Photoshop CS2
AbcpyVersion=2.0


;***************************************************************
;OEM Installation Options
;***************************************************************
[OEM Install]
SERIALNUMBER=1045-1412-5685-1654-6343-1431
SERIALNUMBERTRYOUT=
USERNAME="$USERNAME"
COMPANYNAME="$COMPANYNAME"
INSTALLDIR=c:\Program Files\Adobe\Adobe Photoshop CS2
" > '/root/.wine/drive_c/'$EXEDIR'/Adobe(R) Photoshop(R) CS2/Abcpy.ini'

# Disable Adobe Updates
echo " Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Updater]

"'"Enterprise"'"=dword:00000001" > /root/.wine/drive_c/DisableAUM_Updates.reg

wine '/root/.wine/drive_c/'$EXEDIR'/Adobe(R) Photoshop(R) CS2/setup.exe'

wine regedit.exe /S /root/.wine/drive_c/DisableAUM_Updates.reg

while [ ! -f '/root/.local/share/applications/wine/Programs/Adobe Photoshop CS2.desktop' ]; do sleep 1; done

cp '/root/.local/share/applications/wine/Programs/Adobe Photoshop CS2.desktop' /usr/share/applications/Adobe-Photoshop-CS2.desktop

echo "Categories=Graphics;" >> /usr/share/applications/Adobe-Photoshop-CS2.desktop

fixmenus

if [ -f /usr/share/applications/Adobe-Photoshop-CS2.desktop ]; then
export MESSAGE="<big><b>Adobe Photoshop CS2 installed
Menu entry added to Graphics</b></big>"
MESSAGE_BOX
exit 1
fi	

func_terminate_service
}
export -f  DOWNLOAD 

func_terminate_service(){
PID_PHOTOSHOP_DOWNLOADER=$(pidof photoshop_downloader)   
GUI=$(ps -ef | grep PHOTOSHOP_DOWNLOADER_DIALOG | grep -v grep | awk '{ print $2 }')
     kill "$PID_PHOTOSHOP_DOWNLOADER"
     kill "$GUI"
      }
export -f  func_terminate_service 

export PHOTOSHOP_DOWNLOADER_DIALOG='
<window title="'$NAME'" icon-name="emblem-downloads" resizable="false">
<vbox>
  <text use-markup="true"><label>"<big><b><span>Adobe Photoshop Installer </span></b></big>"</label></text>
 <hbox>
 <text><label>"User Name"</label></text>
 <vbox width-request="225">
  <entry>
	<variable>USERNAME</variable>
	 <input>echo "Puppy"</input>
  </entry>
 </vbox>	
 </hbox>
 <hbox>
  <text><label>"Company Name"</label></text>
 <vbox width-request="225">
  <entry>
   <variable>COMPANYNAME</variable>
	  <input>echo "User"</input>
  </entry>
 </vbox>	
 </hbox>
 <hbox space-fill="true" space-expand="false" homogeneous="true">    
 <hbox>
  <text><label>"Photoshop CS2 9.0"</label></text>    
  <comboboxtext>
   <variable>LANGUAGE</variable>
	   <item>English</item>
	   <item>French</item>
	   <item>German</item>
	   <item>Japanese</item>
  </comboboxtext>
 	<button relief="2" use-underline="true">
      <label>_Download</label>
      <input file icon="emblem-downloads"></input>
      <height>24</height><width>24</width>
      <action>DOWNLOAD</action>
	</button>
 </hbox>
 </hbox>
 <hbox border-width="10" homogeneous="true">
 <button use-underline="true">
   <label>"_Cancel "</label>
   <input file stock="gtk-close"></input>   
   <action>EXIT:exit</action>
   </button>
 </hbox>
</vbox>
</window>'
gtkdialog -p PHOTOSHOP_DOWNLOADER_DIALOG &> /dev/null
exit 0
Attachments
photoshop_downloader.sh.tar.gz
(2.54 KiB) Downloaded 278 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#2 Post by p310don »

Hi Geoffrey,

Got any links for winetricks and cabextract?

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#3 Post by Geoffrey »

p310don wrote:Hi Geoffrey,
Got any links for winetricks and cabextract?
Edit:

Run this in the terminal to download winetricks, it will place it in the path /usr/sbin, this seems to be the norm.

Code: Select all

cd "${HOME}/Downloads"
wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
mv winetricks /usr/sbin
Get cabextract here https://www.cabextract.org.uk/
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

Post Reply