etcher/docs/RUNNING-LOCALLY.md
Juan Cruz Viotti b75dfd3ece feat(GUI): implement Windows elevation using a native module (#1366)
Sentry error reports showcase that elevation errors on Windows are one
of the most frequent Windows errors.

In order to perform Windows elevation, we ship compiled EXEs of a third
party CLI elevation application (http://code.kliu.org/misc/elevate/)
that has several limitations:

- We have the scan the output of the script to determine if a user
  cancelled the elevation request, which causes all sorts of issues on
  computers where English is not the main language

- The application displays a `cmd.exe` window for some milliseconds,
  which is bad UX, that we have to workaround by distributing a patched
  version of the tool

- The CLI application has to be spawned, which seems to be problematic
  if users have anti-virus software, leading to hard to debug issues

- We don't have any control if something goes wrong

For these reasons, we decided to implement our own elevation mechanism
in C++ as a Node.js add-on, based on the `elevate.exe` code we where
previously using.

Misc changes:

- Introduce a `lib/shared/bindings.js` module to easily require local native
  add-ons

- Install `cpplint` and configure it to lint C++ files

Note that for practical reasons, the C++ code lives in this repository
rather than in a separate module. We will release this functionality in
a more accessible way in the future as part of the Etcher SDK project.

Change-Type: patch
Changelog-Entry: Fix uncaught errors when cancelling elevation requests on Windows when the system's language is not English.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-02 18:36:57 -04:00

2.3 KiB

Running locally

This document aims to serve as a guide to get Etcher running locally on your development machine.

Prerequisites

Common

Windows

The following MinGW packages are required:

  • msys-make
  • msys-unzip
  • msys-zip
  • msys-bash
  • msys-coreutils

OS X

Cloning the project

git clone https://github.com/resin-io/etcher
cd etcher

Installing npm dependencies

Make sure you have all the pre-requisites listed above installed in your system before running the install script.

Please make use of the following scripts to install npm dependencies rather than simply running npm install given that we need to do extra configuration to make sure native dependencies are correctly compiled for Electron, otherwise the application might not run successfully.

If you're on Windows, run the command from the Developer Command Prompt for VS2015, to ensure all Visual Studio command utilities are available in the %PATH%.

make electron-develop

Running the application

GUI

npm start

CLI

node bin/etcher