Rox Filer Install Script


Forum: DSL Ideas and Suggestions
Topic: Rox Filer Install Script
started by: cbagger01

Posted by cbagger01 on Nov. 16 2003,07:58
Hi all.

I just created an install script for the Rox Filer file manager and would like to see if it works for anyone besides me. It works in a similar way to the "Mozilla Firebird" install script since it downloads the required libraries (Slackware) and binaries and installs them.

The script works on a DSL 0.5 bootable CD system.  I have not tried it out on a hard disk installed system.  Here are the instructions:

Copy the following script and paste it into a text editor like Nedit or Nano.
Save it to your home directory (/home/damnsmall) as filename 'loadrox'.
From a shell prompt, do a 'chmod 755 loadrox' to make it executable.
Then do a 'sudo su' to become the root user.
Then type './loadrox' to start the script.
Choose to install the program in your HOME directory (/home/root).
Choose 'yes' to all of the install messages.
You can then start Rox Filer again at any time by typing 'rox' at the shell prompt.

Code Sample
#!/bin/sh
#
# loadrox  -  Downloads and installs the Rox Filer file manager for a
#             Damn Small Linux user.
# Rev 0 11/15/03

#
# First, create a /usr tree on the ramdisk if the user is running from
# the Damn Small Linux Live CD. Why? Because the default /usr tree is
# linked to the read-only CDROM file system and new files are not allowed.
# Lets create a REAL /usr tree structure on the ramdisk and add a bunch of
# Symlinks back to the CDROM for all of the files inside the old /usr tree.
ls -l /usr | grep 'KNOPPIX' > /tmp/loadrox.tmp
if  test -s '/tmp/loadrox.tmp'
then
    echo 'System is running from a Live CD compressed image filesystem. '
    echo 'Creating a writable /usr tree on the RAM Disk...'
    cp -srd /KNOPPIX/usr/ /ramdisk
    ln -sf --target-directory=/ /ramdisk/usr
fi
rm /tmp/loadrox.tmp

# Next, download, unpack and install the Slackware 9.1 GDK pixbuf libraries
echo 'Grabbing GDK pixbuf libraries...'
wget -c http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-9.1/slackware/l/gdk-pixbuf-0.22.0-i486-1.tgz
tar -zxvf gdk-pixbuf-0.22.0-i486-1.tgz
sh ./install/doinst.sh

# Next, download, unpack and install the Slackware 9.1 PNG libraries. DSL comes
# with libpng version 2.x and version 3.x or higher is needed by Rox Filer
echo 'Grabbing newer PNG libraries...'
wget -c http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-9.1/slackware/l/libpng-1.2.5-i386-1.tgz
tar -zxvf libpng-1.2.5-i386-1.tgz
sh ./install/doinst.sh

# Next, download, unpack and install the Slackware 8.1 XML2 libraries.
echo 'Grabbing XML2 libraries...'
wget -c http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-8.1/slackware/l/libxml2-2.4.22-i386-1.tgz
tar -zxvf libxml2-2.4.22-i386-1.tgz
sh ./install/doinst.sh

# Finally, download, unpack and install the Generic Linux Rox Filer 1.2 binaries
echo 'Grabbing Rox Filer binaries...'
echo 'Choose HOME install after the download completes'
wget -c http://unc.dl.sourceforge.net/sourceforge/rox/rox-linux-x86-1.2.0.tgz
tar -zxvf rox-linux-x86-1.2.0.tgz
# Before running the install script, add symlinks to the newly installed
# libraries in the main /usr tree
cp -srd /home/damnsmall/usr /ramdisk
sh ./rox-linux-x86-1.2.0/install.sh

# After choosing HOME install, create a symlink in /usr/bin
ln -s /home/root/bin/rox --target-directory=/usr/bin

# Launch ROX-Filer for the first time as user damnsmall
sudo -u damnsmall rox

Posted by Gilbert Ashley on Nov. 16 2003,10:46
Nearly! I tried this on HD installed DSL 0.4.10. There's a problem around line 49 in the loadrox script. This installs everything to a new directory /ramdisk    I didn't get a prompt for the HOME install directory- I guess the ROX install script didn't run. Try again, but this should all install to /usr/local instead of /home/damnsmall/  ... this way it will be accessible to all users. Dillo is installed in /usr/local also and this is a more conventional place to put added software.
ROX-Filer is great! I had been fooling around a bit with getting it to work, as I use it in my Slackware 8.1

Posted by John on Nov. 16 2003,20:24
Cbagger01, nice!  I will p lay with this script some and probably include it in the next release -- if that's okay with you.
Posted by cbagger01 on Nov. 16 2003,20:52
John,

You are welcome to modify the script as you wish and include it in any releases.

