Tutorial RPGM Port any PC RPGMV/MZ game to run on Mac natively

Zamel_

Silent Member
Donor
Jul 7, 2017
83
97
This guide is specifically for mac users.
Since a lot of games do not provide mac ports and even if it is provided , due to windows compression, the games do not work in Mac.
I found a lot of issues running Rpg Maker games in browser using index.html mainly when it comes to saves which does not work all the time, and all the games run on browser use the same save slots, which caused save overwrites by different games.

RPGM games run on a browser , in this case Game.app on mac works like a browser, so basically copy the contents of the game in app.nw folder.

I tried this on a couple of games from both RPG MV and MZ , it worked for both.

0.I basically made a dummy file for Rpg Maker Game:
Screenshot 2023-04-25 at 11.56.06.png



















1.Next I went to the game released on PC and copied the contents to Mac : GameFolder/game/www >>> Game.app/Contents/Resources/app.nw

Screenshot 2023-04-25 at 11.55.49.png


2.Now go back to your Game.app and run it, it will open the game natively.
Download:
 
Last edited:

eosar

Active Member
Aug 11, 2016
846
1,199
Another way is to go to and pick either the latest or an older Standard version that works for your MacOS type, then copy the downloaded nwjs.app into the game folder and run it.
This works for those games that have their files outside of the /www folder.
 
  • Like
Reactions: Zamel_

KuSauXe

Newbie
May 22, 2020
37
145
Hi, I followed the instructions and the game did run but when I try to make changes in the OPTION menu like toggling the dash, I encountered an unknown error: "EROFS: read-only file system"

Update: I found the , just move the game to desktop and bam! you can now save
 
Last edited:

Cannx

New Member
Feb 17, 2021
3
0
1688400765988.png
How can i fix this? I tried moving the game folder to desktop and other various places and i also tried changing folder to read and write but i'm still getting this error.
 

LeRoy2299

Member
Feb 23, 2022
216
127
What if there is no www folder, but an rgss3a file? and have same nw.js issue when tried to launch Warlock and Boobs
 
Last edited:

Zamel_

Silent Member
Donor
Jul 7, 2017
83
97
What if there is no www folder, but an rgss3a file? and have same nw.js issue when tried to launch Warlock and Boobs
super late response
RGSS3A file is an RPG Maker VX/Ace file , it doesn't use a browser version like nw.js files , so this method won't work.
 
  • Like
Reactions: GooseElite

zztop2

New Member
Dec 1, 2021
2
3
I didn't have anything better to do so I made a zsh script to automate this process for you and produces an "my_game.app" package from a `my_game/` RPGM folder.

Usage:
Code:
./nwjs_macos_install.sh /path/to/nwjs_program_dir
Example:
Code:
./nwjs_macos_install.sh "~/Downloads/Karryn's Prison"
Here's roughly what it does:
  1. Check that the RPGM folder you specified contains "www" and "package.json", if it doesn't then it's not an NW.js program and there's nothing the script can do
  2. Check the NW.js website for the current stable version of NW.js
  3. Download the current stable version of NW.js to your working directory (if it sees that you already have a NW.js zip file in your working dir, then it will happily skip the download and attempt to use the existing zip file)
  4. Extract the "nwjs.app" package from the download and renames it to your RPGM folder name. Eg if you're converting an RPGM folder called "Karryn's Prison" it will name it "Karryn's Prison.app"
  5. Copy "www" and "package.json" from the RPGM folder into the app package
Edit: if you don't want to download a sketchy zip file then here's the script in text:
Code:
#!/bin/zsh

local flag_help

zparseopts -D -F -K -- \
    {h,-help}=flag_help || return

usage=(
    "./nwjs_macos_install.sh [-h|--help]"
    "./nwjs_macos_install.sh /path/to/nwjs_program_dir"
)

[[ -z "$flag_help" ]] || { print -l $usage && return }

# default to operating in the current directory
program_dir="$@"
if [ -z "$program_dir" ]; then
    program_dir="."
fi

if [ ! -d "$program_dir" ]; then
  echo "$program_dir is not a valid directory path."
  return 1
fi
echo "$program_dir is a valid directory path."

# sanity check to ensure the directory looks like a NW.js program
if [ ! -d "${program_dir}/www" ] || [ ! -f "${program_dir}/package.json" ] #test to avoid accidental and irreversible deletion of files and directories
then
    echo "$program_dir doesn't look like a NW.js program, it's missing a \"www\" directory and/or a \"package.json\" file."
    exit 1
fi

echo "Running chmod +rwx on $program_dir to ensure permissions"
chmod +rwx "$program_dir"

version_parser_python_lines=(
    "import json"
    "from urllib.request import urlopen"
    "versions_json = urlopen('https://nwjs.io/versions.json').read().decode('utf-8')"
    "versions_info = json.loads(versions_json)"
    "print(versions_info['stable'])"
)
printf -v version_parser_python_code '%s\r\n' "${version_parser_python_lines[@]}"
stable_version=$(python3 -c "$version_parser_python_code")

