Installation guide

Scratch is a graphical programming environment, particularly useful for introducing young students to the world of programming and animation.

The environment is available both on on the web and as an offline software.

The offline version is not officially available for GNU/Linux clients but this guide allows the creation of an installation file GNU/Linux compatible, using Electron App.

Scratch 3 can be installed through the following script uploaded on GitHub by lyshie:

# Installare Electron

$ cd ~
$ npm install electron@4.1.4 --save-dev
$ ls ~/node_modules/electron/dist

# Estrarre la cartella scratch-desktop

rm -rf /tmp/\$PLUGINSDIR
wget -O /tmp/scratch-desktop.exe 'https://downloads.scratch.mit.edu/desktop/Scratch%20Desktop%20Setup%201.2.1.exe'
7z x -aoa -y /tmp/scratch-desktop.exe -o/tmp/
7z x -aoa -y /tmp/\$PLUGINSDIR/app-32.7z -o/tmp/\$PLUGINSDIR/

# Creare l'Electron app

rm -rf /tmp/scratch-desktop
mkdir -p /tmp/scratch-desktop/resources
cp -rf /tmp/\$PLUGINSDIR/resources/app.asar /tmp/scratch-desktop/resources/
cp -rf /tmp/\$PLUGINSDIR/resources/electron.asar /tmp/scratch-desktop/resources/
cp -rf /tmp/\$PLUGINSDIR/resources/static /tmp/scratch-desktop/resources/
cp -rf ~/node_modules/electron/dist/* /tmp/scratch-desktop/
ln -fsr /tmp/scratch-desktop/electron /tmp/scratch-desktop/scratch-desktop

# Fix permessi

chmod 755 /tmp/scratch-desktop/resources/static
chmod 755 /tmp/scratch-desktop/resources/static/assets

# Scaricare l'icona dell'applicazione

wget -O /tmp/scratch-desktop/resources/Icon.png 'https://scratch.mit.edu/images/download/icon.png'

# Creare il pacchetto deb

cd ~
npm install electron-installer-debian
wget -O /tmp/config-deb.json 'https://gist.githubusercontent.com/lyshie/0c49393076b8b375ca1bd98c28f95fb0/raw/223cc112d99c3bdc1829fc25b19c260856134a82/config-deb.json'
~/node_modules/.bin/electron-installer-debian --config /tmp/config-deb.json

# Installare il file deb

sudo gdebi /tmp/scratch-desktop_1.2.1_amd64.deb

The final result with a light run on a single client with about 150MB RAM is quitepromising. The application works well, looks like a native program, even on a non-performing PC with AMD Atlon 2.

Tests:

A test on a class of students with 12 terminals resulted successful. The 15Gb RAM of the system handled the data stream of a full-load test and students reported a fluent program on the clients.

CPU never had excessive loads, and the test proceeded with no problems.

The test was compared with the load of a software like Firefox and the graphs showthat the resources usage with Firefox is lower, but not significant:

The test was satisfying and such offline usage of the software will be expanded toother schools.