Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,635
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
Using ENIGMA VIRTUAL BOX are
  • not easy
  • performance issue

This method is extremely easy and keep performance
  • keep speed game
  • memory cache

related to: http://docs.nwjs.io/en/latest/For Users/Package and Distribute/#package-option-2-zip-file
Nw.js Standard file packaging

First, copy the latest version of Nw.js folder and give it a name appropriately.
ex: on desktop name it "distribution"



  1. *deploy the project rmmv [distributed]
  2. * Merge Compress the package.json and www folder [.zip] from project
  3. * rename zip to package.nw
  4. *move package.nw in your distribution folder
  5. * Combine and merge the zip [package.nw] and [nw.exe] to create a new executable [game.exe] with your terminal: "cmd or powershell"
  6. Edit your executable [game.exe] with resource hacker for hack your icons, informations, copyright ....
  7. delete unnecessary files: [package.nw] [nw.exe]

cmd
Code:
cd C:\Users\user\Desktop\distribution
copy /b nw.exe+package.nw games.exe

powerShell
Code:
cd C:\Users\user\Desktop\distribution
New-Item -ItemType file "game3.exe" -force
$file1 = Get-Content "package.nw"
$file2 = Get-Content "nw.exe"
Add-Content "game3.exe" $file1
Add-Content "game3.exe" $file2



enjoy

i made here screen for help

1LAsGfnE_o.png


b85hDj2l_o.png


80sVAsII_o.png

Step video, if you need.
 
Last edited:

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Using ENIGMA VIRTUAL BOX are
  • not easy;
  • performance issue;
  • easy to decompile with a script.

This method is extremely easy.
  • keep speed game
  • hard to decrypted


Nw.js Standard file packaging

First, copy the latest version of Nw.js folder and give it a name appropriately.
ex: on desktop name it "distribution"


  1. *deploy the project rmmv [distributed]
  2. * Merge Compress the package.json and www folder [.zip] from project
  3. * rename zip to package.nw
  4. *move package.nw in your distribution folder
  5. * Combine and merge the zip [package.nw] and [nw.exe] to create a new executable [game.exe] with your terminal: "cmd or powershell"
  6. Edit your executable [game.exe] with resource hacker for hack your icons, informations, copyright ....
  7. delete unnecessary files: [package.nw] [nw.exe]

cmd
Code:
cd C:\Users\user\Desktop\distribution
copy /b nw.exe+package.nw games.exe

powerShell
Code:
cd C:\Users\user\Desktop\distribution
New-Item -ItemType file "game3.exe" -force
$file1 = Get-Content "package.nw"
$file2 = Get-Content "nw.exe"
Add-Content "game3.exe" $file1
Add-Content "game3.exe" $file2



enjoy

i made here screen for help

1LAsGfnE_o.png


b85hDj2l_o.png


80sVAsII_o.png
Can i have a copy to try to decrypt?
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,635
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
Can i have a copy to try to decrypt?
well it also easy to decompile with command extract :stache:

Assuming that the person is aware that you compile the file necessary file in the nodejs executable.
You can also protect your image and script by changing the internal extensions of the pixi loader and by using a script to crypted your js files.
this should further discourage the application thief.
it creates a real mess in all files.
PHP:
Resource._loadTypeMap = {
    // images
    gif: Resource.LOAD_TYPE.IMAGE,
    png: Resource.LOAD_TYPE.IMAGE,
    bmp: Resource.LOAD_TYPE.IMAGE,
    jpg: Resource.LOAD_TYPE.IMAGE,
    jpeg: Resource.LOAD_TYPE.IMAGE,
    tif: Resource.LOAD_TYPE.IMAGE,
    tiff: Resource.LOAD_TYPE.IMAGE,
    webp: Resource.LOAD_TYPE.IMAGE,
    tga: Resource.LOAD_TYPE.IMAGE,
    svg: Resource.LOAD_TYPE.IMAGE,
    'svg+xml': Resource.LOAD_TYPE.IMAGE, // for SVG data urls

    // audio
    mp3: Resource.LOAD_TYPE.AUDIO,
    ogg: Resource.LOAD_TYPE.AUDIO,
    wav: Resource.LOAD_TYPE.AUDIO,

    // videos
    mp4: Resource.LOAD_TYPE.VIDEO,
    webm: Resource.LOAD_TYPE.VIDEO
};