echo "Current NWjs stable version: ${stable_version}"

nwjs_arch="osx-x64"
if [[ $(uname -m) == "arm64" ]]; then
  nwjs_arch="osx-arm64"
fi

nwjs_name="nwjs-${stable_version}-${nwjs_arch}"
nwjs_zip_file="${nwjs_name}.zip"
if [ -f "${nwjs_zip_file}" ]; then
    echo "Using existing NW.js bundle: ${nwjs_zip_file}"
else
    nwjs_download_url="https://dl.nwjs.io/${stable_version}/${nwjs_zip_file}"
    echo "Downloading NWjs stable version: ${nwjs_download_url}"
    curl -O "${nwjs_download_url}" --progress-bar
fi

# extract nwjs.app, this app can run any NW.js program if we copy web assets into it
app_name=$(basename "${program_dir}")
echo "Creating ${app_name}.app from ${nwjs_zip_file}"
unzip "${nwjs_zip_file}"
mv "${nwjs_name}/nwjs.app" "${app_name}.app"
rm -rd "${nwjs_name}"

# copy the program's web assets into the app
echo "Copying NW.js program assets into ${app_name}.app"
rsync -a "${program_dir}/www" "${app_name}.app/Contents/Resources/app.nw/"
cp "${program_dir}/package.json" "${app_name}.app/Contents/Resources/app.nw/"

echo "Done! You can now run the NW.js program by opening ${app_name}.app"
 
Last edited:
  • Like
Reactions: Tholban and Zamel_
Oct 25, 2021
27
4
Can anyone please help me to figure out what could be the issue? I have tried the stable version nwjs 0.86, 0.60, 0.29, and 0.12.3 but still cannot open the yokoshima game app even the folder has www, package.json and credit.html T___T
 

Zamel_

Silent Member
Donor
Jul 7, 2017
83
97
Can anyone please help me to figure out what could be the issue? I have tried the stable version nwjs 0.86, 0.60, 0.29, and 0.12.3 but still cannot open the yokoshima game app even the folder has www, package.json and credit.html T___T
did you copy the contents of www into app.nw ?
 

zztop2

New Member
Dec 1, 2021
2
3
Yes I have duplicated the www folder and rename it to app.nw before putting it into Resource /__\
I'm guessing you're talking about Yokoshima Salon.

For this game you shouldn't rename the www folder to app.nw, you should instead create an empty app.nw folder and copy the www folder and the package.json file into app.nw.

Screenshot 2024-04-06 at 11.42.13 AM.png

The final *.app needs to have a package.json available inside Contents/Resources/app.nw, that's because NWjs will try to read the Contents/Resources/app.nw/package.json file to figure out where the index.html file is.

The original post's instructions aren't comprehensive, the OP got his game working because in that case package.json was inside the www folder, so renaming the www folder to app.nw was correct because it put package.json inside Contents/Resources/app.nw. In other cases like yours, the package.json file is separate from www and they both have to be copied into app.nw.
 
Last edited:
  • Like
Reactions: hentai_kid_yoshi
Oct 25, 2021
27
4
I'm guessing you're talking about Yokoshima Salon.

For this game you shouldn't rename the www folder to app.nw, you should instead create an empty app.nw folder and copy the www folder and the package.json file into app.nw.

View attachment 3516350

The final *.app needs to have a package.json available inside Contents/Resources/app.nw, that's because NWjs will try to read the Contents/Resources/app.nw/package.json file to figure out where the index.html file is.

The original post's instructions aren't comprehensive, the OP got his game working because in that case package.json was inside the www folder, so renaming the www folder to app.nw was correct because it put package.json inside Contents/Resources/app.nw. In other cases like yours, the package.json file is separate from www and they both have to be copied into app.nw.

Thank you very much for this hint, it works!!
 
  • Yay, update!
Reactions: zztop2
Oct 25, 2021
27
4
oh ok I see, well sometimes , for some japanese games, the method I advised doesn't work. I personally do not know why.
Thank you for the hlep! Zzop2's reply makes a lot of sense, that's exactly how it works :giggle:


I'm guessing you're talking about Yokoshima Salon.

For this game you shouldn't rename the www folder to app.nw, you should instead create an empty app.nw folder and copy the www folder and the package.json file into app.nw.

View attachment 3516350

The final *.app needs to have a package.json available inside Contents/Resources/app.nw, that's because NWjs will try to read the Contents/Resources/app.nw/package.json file to figure out where the index.html file is.

The original post's instructions aren't comprehensive, the OP got his game working because in that case package.json was inside the www folder, so renaming the www folder to app.nw was correct because it put package.json inside Contents/Resources/app.nw. In other cases like yours, the package.json file is separate from www and they both have to be copied into app.nw.