There are a number of improvements that I would like to make, some of them involve taking a page from the mozilla script.

For example:

Fixing the script so it will work with the hdinstall version of DSL.
See if I can get the files to install at the /usr or /usr/local location instead of the HOME directory.
Automatically create a desktop icon for the program.
Automatically create MIME type association with various programs so that, for example, if you click on an *.html file, it will automatically open it up in Dillo, etc.
See if I can avoid the libpng download. If coaxed, maybe I can get the program to work with the existing libpng that comes with DSL by default.
Make the script launch rox if the program has already been installed in the past.
Make the script skip the download step if the files already exist in the current directory.
See if I can figure out why the thumbnail viewer function is not working correctly.

Posted by Gilbert Ashley on Nov. 18 2003,12:03
I also tried this script with DSL0.5 running from compressed files on hard disk (not installed). It didn't work that way either, just so you know.
Posted by cbagger01 on Nov. 18 2003,18:44
Gilbert,

Did you notice any error messages when you ran the script from the compressed hard drive image?

Posted by Gilbert Ashley on Nov. 18 2003,21:25
I'll try this again as I'm going to wipe my disk again tomorrow anyway and give you more detail.
Posted by Gilbert Ashley on Nov. 18 2003,22:02
It worked alittle better this time, however it only runs as 'root'  permission denied for user damnsmall. Should this script be run as root or as damnsmall? I forgot to check before I ran the script and probably ran it as root. I nearly always sudo su as soon as I open a terminal. When the script it started with a lot of "cannot change ownership to uid0" errors in the ' install doinstall.sh' routines, then when it finished the ROX install script complained about not finding the CHOICES and AppRun. The first time I ran it as root it didn't find the icons, and it denied permission to run as damnsmall until I copied the Apps directory over to /home/damnsmall.
Tell me if this is supposed to be run as root or user and I will try it again tomorrow on a fresh installed system. ROX is a great little filer.

Posted by cbagger01 on Nov. 19 2003,00:17
The script is supposed to be run under the following conditions:

Script is located in /home/damnsmall. The user to execute the script is 'root'. The user's current working directory is /home/damnsmall. Damn Small Linux was booted from a compressed filesystem (IE: it is still broken for an hdinstall arrangement). Computer system is already succesfully connected to the Internet.




Some of the commands will not work correctly unless the script is running as root.

At the end of the install, the script is supposed to start Rox Filer for the first time under the 'damnsmall' userid. This should result in the automatic creation of the Apps and Choices directories in that user's home directory (/home/damnsmall).

If the script bombs out before it executes the last line, the above-mentioned directory creation will never happen.

Posted by cbagger01 on Nov. 20 2003,08:52
OK, Here's my second attempt at a script.
It no longer refers to the ramdisk during the /usr tree install section, so it should also work for an hd install.

It now automatically installs to the /usr/local/bin directory.

MIME types are now downloaded automatically (rox base package).
MIME associations are automatically created to launch common file types using the appropriate standard DSL applications.  ONE EXCEPTION: I could not find a PostScript viewer inside the DSL live CD. If somebody knows where such a program is located, please tell me.

An "Enhance" desktop icon for Rox Filer is now automatically created.

I could not get the thumbnail viewer to work with *.png type image files, so I no longer download the new libpng libraries. However,the thumbnail viewer still works fine with *.gif, *.jpeg and *.xpm files.

The instructions haven't changed much:

Copy the following script and paste it into a text editor like Nedit or Nano.
Save it to your home directory (/home/damnsmall) as filename 'loadrox'.
From a shell prompt, do a 'chmod 755 loadrox' to make it executable.
Then do a 'sudo su' to become the root user.
Then type './loadrox' to start the script. The install is now completely automatic.
When the script is finished, do an 'exit' to return to your non-root user account.
Type 'rox' at the command line to start it, or you can click on the Enhance desktop icon for Rox Filer.  You may need to do an 'NO ICONS' followed by an 'ICONS' to get the new icon to appear on the screen.

Code Sample
#!/bin/sh
#
# loadrox  -  Downloads and installs the Rox Filer file manager for a
#             Damn Small Linux user.
# Rev 1 11/19/03

#
# First, create a /usr tree on the ramdisk if the user is running from
# the Damn Small Linux Live CD. Why? Because the default /usr tree is
# linked to the read-only CDROM file system and new files are not allowed.
# Lets create a REAL /usr tree structure on the ramdisk and add a bunch of
# Symlinks back to the CDROM for all of the files inside the old /usr tree.
ls -l /usr | grep 'KNOPPIX' > /tmp/loadrox.tmp
if  test -s '/tmp/loadrox.tmp'
then
    echo 'System is running from a Live CD compressed image filesystem. '
    echo 'Creating a writable /usr tree on the RAM Disk...'
    cp -srd /KNOPPIX/usr/ /ramdisk
    ln -sf --target-directory=/ /ramdisk/usr
