Scrattino3 Desktop is a programming environment based on Scratch 3.0
This step is temporary: eventually, the scratch-desktop branch of the Scratch GUI repository will be merged with
that repository's main development line. For now, though, there's a separate branch:
- Clone the
scratch-guirepository if you haven't already. - Switch to the
scratch-desktopbranch withgit checkout scratch-desktop - Build with
BUILD_MODE=distandSTATIC_PATH=./static:- macOS, WSL, or Cygwin: run
BUILD_MODE=dist;STATIC_PATH=./static npm run buildorBUILD_MODE=dist;STATIC_PATH=./static npm run watch - CMD: run
set BUILD_MODE=dist & STATIC_PATH=./staticonce, thennpm run buildornpm run watchany number of times in the same window. - PowerShell: run
$env:BUILD_MODE = "dist"; $env:STATIC_PATH = "./static"once, thennpm run buildornpm run watchany number of times in the same window.
- macOS, WSL, or Cygwin: run
- Link cloned scratch-gui by
npm linkin the cloned scratch-gui. - Set scratch-desktop to use linked scratch-gui by 'npm link scratch-gui'.
In the scratch-desktop directory, run npm run fetch. Re-run this any time you update scratch-gui or make any
other changes which might affect the media libraries.
npm start
npm run dist
Node that on macOS this will require installing various certificates.
This section is relevant only to members of the Scratch Team.
By default all Windows installers are unsigned. An APPX package for the Microsoft Store shouldn't be signed: it will be signed automatically as part of the store submission process. On the other hand, the non-Store NSIS installer should be signed.
To generate a signed NSIS installer:
- Acquire our latest digital signing certificate and save it on your computer as a
p12file. - Set
WIN_CSC_LINKto the path to your certificate file. For maximum compatibility I use forward slashes.- CMD:
set WIN_CSC_LINK=C:/Users/You/Somewhere/Certificate.p12 - PowerShell:
$env:WIN_CSC_LINK = "C:/Users/You/Somewhere/Certificate.p12"
- CMD:
- Set
WIN_CSC_KEY_PASSWORDto the password string associated with your P12 file.- CMD:
set WIN_CSC_KEY_PASSWORD=superSecret - PowerShell:
$env:WIN_CSC_KEY_PASSWORD = "superSecret"
- CMD:
- Build the NSIS installer only: building the APPX installer will fail if these environment variables are set.
npm run dist -- -w nsis
This will simulate a packaged build without actually packaging it: instead the files will be copied to a subdirectory
of dist.
npm run dist:dir
You can debug the renderer process by opening the Chromium development console. This should be the same keyboard shortcut as Chrome on your platform. This won't work on a packaged build.
You can debug the main process the same way as any Node.js process. I like to use Visual Studio Code with a configuration like this: