Skip to content

fttx/barcode-to-pc-server

Repository files navigation

Barcode to PC server

Links

Server

App

Overview

The project is divided into two modules/folders:

  • electron: contains the core, native dependencies, and helper scripts
  • ionic: user interface

When executing npm commands make sure to change the current directory to electron: cd electron.

Setup

  1. Install the required System dependencies:

    • Node.js v14
    • Python 3
    • If you're building on macOS, run: brew install glib
  2. Clone the repository

    git clone https://github.com/fttx/barcode-to-pc-server/
    cd barcode-to-pc-server
    cd electron
    npm install

If you get errors check these links:

Run

The npm start command:

  • Runs the Electron app in development mode
  • Launches the ionic project in livereload mode

Notes:

  • If you're editing the electron folder, you have to quit the server and run it again. Use the F6 button on Visual Studio Code.
  • If you're using Windows use the PowerShell

Release

npm run build # builds the angular project in prod mode and generates the signed installer for the current platform
npm run publish # same as build, but uploads the installer to GitHub releases
  • To enable the publishing to GitHub releases set GH_TOKEN environment variable and give all the repo permissions
  • The installer will be put in the electron/dist/ folder.
  • If you get sass errors run cd ../ionic && npm rebuild node-sass --force

Code Signing

  1. Set certificateSubjectName or certificateSha1 parameter in the package.json
  2. Connect the physical token (Use the Microsoft Remote Desktop app to share the token with virtual machines)
  3. Run npm run publish

Resources:

Simulate updates

  1. Install minio as explained here
  2. Run ./node_modules/.bin/electron-builder --project ./dist/ -c.compression=store --config.publish.provider=s3 --config.publish.endpoint=http://IP:9000 --config.publish.bucket=test-update

Publishing updates

The server implements electron-update.

To publish an update:

  1. Draft a new release on GitHub and name it v<new version number>
  2. Increase the version number of the package.json
  3. Commit & push the changes
  4. Add a tag and name it v<new version number>
  5. Push the tag
  6. Run npm run publish

Note: for macOS delete the electron/electron-resources/*.rtf folder and run: npm run publish

At this point if all looks good the only thing left to do is to publish the Github release draft.

Translations

Language Contributors
Chinese -
Deutsch Bruno Wenger
Español Juan Manuel
Italiano Francesco Accardi
English Filippo Tortomasi
Arabic Bassam Mawardi

Are you fluent in any other language than English? If you found a typo, or want to help translate Barcode to PC, get in touch here.