RMMV PRO TIPS: How to compress your ressource (one files exectuable)

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.
Meow, I'm reading this over and over and it just doesn't make sense to me. I'm drinking coffee too, I wish I could share some meow.
Meow, I'm reading this over and over and it just doesn't make sense to me. I'm drinking coffee too, I wish I could share some meow.
what your are not understand , may i can help you
Thank you for posting this! It's appreciated!
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?
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==';
: 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 : | )
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?
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.
@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!
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`
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.
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."
Spoiler: CMD
KkDIpcn.png


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

Spoiler: game.exe
KL69OEw.png

Spoiler: Folder
seKFQwv.png
@Eliaquim
At 11:45

it should help
But it should work, i don't know what you do wrong.
https://github.com/nwjs/nw.js/wiki/how-to-package-and-distribute-your-apps
@Eliaquim
At 11:45

it should help
But it should work, i don't know what you do wrong.
https://github.com/nwjs/nw.js/wiki/how-to-package-and-distribute-your-apps


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?
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.
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.
i see you use sdk, so if you push f12 when you open app, do you have error in log ?
Looks pretty neat I’ll have to check this out when I get the chance.
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:
Spoiler: Source - nw_blank.html
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>

Spoiler: Images
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.

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-pro-tips-how-to-compress-your-ressource-one-files-exectuable.96879/