1

Using the install script for packet tracer from here backs up the data in my home directory for some reason, before the install starts. Does anyone know why? Here's the script - paste.ubuntu.com/10975482/
Update: here are some new outputs from the terminal

Installing into /home/eric/pt cp: cannot stat ‘./Downloads/Windows10_InsiderPreview_x64_EN-US_10074(1).iso.part’: No such file or directory cp: cannot copy a directory, ‘./pt’, into itself, ‘/home/eric/pt/pt’
I told it to install to `/home/username/pt It took my home contents and copied them into that location... why?
It didn't even install. The packettracer file is empty Image from backup

Update: 'Installed' using This guide

sudo sh PacketTracer533_i386_installer-deb.bin
sudo ./PacketTracer533_i386_installer-deb.bin

But I cannot launch, as the command packettracer closes without any error messages, as does packettracer --help and packettracer -h Update: installing libgtk2.0-0:i386 fixed the GUI launch, but not the terminal one.

3
  • This sums up what is wrong with Windows... you install random downloaded software from un unknown source and run it. The advantage we have is that software tends to be source code so readable whereas Windows has binaries. I would advice nobody to download this and run it or if you do read the source code. This software is going to do stupid things if not installed in the suggested default. – Rinzwind May 3 '15 at 18:54
  • Anyone who has a Cisco login and can post on their forums feel free to ask them what happens if you insert / as an installation path... – Rinzwind May 3 '15 at 19:21
  • Why would I install it to my root dir? I never suggested that I would. – Hellreaver May 3 '15 at 20:38
2
if [ -e $IDIR ]; then
    read -p "It appears that Packet Tracer is already installed.  Do you wish to replace it? [Yn] " NEEDREPLACE
    if [ "$NEEDREPLACE" = "y" ] || [ "$NEEDREPLACE" = "Y" ] || [ -z $NEEDREPLACE ]; then
        sudo rm -rf $IDIR
    else
        echo "Program Terminated"; exit 0
    fi
fi

That rm spells trouble... if you install the software in / your system is gone, if you install it in /home/$USER/ you /home/$USER/ is gone. Reason? There is NO sanity check here:

echo "You have accepted the terms to the EULA. Congratulations. Packet Tracer will now be installed."
    read -p "Enter location to install Cisco Packet Tracer or press enter for default [/opt/pt]: " IDIR

if [ -z $IDIR ]; then
    IDIR="/opt/pt"
fi

IDIR should always add /pt to the input if the user does not insert it themself. They did that for the default, they did not do that for user input. Very very bad.

Now from here all things end up in a mess. The reason you see you home being copied is because you did not add the /pt/ part in the input and those idiots did not add it themself.

if mkdir $IDIR > /dev/null 2>&1; then
    if cp -r $SDIR/* $IDIR; then
        echo Copied all files successfully to $IDIR
    fi

Here they copy SDIR to IDIR. SDIR is defined as

DIR=`dirname $_`

dirname: "will retrieve the directory-path name from a pathname ignoring any trailing slashes". That means the current dir and then 1 up. So they assume here you inserted /home/$USER/pt/ and then want to make a copy of that. Again they forgot to check if what is happening here is sane: this spells trouble since it goes 1 directory back and copies that over. Bad.


All should be OK if you pick the default (/opt/pt/). Mind that the FHS states 3rd party software should be installed in /opt/ and if you stick to that it'll go as intended. But the creator of this should receive a warning: this is a badly written script.

2
  • Thank you very much. When installed to /opt/pt, it copies my home folder contents to the location. Why? Also, do you have any idea why an official port from Cisco would be so badly written? – Hellreaver May 3 '15 at 20:37
  • 1
    I can not see that from the script unless you invoke it from your home. And you need to ask Cisco that. I have seen worse software from official sources ;-) – Rinzwind May 3 '15 at 20:38
2

The script shouldn't be run from your home folder. It should be run from a folder containing only the packettracer assets.

See

SDIR=`dirname $_`
...
cp -r $SDIR $IDIR

And, I'm totally not installing a binary deb from mediafire. Can't help you with that part.

2
  • It doesn't matter. When installing into any folder, even the one that came with it, it deletes the contents and backs up my home folder. – Hellreaver May 3 '15 at 18:11
  • Source not destination. Please read. – RobotHumans May 3 '15 at 18:24
1

I extracted the contents to a folder, then changed my pwd to that folder. I ran the install script by typing ./install at the prompt and it copied only the contents within the pt folder. It did not copy my Desktop or Home Directory contents. Reboot computer and type packettracer from a command line. Done!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.