Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scratch Desktop (Scratch 3.0 Offline Editor) on GNU/Linux
{
"src": "/tmp/scratch-desktop/",
"dest": "/tmp/",
"arch": "i386",
"icon": "/tmp/scratch-desktop/resources/Icon.png",
"categories": [
"Education"
]
}
{
"src": "/tmp/scratch-desktop/",
"dest": "/tmp/",
"arch": "amd64",
"icon": "/tmp/scratch-desktop/resources/Icon.png",
"categories": [
"Education"
]
}
{
"src": "/tmp/scratch-desktop/",
"dest": "/tmp/",
"arch": "x86_64",
"icon": "/tmp/scratch-desktop/resources/Icon.png",
"categories": [
"Education"
]
}
#!/bin/sh
######## install electron
sudo apt-get install -yq npm gdebi p7zip-full
cd ~
npm install electron --save-dev
######## extract scratch-desktop
rm -rf /tmp/scratch-desktop
mkdir /tmp/scratch-desktop
wget --max-redirect 5 -c -O /tmp/scratch-desktop.exe 'https://downloads.scratch.mit.edu/desktop/Scratch%20Setup.exe'
7za x -aoa -y /tmp/scratch-desktop.exe -o/tmp/scratch-desktop
######## create electron app
cp -rf ~/node_modules/electron/dist/* /tmp/scratch-desktop/
ln -fsr /tmp/scratch-desktop/electron /tmp/scratch-desktop/scratch-desktop
######## fix permissions
chmod 755 /tmp/scratch-desktop/locales
chmod 755 /tmp/scratch-desktop/swiftshader
chmod 755 /tmp/scratch-desktop/resources
chmod 755 /tmp/scratch-desktop/resources/static
chmod 755 /tmp/scratch-desktop/resources/static/assets
######## get application icon
wget -c -O /tmp/scratch-desktop/resources/Icon.png 'https://scratch.mit.edu/images/download/icon.png'
######## create deb package
cd ~
npm install electron-installer-debian@2.0.1
wget -c -O /tmp/config-deb-i386.json 'https://gist.githubusercontent.com/lyshie/0c49393076b8b375ca1bd98c28f95fb0/raw/9c08b1390cef3df4a0c1622b26875450adb108cd/config-deb-i386.json'
~/node_modules/.bin/electron-installer-debian --config /tmp/config-deb-i386.json
######## install deb file
sudo gdebi /tmp/scratch-desktop_3.12.0_i386.deb
#!/bin/sh
######## install electron
sudo apt-get install -yq npm gdebi p7zip-full
cd ~
## https://github.com/electron/electron/releases/download/v4.2.5/electron-v4.2.5-linux-arm64.zip
## https://github.com/electron/electron/releases/download/v4.2.5/electron-v4.2.5-linux-armv7l.zip
npm install electron --save-dev
######## extract scratch-desktop
rm -rf /tmp/scratch-desktop
mkdir /tmp/scratch-desktop
wget --max-redirect 5 -c -O /tmp/scratch-desktop.exe 'https://downloads.scratch.mit.edu/desktop/Scratch%20Setup.exe'
7za x -aoa -y /tmp/scratch-desktop.exe -o/tmp/scratch-desktop
######## create electron app
cp -rf ~/node_modules/electron/dist/* /tmp/scratch-desktop/
ln -fsr /tmp/scratch-desktop/electron /tmp/scratch-desktop/scratch-desktop
######## fix permissions
chmod 755 /tmp/scratch-desktop/locales
chmod 755 /tmp/scratch-desktop/swiftshader
chmod 755 /tmp/scratch-desktop/resources
chmod 755 /tmp/scratch-desktop/resources/static
chmod 755 /tmp/scratch-desktop/resources/static/assets
######## get application icon
wget -c -O /tmp/scratch-desktop/resources/Icon.png 'https://scratch.mit.edu/images/download/icon.png'
######## create deb package
cd ~
npm install electron-installer-debian
wget -c -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
######## install deb file
sudo gdebi /tmp/scratch-desktop_3.12.0_amd64.deb
#!/bin/sh
######## install electron
sudo apt-get install -yq npm gdebi p7zip-full
cd ~
npm install electron --save-dev
######## extract scratch-desktop
rm -rf /tmp/scratch-desktop
mkdir /tmp/scratch-desktop
wget --max-redirect 5 -c -O /tmp/scratch-desktop.exe 'https://downloads.scratch.mit.edu/desktop/Scratch%20Setup.exe'
7za x -aoa -y /tmp/scratch-desktop.exe -o/tmp/scratch-desktop
######## create electron app
cp -rf ~/node_modules/electron/dist/* /tmp/scratch-desktop/
ln -fsr /tmp/scratch-desktop/electron /tmp/scratch-desktop/scratch-desktop
######## fix permissions
chmod 755 /tmp/scratch-desktop/locales
chmod 755 /tmp/scratch-desktop/swiftshader
chmod 755 /tmp/scratch-desktop/resources
chmod 755 /tmp/scratch-desktop/resources/static
chmod 755 /tmp/scratch-desktop/resources/static/assets
######## get application icon
wget -c -O /tmp/scratch-desktop/resources/Icon.png 'https://scratch.mit.edu/images/download/icon.png'
######## create deb package
cd ~
npm install electron-installer-debian
wget -c -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
######## install deb file
sudo gdebi /tmp/scratch-desktop_3.12.0_amd64.deb
#!/bin/sh
######## install electron
cd ~
#npm install electron@4.1.4 --save-dev
npm install electron --save-dev
######## extract scratch-desktop
rm -rf /tmp/scratch-desktop
mkdir /tmp/scratch-desktop
wget --max-redirect 5 -c -O /tmp/scratch-desktop.exe 'https://downloads.scratch.mit.edu/desktop/Scratch%20Setup.exe'
7za x -aoa -y /tmp/scratch-desktop.exe -o/tmp/scratch-desktop
######## create electron app
cp -rf ~/node_modules/electron/dist/* /tmp/scratch-desktop/
ln -fsr /tmp/scratch-desktop/electron /tmp/scratch-desktop/scratch-desktop
######## fix permissions
chmod 755 /tmp/scratch-desktop/locales
chmod 755 /tmp/scratch-desktop/swiftshader
chmod 755 /tmp/scratch-desktop/resources
chmod 755 /tmp/scratch-desktop/resources/static
chmod 755 /tmp/scratch-desktop/resources/static/assets
######## get application icon
wget -c -O /tmp/scratch-desktop/resources/Icon.png 'https://scratch.mit.edu/images/download/icon.png'
######## create rpm package
sudo dnf install rpm-build
cd ~
npm install electron-installer-redhat
wget -c -O /tmp/config-rpm.json 'https://gist.githubusercontent.com/lyshie/0c49393076b8b375ca1bd98c28f95fb0/raw/223cc112d99c3bdc1829fc25b19c260856134a82/config-rpm.json'
~/node_modules/.bin/electron-installer-redhat --config /tmp/config-rpm.json

Scratch Desktop (Scratch 3.0 Offline Editor) on GNU/Linux

Install electron

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

Extract scratch-desktop

$ rm -rf /tmp/scratch-desktop
$ mkdir /tmp/scratch-desktop
$ wget --max-redirect 5 -c -O /tmp/scratch-desktop.exe 'https://downloads.scratch.mit.edu/desktop/Scratch%20Setup.exe'
$ 7za x -aoa -y /tmp/scratch-desktop.exe -o/tmp/scratch-desktop

Create and launch electron app

$ cp -rf ~/node_modules/electron/dist/* /tmp/scratch-desktop/
$ ln -fsr /tmp/scratch-desktop/electron /tmp/scratch-desktop/scratch-desktop
$ /tmp/scratch-desktop/scratch-desktop

Fix permissions

$ chmod 755 /tmp/scratch-desktop/locales
$ chmod 755 /tmp/scratch-desktop/swiftshader
$ chmod 755 /tmp/scratch-desktop/resources
$ chmod 755 /tmp/scratch-desktop/resources/static
$ chmod 755 /tmp/scratch-desktop/resources/static/assets

Inside the app.asar

$ cd /tmp/scratch-desktop/resources/
$ ~/node_modules/.bin/asar extract app.asar app
$ cat app/package.json

Create RPM package

$ sudo dnf install rpm-build
$ cd ~
$ npm install electron-installer-redhat

$ chmod 755 /tmp/scratch-desktop/locales
$ chmod 755 /tmp/scratch-desktop/swiftshader
$ chmod 755 /tmp/scratch-desktop/resources
$ chmod 755 /tmp/scratch-desktop/resources/static
$ chmod 755 /tmp/scratch-desktop/resources/static/assets
$ ~/node_modules/.bin/electron-installer-redhat /tmp/config-rpm.json

OR

$ ~/node_modules/.bin/electron-installer-redhat --src /tmp/scratch-desktop/ --dest /tmp/ --arch x86_64
$ sudo dnf install /tmp/scratch-desktop-3.10.2-1.x86_64.rpm

Create DEB package

$ sudo apt-get install -yq npm gdebi p7zip-full
$ ls /tmp
create-deb.sh   config-deb.json

$ sh /tmp/create-deb.sh
$ sudo gdebi /tmp/scratch-desktop_3.10.2_amd64.deb
@cymplecy

This comment has been minimized.

Copy link

@cymplecy cymplecy commented Jan 4, 2019

I'm trying to follow your guide using Raspbian on Pi3B+ (I'm SimpleScratch from forums)
Its prob not even possible due to Arm/x86 issues but I do like to chance my arm -oun unintended :)

I'm wondering if there are few missing steps (as well my my GLIB problem)

cp -r /tmp/$PLUGINSDIR/resources/{app.asar,electron.asar,static} resources/

seems to want to copy files from /tmp/$PLUGINSDIR but AFAICT - there is no such folder present - is there a missing step to perform before this?

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented Jan 4, 2019

I'm trying to follow your guide using Raspbian on Pi3B+ (I'm SimpleScratch from forums)
Its prob not even possible due to Arm/x86 issues but I do like to chance my arm -oun unintended :)

I'm wondering if there are few missing steps (as well my my GLIB problem)

cp -r /tmp/$PLUGINSDIR/resources/{app.asar,electron.asar,static} resources/

seems to want to copy files from /tmp/$PLUGINSDIR but AFAICT - there is no such folder present - is there a missing step to perform before this?

  1. $PLUGINSDIR directory is inside the *.exe file (Scratch Desktop Setup 1.2.0.exe)。Use 7z (p7zip-full) to extract it.
    Debian/Ubuntu
    $ sudo apt-get install p7zip-full
    $ 7z x "Scratch Desktop Setup 1.2.0.exe"
    Fedora
    $ sudo dnf install p7zip
    $ 7z x "Scratch Desktop Setup 1.2.0.exe"

  2. GLIBC problem, try to install older version of electron (latest version is v4.0.0).
    $ npm install electron@2.0.16 --save-dev

@cymplecy

This comment has been minimized.

Copy link

@cymplecy cymplecy commented Jan 5, 2019

Thanks for the pointer to install 7z :)
I believe I'm following all the instructions but at this point I don't have a /tmp/$PLUGINSDIR (and I don't see any previous commands to create it)

pi@27Jun18_19Sep18:/tmp/scratch-desktop $ cp -r /tmp/\$PLUGINSDIR/resources/{app.asar,electron.asar,static} resources/
cp: cannot stat '/tmp/$PLUGINSDIR/resources/app.asar': No such file or directory
cp: cannot stat '/tmp/$PLUGINSDIR/resources/electron.asar': No such file or directory
cp: cannot stat '/tmp/$PLUGINSDIR/resources/static': No such file or directory

So I'm wondering if there is a step missing from the instructions

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented Jan 5, 2019

Thanks for the pointer to install 7z :)
I believe I'm following all the instructions but at this point I don't have a /tmp/$PLUGINSDIR (and I don't see any previous commands to create it)

pi@27Jun18_19Sep18:/tmp/scratch-desktop $ cp -r /tmp/\$PLUGINSDIR/resources/{app.asar,electron.asar,static} resources/
cp: cannot stat '/tmp/$PLUGINSDIR/resources/app.asar': No such file or directory
cp: cannot stat '/tmp/$PLUGINSDIR/resources/electron.asar': No such file or directory
cp: cannot stat '/tmp/$PLUGINSDIR/resources/static': No such file or directory

So I'm wondering if there is a step missing from the instructions

$ ls "Scratch Desktop Setup 1.2.0.exe"
Scratch Desktop Setup 1.2.0.exe

$ 7z x "Scratch Desktop Setup 1.2.0.exe"
$ ls
$PLUGINSDIR/
Scratch Desktop Setup 1.2.0.exe
Uninstall Scratch Desktop.exe

$ cd "\$PLUGINSDIR"
$ ls
app-32.7z  nsis7z.dll  nsProcess.dll  SpiderBanner.dll  StdUtils.dll  System.dll  WinShell.dll

$ 7z x app-32.7z
@slyholborn

This comment has been minimized.

Copy link

@slyholborn slyholborn commented Feb 2, 2019

There is a thing missing for this to work : you have to work in the /tmp folder from the beginning. If not,
cp -r /tmp/\$PLUGINSDIR/resources/{app.asar,electron.asar,static} resources/

will return

cp: cannot stat '/tmp/$PLUGINSDIR/resources/app.asar': No such file or directory
cp: cannot stat '/tmp/$PLUGINSDIR/resources/electron.asar': No such file or directory
cp: cannot stat '/tmp/$PLUGINSDIR/resources/static': No such file or directory
@lumanga

This comment has been minimized.

Copy link

@lumanga lumanga commented Feb 10, 2019

Dear SIr, Thanks for your project, but
I'm trying to install on ubuntu 14.04 (MInt 17.3)....
the ELECTRON is not installing!

I received this error,
`linux@mint17 ~ $ npm install electron --save-dev
npm http GET https://registry.npmjs.org/electron
npm http GET https://registry.npmjs.org/electron
npm http GET https://registry.npmjs.org/electron
npm ERR! Error: CERT_UNTRUSTED
npm ERR! at SecurePair. (tls.js:1370:32)
npm ERR! at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR! at doWrite (_stream_writable.js:223:10)
npm ERR! at writeOrBuffer (_stream_writable.js:213:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR! at write (_stream_readable.js:583:24)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 4.4.0-138-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "electron" "--save-dev"
npm ERR! cwd /home/linux
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/linux/npm-debug.log
npm ERR! not ok code 0
`
in both install command:
npm install electron --save-dev
AND ALSO WITH
npm install electron@2.0.16 --save-dev

There is another test to do???
Thanks in advance!

@nathfreder

This comment has been minimized.

@esanya

This comment has been minimized.

Copy link

@esanya esanya commented Mar 25, 2019

I did what you wrote, but I got only a blank window with title "Scratch Desktop"... :(

Could you give me some hint what to check?

@lumanga

This comment has been minimized.

Copy link

@lumanga lumanga commented Mar 26, 2019

@ esanya
I have the same issue!!

I think we need a better, clear and correct/complete guide to how set this on different distro.... I'm using MINT 19.1 (Ubuntu 18.04).
BUT I don't understand why the MIT didn't ported scratch 3 on LINUX!!! really incredible! The MIT oblige users to use WINDOWS !!

@esanya

This comment has been minimized.

Copy link

@esanya esanya commented Mar 29, 2019

Ok, It works now for me. The reason was: the electron.asar file under the resources folder comes also with the downloaded electron distribution, and it is different from the version in the scratch archive.

Scratch works for me if I copy/keep the electron.asar from the dist folder. If I keep the original after the command: $ cp -r ~/node_modules/electron/dist /tmp/scratch-desktop

@Stephen-ODriscoll

This comment has been minimized.

Copy link

@Stephen-ODriscoll Stephen-ODriscoll commented Mar 31, 2019

Thanks for the help everyone, just got it working on Linux Mint 19.1. Made a few changes. First, don't save to /tmp as this folder gets deleted on shutdown. Next you need to install 7Zip (which has been said) and npm. And finally as esanya said keep original electron.asar file. To do this change the command:
cp -r /tmp/$PLUGINSDIR/resources/{app.asar,electron.asar,static} resources/
to:
cp -r /tmp/$PLUGINSDIR/resources/{app.asar,static} resources/

With these changes I used this script on a brand new install of Linux Mint 19.1:

#!/bin/bash
sudo apt-get update
mkdir ~/Scratch
cd ~/Scratch
wget "https://downloads.scratch.mit.edu/desktop/Scratch%20Desktop%20Setup%201.2.0.exe"
sudo apt-get install -y p7zip-full
7z x Scratch\ Desktop\ Setup\ 1.2.0.exe
cd $PLUGINSDIR/
7z x app-32.7z
cd resources/
file app.asar electron.asar static/
cd ~
sudo apt install -y npm
npm install electron --save-dev
ls ~/node_modules/electron/dist
cd ~/Scratch
cp -r ~/node_modules/electron/dist scratch-desktop
cd scratch-desktop
cp -r ~/Scratch/$PLUGINSDIR/resources/{app.asar,static} resources/
ln -s electron scratch-desktop
./scratch-desktop

@ramcq

This comment has been minimized.

Copy link

@ramcq ramcq commented Apr 10, 2019

I have made an experimental Flatpak manifest at https://gist.github.com/ramcq/b51e70037aa009860d062d68a92cca53

With this file saved as edu.mit.scratch.ScratchDesktop.json you can build and install a Flatpak like this:
flatpak-builder --user --install-deps-from=flathub --force-clean --ccache --repo=repo --install build edu.mit.scratch.ScratchDesktop.json

Then run with:
flatpak run edu.mit.scratch.ScratchDesktop

It doesn't have any desktop file / icon / metadata but that's not too hard to add. If I can figure out the license (ie, is the app.asar redistributable) we could submit to https://flathub.org.

@lumanga

This comment has been minimized.

Copy link

@lumanga lumanga commented Apr 11, 2019

@ramcq
GRET Job man,
thank you very much....

  1. Is it suitable for MINT 19.1 (Ubuntu 18.04.*) ???
  2. please PUSH to add in https://flathub.org official repos, It will help to diffuse "linux"!
  3. For "standard users" I'm asking if will be possible to make the .APPIMAGE file, that can be launched without installing anything ??
@redshaderobotics

This comment has been minimized.

@redshaderobotics

This comment has been minimized.

Copy link

@redshaderobotics redshaderobotics commented Apr 13, 2019

Thanks @lyshie for your work.
i have made a deb for amd64 which is working very well.
your work is very informative.

@redshaderobotics

This comment has been minimized.

Copy link

@redshaderobotics redshaderobotics commented Apr 13, 2019

thanks @Stephen-ODriscoll for your mention of errors in the script

@mvitalpa

This comment has been minimized.

Copy link

@mvitalpa mvitalpa commented Apr 27, 2019

Error, package.json not found.

What happens? it is in lubuntu 18 LTS

/home/iesdonana2
└── electron-installer-redhat@1.0.1

npm WARN enoent ENOENT: no such file or directory, open '/home/iesdonana2/package.json'
npm WARN iesdonana2 No description
npm WARN iesdonana2 No repository field.
npm WARN iesdonana2 No README data
npm WARN iesdonana2 No license field.
npm ERR! Linux 4.18.0-18-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "electron-installer-debian"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! path /home/iesdonana2/node_modules/electron-installer-debian
npm ERR! code ENOTEMPTY
npm ERR! errno -39
npm ERR! syscall rename

npm ERR! ENOTEMPTY: directory not empty, rename '/home/iesdonana2/node_modules/electron-installer-debian' -> '/home/iesdonana2/node_modules/.electron-installer-debian.DELETE'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /home/iesdonana2/npm-debug.log

@lumanga

This comment has been minimized.

Copy link

@lumanga lumanga commented Apr 28, 2019

Hi All,
I think that really something is changed.

I'm installing on the same operation system, installed with the same systemback .ISO image of my Mint19.1 MATE 64bit used in all my PC/notebook, the scratch 3, in exactly the same way, with the same script used in other computer...

Finished, the window with Scratch 3 start but is BLANK and the menu FILE has only QUIT command.

With the script above at top of this thread: create-deb.sh

The .Deb file is created, I installed it, but the Scratch3 windows is still completely blank!!
On View/Toggle developed tools/, on the right a panel appear and in CONSOLE there is:
x Uncaught ReferenceError: require is not defined at index.html:8
x Uncaught ReferenceError: module is not defined at renderer.js:1
! /usr/lib/scratch-desktop/resources/electron.asar/renderer/security-warnings.js:170 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.

Thanks in advance!

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented Apr 29, 2019

Hi @mvitalpa,

Try npm init -f to generate package.json or you can ignore the warning messages.
Here is the screenshot of my Ubuntu 18.04.2 LTS.
Scratch Desktop

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented Apr 29, 2019

Hi @lumanga,

The latest stable version of Electron is v5.0.0 (April 23, 2019),
it contains some security enhancements and fixes.
https://electronjs.org/releases/stable
Electron Security Warning

If you don't mind security issues, you can install an older version v4.1.4.
npm install electron@4.1.4 --save-dev

@lumanga

This comment has been minimized.

Copy link

@lumanga lumanga commented Apr 29, 2019

@lyshie
so these "some security enhancements and fixes." broken our Scratch3???

I done this test:
I have copied the folder "/home/USER/Scratch/scratch-desktop" from my Mint19.1 where Scratch3 works, installed few weeks ago following the guide above...

I have installed this "Scratch folder" on the OS where the new installation fails, without installing npm or electron, and scratch3 WORKS!!!!
How is it possible? there is some contrindication doing this???
Has the Scratch/scratch-desktop, all the necessary to work??
Thank you very much for you job!

@joancipria

This comment has been minimized.

Copy link

@joancipria joancipria commented May 1, 2019

@redshaderobotics

This comment has been minimized.

Copy link

@redshaderobotics redshaderobotics commented May 1, 2019

@lumanga @mvitalpa @esanya @joancipria
Go through my build of deb and rpm at https://github.com/redshaderobotics/scratch3.0-linux/releases/tag/1.2.1
I did above using the instruction provided by @lyshie

@redshaderobotics

This comment has been minimized.

Copy link

@redshaderobotics redshaderobotics commented May 1, 2019

@joancipria
I downloaded your deb file and installed in my ubunut 18.04.2 machine. Working fine.
but i could not able to close the app. the app is not responding for closing operation.
i am closing the app with process id in ubuntu.

@Argus-Kan

This comment has been minimized.

Copy link

@Argus-Kan Argus-Kan commented May 8, 2019

@joancipria @redshaderobotics Thanks guys, I've been trying to install scratch 3.0 on Linux for so long but wasn't able to do so. Although I do wish I was able to make the deb myself (which I couldn't figure out how to do) but I am fine with this too. Thanks guy, I really appreciate it.

@scollovati

This comment has been minimized.

Copy link

@scollovati scollovati commented Jun 24, 2019

Thanks for this amazing script.
Do you think that it can be upgraded to the last Scratch offline version (3.3.0 as of now)?

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented Jun 24, 2019

@scollovati
This script has been updated to fetch latest version (v3.3.0).
Use 7za to extract SFX file instead of 7z.

@omartek

This comment has been minimized.

Copy link

@omartek omartek commented Jul 25, 2019

There is a typing error around line 10 in first two .sh scripts

mkdir /tmp/scratxch-desktop

thanks for the good job
omar

@omartek

This comment has been minimized.

Copy link

@omartek omartek commented Jul 25, 2019

I've created .deb but, after installation, folders inside /usr/lib/scratch-desktop/ (they are three -locales-resources-swiftshader) are accessible exclusively to root, so when i launch scratch there is an error (can't find /resources/electron.asar/browser/init.js).
Everything work if i change permission to the folder.

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented Jul 25, 2019

I've created .deb but, after installation, folders inside /usr/lib/scratch-desktop/ (they are three -locales-resources-swiftshader) are accessible exclusively to root, so when i launch scratch there is an error (can't find /resources/electron.asar/browser/init.js).
Everything work if i change permission to the folder.

Thanks for your sharing. This issue is fixed.

@omartek

This comment has been minimized.

Copy link

@omartek omartek commented Jul 25, 2019

I've made .deb for raspberryPI 3. Great, it works! I had to change config-deb.json of course ("arch": "armhf").
bit.ly/scratch30armhf
Thanks a lot.

@Farshidmi

This comment has been minimized.

Copy link

@Farshidmi Farshidmi commented Sep 11, 2019

Hi ,
Can I use this for i386 (32 bit) Linux Mint ? Which command must be changed?
because I have an old PC :)

Regards

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented Sep 11, 2019

Hi ,
Can I use this for i386 (32 bit) Linux Mint ? Which command must be changed?
because I have an old PC :)

Regards

@Farshidmi
I add a script create-deb-i386.sh to create i386 DEB package.
Here is the screenshot of Linux Mint 19.1 (i686).
Scratch Desktop

@Farshidmi

This comment has been minimized.

Copy link

@Farshidmi Farshidmi commented Sep 11, 2019

Hi ,
Can I use this for i386 (32 bit) Linux Mint ? Which command must be changed?
because I have an old PC :)
Regards

@Farshidmi
I add a script create-deb-i386.sh to create i386 DEB package.
Here is the screenshot of Linux Mint 19.1 (i686).
Scratch Desktop

Thanks . It works :-)
I think url for json is incorrect.
Best

@lumanga

This comment has been minimized.

Copy link

@lumanga lumanga commented Oct 5, 2019

@lyshie
Dear lyshie, thanks again for your job!
Linux Mint 19.2 MATE 64bit, .DEB created with success. I can install the Scratch program but the ICON to launch Scratch in MENU/EDUCATIONA section (or in other part of menu) IS NOT PRESENT!
My Mint is in ITALIAN LANGUAGE and the EDUCATION in reality, is "ISTRUZIONE" called. Have I to change the " config-deb.json " file

@Lewiscowles1986

This comment has been minimized.

Copy link

@Lewiscowles1986 Lewiscowles1986 commented Dec 25, 2019

  • Not all dependencies are documented (asar).
  • Some of the steps are duplicated in the shell scripts.
  • It may build an amd64 (not i386) version on 64-bit computers, same with ARM.

While admirable, I think this might need some work

apt install -yq will silence output and answer yes to questions

All my built packages turned out to be the same size (which is why I'm sure it's not built real i386 or armv7l)

All this said, I was able to alter a few instructions to get this to build for several machines, so thank you.

There must be a better way? I'll follow the instructions again on an i386 vm and a raspberry pi so that I can keep a local repo for my local LUG which runs coder dojo like events

@efa

This comment has been minimized.

Copy link

@efa efa commented Dec 27, 2019

the last step for 64bit deb create a file named:
/tmp/scratch-desktop_1.2.1_amd64.deb
instead of
/tmp/scratch-desktop_3.6.0_amd64.deb

@efa

This comment has been minimized.

Copy link

@efa efa commented Dec 28, 2019

the command:
npm install electron@4.1.4 --save-dev
show the following WARN:
npm WARN enoent ENOENT: no such file or directory, open '/home/efa/package.json'
npm WARN efa No description
npm WARN efa No repository field.
npm WARN efa No README data
npm WARN efa No license field.
hope do not impact on functionality

@efa

This comment has been minimized.

Copy link

@efa efa commented Dec 28, 2019

I have two PC, both with 4 GB of RAM and a 64 bit OS. One has Ubuntu 18.04 and the other has a Debian 9.
On Debian start and work well, on Ubuntu I got the cyan windows with Starting Scratch, then it become a white window forever, and on the console I got an OOM error:
`
efa@02cor2130:~$ scratch-desktop

[8118:1228/163027.861206:FATAL:memory_linux.cc(36)] Out of memory.
`
I think the free memory is enought:
efa@02cor2130:~/dLoad/scratch$ cat /proc/meminfo | grep ^Me
MemTotal: 3839840 kB
MemFree: 1671344 kB
MemAvailable: 2361824 kB
How much is the needed memory by Scratch 3.6 ?

@efa

This comment has been minimized.

Copy link

@efa efa commented Dec 30, 2019

solved, it was the overcommit. Probably Scratch 3.6 is one of the bad application that try to allocate much more memory that it use. If the overcommit is enabled it work, if overcommit is disabled for predictability it fail with OOM. Scratch 1.4 was not that bad and run also with overcommit disabled

@Lewiscowles1986

This comment has been minimized.

Copy link

@Lewiscowles1986 Lewiscowles1986 commented Dec 31, 2019

Loading a saved scratch workspace seems to lock the UI

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented Mar 17, 2020

Screenshot_20200317_221006

@Lewiscowles1986

This comment has been minimized.

Copy link

@Lewiscowles1986 Lewiscowles1986 commented Mar 18, 2020

Hi @lyshie, I'm unsure what that is supposed to show. Of course the file picker works, it's the loading, after accepting which I notice is blank here

I can try a new build this week, see if that fixes

@Razzo1987

This comment has been minimized.

Copy link

@Razzo1987 Razzo1987 commented May 2, 2020

There is an error in the scratch-desktop.md
when you wrote ./scratch-desktop/scratch-desktop i think it is /tmp/scratch-desktop/scratch-desktop

@lyshie

This comment has been minimized.

Copy link
Owner Author

@lyshie lyshie commented May 3, 2020

There is an error in the scratch-desktop.md
when you wrote ./scratch-desktop/scratch-desktop i think it is /tmp/scratch-desktop/scratch-desktop

Thanks for your advice.

@lesar

This comment has been minimized.

Copy link

@lesar lesar commented Jun 15, 2020

SOLVED

Mine arch is:
uname -m

aarch64

and I have some problem installing it (scratch)

I put aarch64 in /tmp/config-deb.json then make the package and no errors are show.

but when I try to install:

Wrong architecture 'aarch64' -- Run dpkg --add-architecture to add it and update afterwards

so I do:
sudo dpkg --add-architecture aarch64

and it show an error

pkg-config-dpkghook: Avviso: Architecture aarch64 not defined in architecture tables, ignored

can anyone help me?
best regards.
P.S. sudo dpkg --add-architecture aarch64 is a bad idea: I remove it

I solved by myself.
I put in /tmp/config-deb.json arm64 instead aarch64
remove all file build on previous try
download the last exe
and all go right

@HackEduca

This comment has been minimized.

Copy link

@HackEduca HackEduca commented Sep 23, 2020

Hello, I am receiving the following error:

Creating package (this may take a while) { [Error: ENOENT: no such file or directory, open '/tmp/scratch-desktop/version'] errno: -2, code: 'ENOENT', syscall: 'open', path: '/tmp/scratch-desktop/version' } 'Error: ENOENT: no such file or directory, open '/tmp/scratch-desktop/version'' gdebi error, file not found: /tmp/scratch-desktop_3.12.0_amd64.deb

Appreciate any help on this regards.

xxx-VirtualBox:~$ uname -a Linux sobreira-VirtualBox 5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Thanks!

@Mobslayer92

This comment has been minimized.

Copy link

@Mobslayer92 Mobslayer92 commented Oct 7, 2020

When running "/tmp/scratch-desktop/scratch-desktop" I get the following error: [17853:1007/172314.266423:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /tmp/scratch-desktop/chrome-sandbox is owned by root and has mode 4755.
Trace/breakpoint trap

Edit
Worked when I used the create-deb-1386 after changing "sudo gdebi /tmp/scratch-desktop_3.12.0_i386.deb" with "sudo gdebi /tmp/scratch-desktop_3.15.0_i386.deb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.