fi
rm /tmp/loadrox.tmp

# Next, download, unpack and install the Slackware 8.1 GDK pixbuf libraries
echo 'Grabbing GDK pixbuf libraries...'
wget -c http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-8.1/slackware/l/gdk-pixbuf-0.17.0-i386-1.tgz
tar -zxvf gdk-pixbuf-0.17.0-i386-1.tgz
sh ./install/doinst.sh

# Next, download, unpack and install the Slackware 8.1 XML2 libraries.
echo 'Grabbing XML2 libraries...'
wget -c http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-8.1/slackware/l/libxml2-2.4.22-i386-1.tgz
tar -zxvf libxml2-2.4.22-i386-1.tgz
sh ./install/doinst.sh

# Next, download, unpack and install the Generic Linux Rox Base 1.02 package
echo 'Grabbing Rox Base package...'
wget -c http://unc.dl.sourceforge.net/sourceforge/rox/rox-base-1.0.2.tgz
tar -zxvf rox-base-1.0.2.tgz
# Choose Option 1 for an install to /usr/local/share/Choices
echo $'1\nyes\nyes\nyes' | sh ./rox-base-1.0.2/install.sh

# Finally, download and unpack the Generic Linux Rox Filer 1.2 binaries
echo 'Grabbing Rox Filer binaries...'
wget -c http://unc.dl.sourceforge.net/sourceforge/rox/rox-linux-x86-1.2.0.tgz
tar -zxvf rox-linux-x86-1.2.0.tgz

# Before running the install script, move the newly installed libraries into
# the main /usr tree. Then choose Option 1 for an install to /usr/local/bin
cd /usr
cp -r --reply=yes /home/damnsmall/usr ../
cd /home/damnsmall
echo $'1\nyes\nyes\nyes\nyes' | sh ./rox-linux-x86-1.2.0/install.sh

# Create Desktop Icon for Rox-Filer
echo 'table Icon' > /home/damnsmall/.xtdesktop/rox.lnk
echo '  Type: Program' >> /home/damnsmall/.xtdesktop/rox.lnk
echo '  Caption: Rox-Filer' >> /home/damnsmall/.xtdesktop/rox.lnk
echo '  Command: rox' >> /home/damnsmall/.xtdesktop/rox.lnk
echo '  Icon: /usr/local/apps/ROX-Filer/AppIcon.xpm' >> /home/damnsmall/.xtdesktop/rox.lnk
echo '  X: 295' >> /home/damnsmall/.xtdesktop/rox.lnk
echo '  Y: 32' >> /home/damnsmall/.xtdesktop/rox.lnk
echo 'end' >> /home/damnsmall/.xtdesktop/rox.lnk
chown damnsmall:staff /home/damnsmall/.xtdesktop/rox.lnk

# Create MIMI symbolic links for standard Damn Small Linux programs
ln -s /usr/bin/xpdf /usr/local/share/Choices/MIME-types/application_pdf
ln -s /usr/bin/ted-gtk /usr/local/share/Choices/MIME-types/application_rtf
ln -s /usr/bin/xmms /usr/local/share/Choices/MIME-types/audio
ln -s /usr/bin/xzgv /usr/local/share/Choices/MIME-types/image
rm -f /usr/local/share/Choices/MIME-types/text
ln -s /usr/bin/nedit /usr/local/share/Choices/MIME-types/text
ln -s /usr/local/bin/dillo /usr/local/share/Choices/MIME-types/text_html
ln -s /usr/bin/xmms /usr/local/share/Choices/MIME-types/video

# Clean up some junk in the /home/damnsmall directory
# but leave the *.tgz files in case the user wants to save them for
# future use in a quick knoppix restore from a removable storage device
rm -rf /home/damnsmall/usr
rm -rf /home/damnsmall/install
rm -rf /home/damnsmall/rox-base-1.0.2
rm -rf /home/damnsmall/rox-linux-x86-1.2.0

# Now tell the user how to start the Rox Filer
echo 'ROX Filer Installation is complete'
echo 'Please exit from the root shell and try it out.'
echo 'To run it from the command prompt, type this on a blank line:'
echo ''
echo '# rox'
echo ''
echo 'Or if you use Enhance, click on the new Rox Filer desktop icon'
echo 'You may need to toggle between NO ICONS and ICONS to make'
echo 'the new desktop icon appear.'

Posted by zbird on Nov. 20 2003,14:12
cbagger01 you did �a great job.
Worked just perfect with no problems on DSL .5 hard drive install.
Keep up the Good Work!
Thanks

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.