Discuss Scratch

AirWay1
Scratcher
100+ posts

Convert sb3 to exe (tutorial)

DaSpewie wrote:

SpeedDesign wrote:

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


Okay, but where does the single EXE file go that is the output?
If you're talking about the setting Target SFX file (EXE file), you can put it anywhere you want.
DaSpewie
Scratcher
3 posts

Convert sb3 to exe (tutorial)

coolgamerkid9 wrote:

SpeedDesign wrote:

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:

I added the project HTML file and added the package.json file and the manifest.json file but it just gets stuck when it finishes loading.



when green flag clicked
forever
say [Eat]
say [Sleep]
say [Code]
say [Repeat]
end
Try to re-write the double-quotes. It helped for me!
DaSpewie
Scratcher
3 posts

Convert sb3 to exe (tutorial)

AirWay1 wrote:

DaSpewie wrote:

SpeedDesign wrote:

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


Okay, but where does the single EXE file go that is the output?
If you're talking about the setting Target SFX file (EXE file), you can put it anywhere you want.

Oh wait I already figured that out
Nobody_to_No-one
Scratcher
21 posts

Convert sb3 to exe (tutorial)

nw.js IS the .exe
rogervaprofe
New to Scratch
2 posts

Convert sb3 to exe (tutorial)

buen día.
yo seguí las instrucciones y voy en ejecutar el NW. “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:”

PERO

cuando abro el juego no están funcionando las variables y no esta haciendo conteo de puntos.
¿que puedo hacer?

Last edited by rogervaprofe (March 9, 2020 14:35:48)

rogervaprofe
New to Scratch
2 posts

Convert sb3 to exe (tutorial)

https://scratch.mit.edu/projects/374340602

rogervaprofe wrote:

buen día.
yo seguí las instrucciones y voy en ejecutar el NW. “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:”

PERO

cuando abro el juego no están funcionando las variables y no esta haciendo conteo de puntos.
¿que puedo hacer?

ESTE ES EL LINK DE MI JUEGO https://scratch.mit.edu/projects/374340602

PAB_10
Scratcher
5 posts

Convert sb3 to exe (tutorial)

it worked a bit
say [thanks] for (2) secs
but it is kinda hard for me

AirWay1
Scratcher
100+ posts

Convert sb3 to exe (tutorial)

PAB_10 wrote:

it worked a bit
say [thanks] for (2) secs
but it is kinda hard for me
Well, you find any easier way to compress these files you tell me.
Nobody_to_No-one
Scratcher
21 posts

Convert sb3 to exe (tutorial)

AirWay1 wrote:

Nobody_to_No-one wrote:

help me
What exactly do you need help with?
i can't open icon
AirWay1
Scratcher
100+ posts

Convert sb3 to exe (tutorial)

Nobody_to_No-one wrote:

AirWay1 wrote:

Nobody_to_No-one wrote:

help me
What exactly do you need help with?
i can't open icon
you mean the .ico file?

Powered by DjangoBB