Resource._xhrTypeMap = {
    // xml
    xhtml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,
    html: Resource.XHR_RESPONSE_TYPE.DOCUMENT,
    htm: Resource.XHR_RESPONSE_TYPE.DOCUMENT,
    xml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,
    tmx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,
    svg: Resource.XHR_RESPONSE_TYPE.DOCUMENT,

    // This was added to handle Tiled Tileset XML, but .tsx is also a TypeScript React Component.
    // Since it is way less likely for people to be loading TypeScript files instead of Tiled files,
    // this should probably be fine.
    tsx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,

    // images
    gif: Resource.XHR_RESPONSE_TYPE.BLOB,
    png: Resource.XHR_RESPONSE_TYPE.BLOB,
    bmp: Resource.XHR_RESPONSE_TYPE.BLOB,
    jpg: Resource.XHR_RESPONSE_TYPE.BLOB,
    jpeg: Resource.XHR_RESPONSE_TYPE.BLOB,
    tif: Resource.XHR_RESPONSE_TYPE.BLOB,
    tiff: Resource.XHR_RESPONSE_TYPE.BLOB,
    webp: Resource.XHR_RESPONSE_TYPE.BLOB,
    tga: Resource.XHR_RESPONSE_TYPE.BLOB,

    // json
    json: Resource.XHR_RESPONSE_TYPE.JSON,

    // text
    text: Resource.XHR_RESPONSE_TYPE.TEXT,
    txt: Resource.XHR_RESPONSE_TYPE.TEXT,

    // fonts
    ttf: Resource.XHR_RESPONSE_TYPE.BUFFER,
    otf: Resource.XHR_RESPONSE_TYPE.BUFFER
};

// We can't set the `src` attribute to empty string, so on abort we set it to this 1px transparent gif
Resource.EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
: O hmm i think this is not for an amateur dev like me. Btw i watched some other posts of you, you seem made several really cool tools & stuffs for fully customized RPGMV games, it's just they all too hard for me to understand so i can't use any : | )
 

Tome571

Veteran
Veteran
Joined
Oct 3, 2015
Messages
129
Reaction score
129
First Language
English
Primarily Uses
Followed all steps, got to the Game.exe file. Run it and a window pops up, header bar is correct, icon is correct. Just a black screen. Does this require 1.6.1 or above to work correctly? Do I need to have web m4a sound files like in web deployment?
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,635
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
pack with the nwjs SDK to allow you call the debug terminal
and give the error code.
If you window are black , you have maybe a bug somewhere in your projet.
 

Mifey

Villager
Member
Joined
May 3, 2019
Messages
15
Reaction score
5
First Language
Deutch
Primarily Uses
RMMV
@Jonforum It works flawlessly, thank you for making this.
There is one problem for me, I can't figure out how to access the savefile, is there any way to have a folder where the player can access his savefile, it's important in my game! Thank you!
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,635
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
did you try pack only resources in `package.nw`, and leave saveFile file in the root www ?
If is not work, you will need hack rmmv core and how is get save from root `www`
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,635
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
i add more info here
https://github.com/djmisterjon/pixi-nwjs-starter
look for `CREATE DIST YOUR ONE CLICK APP.EXE x64`
So yes you can package only ressource you want and leave outside ressource you want people have access.
But this will depending on how rmmv package the distribution, am not remember how the software create distribution hierarchy.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,290
Reaction score
1,786
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi! @Jonforum
I'm trying to do this, but I can't figure it out when I go wrong.
Using this version: "nwjs-sdk-v0.39.2-win-x64"
After I merge the files package.nw with nw.exe with CDM command, the file game.exe is created(PT-BR).
It says: "1 file(s) copy."
KkDIpcn.png


But when I try to open that, it shows me this screen, instead of opening the game:

KL69OEw.png

seKFQwv.png
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,290
Reaction score
1,786
First Language
Portuguese - Br
Primarily Uses
RMMZ

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,635
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
Hi! I see the video, and it has something in 13:43 that made me think:
The package.json of the project don't come with the field of name completed.

