Discuss Scratch

SpeedDesign
Scratcher
8 posts

Convert sb3 to exe (tutorial)

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

Last edited by SpeedDesign (Aug. 26, 2019 13:25:16)

SimpleScratch
Scratcher
500+ posts

Convert sb3 to exe (tutorial)

I think you mean
https://nwjs.io/
not nw.io
SpeedDesign
Scratcher
8 posts

Convert sb3 to exe (tutorial)

yes thanks you
SimpleScratch
Scratcher
500+ posts

Convert sb3 to exe (tutorial)

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

Last edited by SimpleScratch (Feb. 22, 2019 16:41:57)

SpeedDesign
Scratcher
8 posts

Convert sb3 to exe (tutorial)

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
Scratcher
500+ posts

Convert sb3 to exe (tutorial)

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

Convert sb3 to exe (tutorial)

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

Last edited by SimpleScratch (Feb. 22, 2019 17:34:30)

SimpleScratch
Scratcher
500+ posts

Convert sb3 to exe (tutorial)

Ignore this
Ok getting file access denied message when trying this

Last edited by SimpleScratch (Feb. 22, 2019 17:44:57)

SimpleScratch
Scratcher
500+ posts

Convert sb3 to exe (tutorial)

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

Last edited by SimpleScratch (Feb. 22, 2019 17:46:58)

thewindowsguydesmin
Scratcher
47 posts

Convert sb3 to exe (tutorial)

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.

Daniel Seafood
GoldM-2
Scratcher
2 posts

Convert sb3 to exe (tutorial)

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
Scratcher
1000+ posts

Convert sb3 to exe (tutorial)

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.

Not yet a Knight of the Mu Calculus.
LuckyLucky7
Scratcher
1000+ posts

Convert sb3 to exe (tutorial)

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

I have about 3450 posts, 90 shared projects, 180 total created/followed topics, and 425 followers.

LuckyLucky7
Scratcher
1000+ posts

Convert sb3 to exe (tutorial)

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…

I have about 3450 posts, 90 shared projects, 180 total created/followed topics, and 425 followers.

MrSpaceCarrot
Scratcher
2 posts

Convert sb3 to exe (tutorial)

you said create a file near the begining. how? you just said create a file.
Sheep_maker
Scratcher
1000+ posts

Convert sb3 to exe (tutorial)

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”

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
wowza_studio
Scratcher
36 posts

Convert sb3 to exe (tutorial)

It didn't work and im so mad and frustrated

I'm outta here! Gotta code more!
-wowza_studio
yiayiabibino
Scratcher
4 posts

Convert sb3 to exe (tutorial)

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
Scratcher
500+ posts

Convert sb3 to exe (tutorial)

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

This is my signature.

My signature was eaten by the Scratch Team, they removed it lol
DancingLine
Scratcher
49 posts

Convert sb3 to exe (tutorial)

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 )

Check out some of my Scratch projects on my profile.
Also, check out my website as well.

Stay safe, stay healthy, and as always, be happy.

Powered by DjangoBB