SpeedDesign

sb3 to exe tutorial

  • At First you'll need to publish project on Scratch website, then go on https://sheeptester.github.io/words-go-here/scratch3-htmlifier/ and convert is project to an HTML file. When the action will be finisheh the html will be download automatically named project.HTML. Then keep this file somewhere on your computer.
  • After this, go on nwjs.io and download the normal version, actually v0.36.2.
  • When it is downloaded, extract the zip file on your computer.
  • Then create a file called package.json and place it in the extracted folder.
  • Open this file with notepad (or any text editor) and paste this:

{
“name”: “Your app or game name”,
“main”: “project.html”,
“icons”: { “16”: “icon.png”}
}
If it doesnt't work, Try this link: Link

  • In the package.json file, change the name
  • In the extracted folder, add your app icon and name it icon.png
  • This you don’t have an icon for your project, if not delete the icon line of the package.json, and the last comma after project.html”.
  • Copy the project.html file downloaded from the sb3 htmlifier, and paste this file in the folder where you created package.json.
  • Open nw.exe, and if you did everything correctly, you will have your scratch project, in an executable. The folder must look like that now:





But you still have many files, and the executable don’t have an icon and name, and you didn’t define if the users must be an administrator to run the project, if there can be only one instance, etc. Well, you can change all this and join all in one file with an app called makesfx.

To use it, go on http://74.cz/en/make-sfx/index.php go to the bottom of the page and download makesfx.exe. It will NOT require any installation. Then open it, you will have a window like that:

You can fill up everything, and then click on Make SFX. Then it will build an executable. Here is all what you well need explained:
In source folder and target file:
- Source folder (It may contains subfolders) : The folder that contains nw.exe, package.json and all the others files
- Target SFX file (EXE file) : Where the executable file will be created
- Target SFX file icon : The icon of your app.
In extraction folder:
- I recommend you to put temporary folder
In extraction mode:
- Put Extract files into specified folder and launch executable file
- Executable file that will run after extraction: Go in the nw.exe and package.json folder and select nw.exe
- Put nothing in command line parameters
- Working directory: Put Extraction folder, where executable file is located.
- How to delete extracted files: Put Delete extracted files immediately when SFX has finished executing or if you temporary folder in extraction folder, you can check do not delete extracted files (you can choose, but when I do it I put Delete extracted files immediately when SFX has finished executing.)
In Advanced options:
- One instance checking: Choose what you want
- Silent extraction mode: As you want but I recommend unchecked
- Self-destructing mode: Unchecked
- UAC auto-elevation: Choose as you want (if you are not admin, I recommend run SFX with the Highest available permission)
- Overwrite mode during extraction: If you put temporary folder in extraction folder, use automatically skip extracting of all existing files. If not for security I recommend to use Prompt user.
After, enjoy!

Scratchnapped by Griffpatch in a executable



troubleshooting
1.
Failed to load extension :
Manifest is not valid JSON. Line: 2, column; 3,
Dictionary keys must be quoted
Try to replace the manifest.json file with the content of this link : Link

2.
Blocked on the nw.js loading screen
1. Make sure you have a project.html file in the nw.js folder
2. Make sure you have a manifest.json file in the nw.js folder
3. Try to convert your project to an html file here : https://sheeptester.github.io/words-go-here/scratch3-htmlifier/
You have maybe converted another project.
4. Try to do everything again

SimpleScratch

I think you mean
https://nwjs.io/
not nw.io

SpeedDesign

yes thanks you

SimpleScratch

Then, open nw.exe, and if you did everything correctly, you will have your scratch project, in an executable.
Didn't work for me - just got a program that looks like this

SpeedDesign

Did you put the right project on https://sheeptester.github.io/words-go-here/scratch3-htmlifier/ ?
And is it the same on project.html?

SimpleScratch

Silly me
I cut one digit off when coping/pasting the project number
88755663
instead of
288755663
#LOL

SimpleScratch

open nw.exe, and if you did everything correctly, you will have your scratch project, in an executable
All OK at this point now


Another little typo
you have an extra , at the end of this url
http://74.cz/en/make-sfx/index.php so link doesn't work

SimpleScratch

Ignore this
Ok getting file access denied message when trying this

SimpleScratch

I have a working .exe of Pong
I modified original Scratch 1.4 version so that clicking on ball does the same as original On Green Flag
https://scratch.mit.edu/projects/288755663

Well done @SpeedDesign and @Sheep_maker and all the people that wrote the other programs :-)

Used these settings on my Win10 system

thewindowsguydesmin

SpeedDesign wrote:

