Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 17 Aug 2019, 14:00
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Photoshop CS2 Downloader script
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
Geoffrey


Joined: 30 May 2010
Posts: 2377
Location: Queensland

PostPosted: Sun 28 Apr 2019, 23:19    Post subject:  Photoshop CS2 Downloader script  

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:
#!/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
photoshop_downloader.sh.tar.gz
Description 
gz

 Download 
Filename  photoshop_downloader.sh.tar.gz 
Filesize  2.54 KB 
Downloaded  79 Time(s) 

_________________
Carolina: Recent Repository Additions

Back to top
View user's profile Send private message 
p310don

Joined: 19 May 2009
Posts: 1406
Location: Brisbane, Australia

PostPosted: Thu 02 May 2019, 01:58    Post subject:  

Hi Geoffrey,

Got any links for winetricks and cabextract?
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 2377
Location: Queensland

PostPosted: Thu 02 May 2019, 09:18    Post subject:  

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:
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/

_________________
Carolina: Recent Repository Additions

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0570s ][ Queries: 12 (0.0147s) ][ GZIP on ]