2.0.4 • Published 6 years ago

nxt-app-electron v2.0.4

Weekly downloads
1
License
UNLICENSED
Repository
-
Last release
6 years ago

nxt-app-electron

This is the desktop app for Mac and Windows. It's a simple app, built mainly to load a URL for a nxtedition hub. In order to do that, a small settings windows exists (built using React) for users to choose a URL to load. It will find all mdns services of type nxt-hub by default, but a manual URL can also be entered (which is useful when developing).

The app is built, signed and then published to a AWS S3 bucket, all using electron-builder. The most important files to note from the build are the .dmg and .zip for mac (zip is needed for auto updates to work), and the .exe file for windows. Along with those, a few "latest" metadata files are also published for the checking of new updates to work.

The app will check for new updates every 4 hours. If a new update is found it will be downloaded immediately, and installed once the user has restarted the app. Therefore, we'll also notify the user once an update has been downloaded.

App Settings

Settings are stored locally on the user's machine. When changed, all settings will be applied immediately.

Server

The URL to load the in the app, should point to a nxtedition hub. All hubs that broadcast a mdns service of type nxt-hub will be picked up automatically.

Fullscreen

Whether to show the app in fullscreen. Users can always toggle the fullscreen mode manually using window controls or keyboard shortcuts, but those won't affect how it launches.

Display Mode

Whether to show the app in display mode. When true, /device will be appended to the server URL, effectively putting the device in display mode.

Development

# run application in development mode using webpack
yarn dev

Building

Building for mac is only possible on machines running OS X.

Prerequisites

Certificates

When signing the app, the required certificates (developerID_application.p12 and Boffins Technologies AB.pfx) will be looked for in ~/.certs/nxtedition. You'll find those files in Google Drive.

AWS

In order to publish the built files to S3, you need to have your AWS credentials setup properly. If you haven't already, create a file ~/.aws/credentials and specify your keys:

[default] ; default profile
aws_access_key_id = YOUR_KEY_ID
aws_secret_access_key = YOUR_ACCESS_KEY

Permissions

To run the scripts for generating icons and performing the actual build, the /build directory must have write permissions:

chmod -R +x /build

Build Scripts

# create new version, build, sign and publish to S3
yarn version --new-version ${version}

# build, sign and publish to S3
yarn publish

# create a signed build, but do not publish it
yarn build

# compile source code and create webpack output
yarn compile

Generating New Icons

This is only for when building new icons.

We use ImageMagick and iconutil to generate .icns and .ico files from a 1024x1024 png file (should be /build/icon.png). While they aren't technically necessary, the result is much better, so make sure you have those tools installed before running:

# generate .ico and .icns files from the icon.png file in /build
yarn build:icons