Here is a tutorial to convert sb3 to exe:
At First you'll need to publish project on Scratch website, then go on https://sheeptester.github.io/words-go-here/scratch3-htmlifier/ and convert is project to an HTML file. When the action will be finisheh the html will be download automatically named project.HTML. Then keep this file somewhere on your computer.
After this, go on nwjs.io and download the normal version, actually v0.36.2. When it is downloaded, extract the zip file on your computer.
Then create a file called package.json and place it in the extracted folder.
Open this file with notepad (or any text editor) and paste this:
{
“name”: “Your app or game name”,
“main”: “project.html”,
“icons”: { “16”: “icon.png”}
}
Change the app name and add an icon.png in the folder, and then take the project.html file, downloaded from the sb3 htmlifier, and move this file to the same folder than package.json and nw.exe. You need to have an png icon, if not delete the icon line of the package.json, and the last comma after project.html”. Then, open nw.exe, and if you did everything correctly, you will have your scratch project, in an executable. The folder must look like that now:



But you still have many files, and the executable don’t have an icon and name, and you didn’t define if the users must be an administrator to run the project, if there can be only one instance, etc. Well, you can change all this and join all in one file with an app called makesfx. To use it, go on http://74.cz/en/make-sfx/index.php, go to the bottom of the page and download makesfx.exe. It will NOT require any installation. Then open it, you will have a window like that:

You can fill up everything, and then click on Make SFX. Then it will build an executable. Here is all what you well need explained:
In source folder and target file:
- Source folder (It may contains subfolders) : The folder that contains nw.exe, package.json and all the others files
- Target SFX file (EXE file) : Where the executable file will be created
- Target SFX file icon : The icon of your app.
In extraction folder:
- I recommend you to put temporary folder
In extraction mode:
- Put Extract files into specified folder and launch executable file
- Executable file that will run after extraction: Go in the nw.exe and package.json folder and select nw.exe
- Put nothing in command line parameters
- Working directory: Put Extraction folder, where executable file is located.
- How to delete extracted files: Put Delete extracted files immediately when SFX has finished executing or if you temporary folder in extraction folder, you can check do not delete extracted files (you can choose, but when I do it I put Delete extracted files immediately when SFX has finished executing.)
In Advanced options:
- One instance checking: Choose what you want
- Silent extraction mode: As you want but I recommend unchecked
- Self-destructing mode: Unchecked
- UAC auto-elevation: Choose as you want (if you are not admin, I recommend run SFX with the Highest available permission)
- Overwrite mode during extraction: If you put temporary folder in extraction folder, use automatically skip extracting of all existing files. If not for security I recommend to use Prompt user.
After, enjoy!

Scratchnapped by Griffpatch in a executable
But this is a .exe converter you used.

GoldM-2

I get a message saying
Failed to load extension from:
C:\Users\goldm\AppData\Local\Temp\~sfx001D5868B\nwjs-v0.37.2-win-x64.
Manifest is not valid JSON. Line: 2, column; 3,
Dictionary keys must be quoted.
Everything in package.json that's supposed to be quoted is in quotes, so I'm not sure what the issue is. I'll try it with a different project and see what happens.

Jonathan50

GoldM-2 wrote:

I get a message saying
Failed to load extension from:
C:\Users\goldm\AppData\Local\Temp\~sfx001D5868B\nwjs-v0.37.2-win-x64.
Manifest is not valid JSON. Line: 2, column; 3,
Dictionary keys must be quoted.
Everything in package.json that's supposed to be quoted is in quotes, so I'm not sure what the issue is. I'll try it with a different project and see what happens.
Did you copy and paste from the original post? The forums convert ordinary double quotation marks to left and right ones (unless you use [code]) so you'll need to fix that.

LuckyLucky7

Cool tutorial. It's a good thing that this actually works(instead of all the other outdated tutorials).

LuckyLucky7

I tried using this tutorial to make the whole Scratch website into an application, and it worked! Maybe I will do something like this for mods…

MrSpaceCarrot

you said create a file near the begining. how? you just said create a file.

Sheep_maker

MrSpaceCarrot wrote:

you said create a file near the begining. how? you just said create a file.
You can use a text editor to create a new file, then save it as “package.json”

wowza_studio

It didn't work and im so mad and frustrated

yiayiabibino

Hi, I thank you so much. This really works!
For your information: I had to replace the double quotes pasted from your code with double quotes in text editor.
yiayiabibino

GerekRulesGwof

@Sheep_maker your so amazing! Now I can play HTML Scratch games offline! Your the best!

DancingLine

Thanks for the tutorial, @SpeedDesign! It took a while to load all of the music, images, etc. But it works like a charm! I just use Visual Studio Code to make the “package.json” file. Anyways, here's what it looks like:

https://i.imgur.com/xywYEbw.png (sorry but Scratch didn't want to show the image in Scratch )