$ cd ~
$ npm install electron --save-dev
$ ls ~/node_modules/electron/dist
$ 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
$ 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
$ 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
$ cd /tmp/scratch-desktop/resources/
$ ~/node_modules/.bin/asar extract app.asar app
$ cat app/package.json
$ 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
$ 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
Dear Sirs,
I have followed the procedure and I obtained a working .deb installation file using the latest verison "Scratch-desktop v3.26.0"
After installed into Linux Mint 20.3 MATE 64bit, I have the ""SCRATCH IS LOADING" screen..
Then I try to modify the main.js
I had problem installing via terminal, of "npm install asar", so I used SNAP to install asar...
sudo rm /etc/apt/preferences.d/nosnap.pref && sudo apt update && sudo snap install asar --classic
after that,
cd /lib/scratch-desktop/resources sudo asar extract app.asar modif cd modif sudo nano main.js (and into the line "nodeIntegration: true" I changed it nto: "true,\n contextIsolation: false\n") cd .. sudo asar pack modif app.asar
Now If I launch Scratch, NO screen appear, anche the program close without showimg the Scratch windows (this is differemt from the starting issue with freezing screen "SCRATCH IS LOADING" )
Try to start Scratch via terminal, I obtain:
linux@Mint:/lib/scratch-desktop/resources$ /usr/lib/scratch-desktop/electron "/usr/lib/scratch-desktop/Scratch-desktop"
A JavaScript error occurred in the main process Uncaught Exception: SyntaxError: Unexpected identifier at Object.call (/usr/lib/scratch-desktop/resources/app.asar/main.js:1323:181) at e (/usr/lib/scratch-desktop/resources/app.asar/webpack:/webpack/bootstrap:25:22) at Object.call (/usr/lib/scratch-desktop/resources/app.asar/main.js:1328:97) at __webpack_require__ (/usr/lib/scratch-desktop/resources/app.asar/webpack:/webpack/bootstrap:25:22) at module.exports../node_modules/ajv/lib/ajv.js (/usr/lib/scratch-desktop/resources/app.asar/webpack:/webpack/bootstrap:96:10) at Object.<anonymous> (/usr/lib/scratch-desktop/resources/app.asar/main.js:1:1052) at Module._compile (node:internal/modules/cjs/loader:1116:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10) at Module.load (node:internal/modules/cjs/loader:988:32) at Module._load (node:internal/modules/cjs/loader:829:12) libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) [2870:0122/203824.204885:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) [2886:0122/203824.280940:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
Seems that the ASAR procedure to modify the file main.js has broke someting...Is it possible to solve this problem?
Many thanks in advance for your job!