GithubHelp home page GithubHelp logo

propuke / electron-shared Goto Github PK

View Code? Open in Web Editor NEW
27.0 7.0 2.0 77 KB

A (proof of concept?) launcher for Electron apps that uses shared runtimes

License: MIT License

Makefile 0.70% C 98.27% CMake 1.03%

electron-shared's Introduction

Electron-shared

Usage
How to Build

A (proof of concept?) launcher for Electron apps
No need to include Electron with your apps, just use this? (or that's the theory)

  1. Bundle your app in a app.asar package, or in a directory named app alongside this executable
  2. Run it
  3. Electron will be automatically downloaded if needed and your app will run

Electron-shared will look inside your package.json to check version requirements
If a version of electron meeting these hasn't already be downloaded it will do so (with an update dialog while it does so)
Runtimes get stored in AppData\Local\electron-shared, .cache/electron-shared and Library/Application Support/electron-shared
Future apps compatible with the same versions will make use of the same downloaded runtimes

Usage

Usage: ./electron-shared [options] [path]
       ./electron-shared [command]

  Download the latest supporting version of Electron for the specified PATH
  and then run the application using it.

  If omitted, path will default to "app"

  PATH must be a directory containing a project.json file or the path to an
  .asar archive (extension optional)

  Options:
    -d, --downloadOnly   Download any required Electron updates and then exit
    -n, --noDownload     Do NOT download if required Electron is not available
    -s, --silent         Do not display any user feedback while downloading

    Any other options will be passed directly to Electron (if it is executed)

  Commands:
    -h, --help           Display this help and exit
    -l, --list           Print the currently downloaded Electron versions
    -v, --version        Output version information and exit

Building

Building Electron-shared has only currently been tested from within Linux
It is cross-compiled for Windows from within Linux via MinGW
The makefiles should also work from within macOS, although this has not been tested
If anyone wants to contribute a native build process for Windows this would be greatly appreciated

First, clone the repo along with all submodules, by using the --recursive flag:

git clone --recursive https://github.com/ProPuke/electron-shared.git

Building is then done via 3 makefiles:

  • makefile.posix - This will compile for your local (posix-compliant) OS. Libraries such as libcurl will be dynamically linked.
  • makefile.mingw32 - This will compile for 32bit win32. Libraries such as libcurl will be statically compiled into the executable.
  • makefile - This will simply call both of the above, producing both a native executable and a 32bit win32 executable for distribution

Building for Linux (and macOS)

To build exclusively for Linux (and hopefully also macOS), ensure cmake, the following libraries are installed: libcurl and libgtk-3-dev, and execute the posix makefile as follows:

make -f makefile.posix

This will generate a native electron-shared executable

Building for Windows (from within Linux)

To build for Windows from within Linux ensure cmake the following library is installed: mingw-w64, and execute the windows makefile as follows:

make -f makefile.mingw32

This will generate an electron-shared.exe 32bit executable

Building for Linux/macOS and Windows at once

To build for both targets at once, ensure you have the neccasary libaries for both, above, installed and simple execute the main makefile:

make

This will generate both a native electron-shared executable, and an electron-shared.exe 32bit win32 executable.

electron-shared's People

Contributors

ashelleypurdue avatar propuke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

electron-shared's Issues

Windows executable seemingly does nothing.

I tried it in multiple terminals. In most of them, running electron-shared yields no output. On Git Bash, however, it yields a seg fault.

Version: v0.1-alpha.3, electron-shared-win32-ia32.exe

To reproduce:

  • copy tests/electron-quick-start to a separate folder named "app"(or just rename it if you're lazy)
  • Place electron-shared-win32-ia32.exe in the folder beside "app". Rename it to "electron-shared.exe" for convenience.
  • Open git bash here, and type "./electron-shared". You'll get a seg fault.
  • Open cygwin here, and type "./electron-shared". You'll get no output.
  • Open cmd here, and type "electron-shared.exe". You'll get no output.
  • Open powershell here, and type "./electron-shared.exe". You'll get no output.
  • Double click the executable. Still nothing.

Add build instructions

Trying to build this on a fresh Ubuntu VM, but the VM is missing some libraries that this project depends on. Care to share a list of requirements in the readme, whenever you get around to it?

electron-shared fails when run through WSL Bash on Ubuntu

To reproduce:

  • Open WSL Bash on Ubuntu on a Windows 10 machine
  • Clone this repo and run "make" to build
  • Copy or move the resulting "electron-shared" file to the "test" folder
  • cd to the "test" folder and run "./electron-shared electron-quick-start"

You'll receive the following console output:

This application requires Electron ^4.0.7
Unable to init server: Could not connect: Connection refused
Unable to initialise libui
  Cannot open display:
Fetching release list from GitHub...
Downloading Electron 4.1.0...
Extracting...
Launching Electron 4.1.0 (^4.0.7)...
/home/ashelley/.cache/electron-shared/4.1.0/electron: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory```

where's the resources directory?

process.resourcesPath points back to resources in the runtime directory. Apps can't specify files in there :S

This prob breaks auto-updaters and stuff.

What are we to do? Need to route it back to the app directory somehow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.