diff --git a/README.md b/README.md index b4f9c2f..398f853 100644 --- a/README.md +++ b/README.md @@ -124,12 +124,19 @@ python web.py --identity-base64 "GCN6mMhVemdNIK/fw97C1zvU17qjQPFTXRBotVckeGmoOwQ > NOTE: this is a randomly generated identity for example purposes. Do not use it, it has been leaked! -## Build from Source +## Build Electron Application -- `build_macos.sh` - Builds a `.dmg` containing a `.app` -- `build_windows.bat` - Builds a `.msi` Windows Installer +Reticulum WebChat can be run via a command line, as explained above, or as a standalone Electron app. -> Note: `build_macos.sh` must be run on a Mac, and `build_windows.bat` must be run on a Windows PC. +To run as a standalone application, we need to compile the python application to an executable with [cxfreeze](https://github.com/marcelotduarte/cx_Freeze) and then build an [electron](https://www.electronjs.org/) app which includes a bundled browser that can interact with the compiled python executable. + +To build a `.dmg` containing a `.app` for Mac, run the following: + +``` +npm run dist +``` + +> Note: cxfreeze only supports building an executable for the current platform. You will need a Mac to build for Mac, and a Windows PC to build for Windows. ## TODO diff --git a/build_macos.sh b/build_macos.sh deleted file mode 100644 index 54fd491..0000000 --- a/build_macos.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# ensure macos/ReticulumWebChat.sh is executable before the cxfreeze copies it inside the .app -chmod +x macos/ReticulumWebChat.sh - -# build macos .app and put in .dmg -python setup.py bdist_dmg - -# todo codesign? diff --git a/macos/ReticulumWebChat.sh b/macos/ReticulumWebChat.sh deleted file mode 100755 index 49ca617..0000000 --- a/macos/ReticulumWebChat.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# references for making a macOS .app that runs a shell script -# https://apple.stackexchange.com/a/407885 -# https://github.com/Whisky-App/Whisky/issues/107#issuecomment-1592934039 -# https://stackoverflow.com/a/71875958 -# https://stackoverflow.com/a/5756763 - -# get path to directory where this script is currently executing from -# we are expecting this to be "ReticulumWebChat.app/Contents/MacOS" -ABSPATH=$(cd "$(dirname "$0")"; pwd -P) - -# path to the actual executable that we want to run as a console application (via Terminal) -EXE="$ABSPATH/ReticulumWebChat" - -# open actual executable in terminal -# we also provide a custom storage dir within the user home directory -osascript -e " - tell app \"Terminal\" - do script \"$EXE --storage-dir ~/.reticulum-webchat; exit $?\" - activate - end tell -" diff --git a/macos/icon.icns b/macos/icon.icns deleted file mode 100644 index b0b3498..0000000 Binary files a/macos/icon.icns and /dev/null differ diff --git a/setup.py b/setup.py index afebfbd..04039f5 100644 --- a/setup.py +++ b/setup.py @@ -43,17 +43,5 @@ setup( # use a static upgrade code to allow installer to remove existing files on upgrade 'upgrade_code': '{6c69616d-ae73-460c-88e8-399b3134134e}', }, - 'bdist_mac': { - 'bundle_name': 'ReticulumWebChat', # creates ReticulumWebChat.app - 'iconfile': 'macos/icon.icns', - 'include_resources': [ - # we use this script to launch as a terminal app - ('macos/ReticulumWebChat.sh', '../MacOS/ReticulumWebChat.sh'), - ], - 'plist_items': [ - # we want ReticulumWebChat.app to execute ReticulumWebChat.sh instead of the python binary, as we need to launch it via terminal - ('CFBundleExecutable', 'ReticulumWebChat.sh'), - ], - }, }, )