"name": "", < it come like this.
Maybe I have to put the mygame.exe name here before make all single executable?
the video are very old , a lot of thing change, but yeah the name it the name showed in the bar when you minimize your window,mac app.
upload_2019-7-15_13-41-7.png
You will not see this in fullscreen.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,290
Reaction score
1,786
First Language
Portuguese - Br
Primarily Uses
RMMZ
the video are very old , a lot of thing change, but yeah the name it the name showed in the bar when you minimize your window,mac app.
View attachment 119478
You will not see this in fullscreen.
No luck at all =/

I made a little video from the process. Maybe I'm doing something it is obviously wrong, but can't see it.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,635
Reaction score
1,457
First Language
French
Primarily Uses
RMMV
i see you use sdk, so if you push f12 when you open app, do you have error in log ?
 

Dungeonmind

Lvl 4000 Humanoid
Veteran
Joined
Sep 2, 2013
Messages
572
Reaction score
426
First Language
English
Primarily Uses
RMMV
Looks pretty neat I’ll have to check this out when I get the chance.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,290
Reaction score
1,786
First Language
Portuguese - Br
Primarily Uses
RMMZ
i see you use sdk, so if you push f12 when you open app, do you have error in log ?
As soon i hit f12 it shows me the console in "Source" with this things write:
Code:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>nw.js</title>
<style>
body, div, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, img, form, fieldset, blockquote {
    margin: 0; padding: 0; border: 0;
}

body {
    background: #eee;
}

#nwjsver {
    background: #474747; display: table; color: #ccc;
    text-align: right;
    position: absolute;
    bottom: 0;
    width: 100%;
}

#inset {
    width: 100%; height: 100%; background: #474747; display: table;
}

#inset h1 {
    text-align: center;
    vertical-align: middle;
    font-family: "League-Gothic", Courier;
    font-size: 100px; text-transform: uppercase;
    text-shadow: 0px 2px 3px #222;
        display: table-cell;

}

.shimmer {
  text-align: center;
  color: rgba(55,55,55,0.1);
  background: -webkit-gradient(linear, left top, right top, from(#222), to(#222), color-stop(0.5, #fff));
  -webkit-background-size: 125px 100%;
  -webkit-background-clip: text;
  -webkit-animation-name: shimmer;
  -webkit-animation-duration: 10s;
  -webkit-animation-iteration-count: infinite;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-color: #222;
}

@-webkit-keyframes shimmer {
  0% {
    background-position: top left;
  }
  20% {
    background-position: top right;
  }
  100% {
    background-position: top right;
  }
}
</style>
</head>
<body>
<div id="inset">
    <h1 class="shimmer">NW.js</h1>
</div>
<div id="nwjsver">
  nw.js v<script>document.write(nw.process.versions['nw']);</script><br/>
  Node v<script>document.write(nw.process.versions['node']);</script><br/>
  Chromium <script>document.write(nw.process.versions['chromium']);</script><br/>
  commit hash: <script>document.write(nw.process.versions['nw-commit-id']);</script><br/>
</div>
</body>
</html>

MCZ1INy.png
9kgM6mG.png

Just for you to know: I just want to do this because I have problems when I make a single executable file with Enigma Virtual Box. It somehow made the Yep_EventCopier don't work properly, or is some sort of incompatibility. I made a thread for this, here. And also, if it has some performance improvements, why not? xD

Hope this prints can help.
 

Latest Threads

Latest Posts

Latest Profile Posts

Remember when people had the ability to have meaningful conversations on platforms like twitter or facebook? Good times... Nowadays is absolute crap.
All aboard the Advent calendar train, riding Avery's coattails as an excuse to make more sprites. ;)
Advent2021-01.gif

Get 'em in my thread in General Resources.
I had a dream where it was Friday, and what happened in the dream was irrelevant, because I woke up and it's not Friday, so I'm sad.
edit: third time's the charm? some graphic text I whipped up that I like for the mid-game intertitle, now with all of the actual letters in the stupid damn words I was trying to spell :uswt2:
kcsmall.png

Forum statistics

Threads
117,097
Messages
1,104,546
Members
153,110
Latest member
Sanerefusal
Top