- This new version passes `force` to `diskutil unmountDisk`
Change-Type: patch
Changelog-Entry: Fix `at least one volume could not be unmounted` error in OS X.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Currently, we are not making sure the IPC server we start at
`lib/src/child-writer/index.js` gets closed when the child process exits
(successfully or not). This eventually causes issues when the user click
"flash again", since the stateful `ipc` global exposed by `node-ipc`
gets initialised again, causing the module to get to an invalid state
that eventually results in `this.log is not a function`.
- We've added `ipc.server.stop()` to both the `error` and `close` event
handlers (which are self exclusive, according to the docs).
- We've added `child.kill()` to the child `stderr` handler, since that
function causes the `close` event to be triggered, which in turns
calls `ipc.server.stop()`.
Change-Type: patch
Changelog-Entry: Fix `this.log is not a function` error when clicking "flash again".
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
`yargs` wraps help output lines, causing the examples to be displayed
like this:
```
Examples:
/usr/bin/nodejs bin/etcher
raspberry-pi.img
/usr/bin/nodejs bin/etcher --no-check
raspberry-pi.img
/usr/bin/nodejs bin/etcher -d /dev/disk2
ubuntu.iso
/usr/bin/nodejs bin/etcher -d /dev/disk2
-y rpi.img
```
As a solution, we can set `.wrap(null)` to completely disable wrapping.
Fixes: https://github.com/resin-io/etcher/issues/810
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The `docs/CLI.md` points to user to `docs/CONTRIBUTING.md` for
instructions in how to install dependencies. This document previously
included the explicit `npm` commands to run, but was then changed to
point to the platform scripts, which means that if the user follows the
current instructions but has a NodeJS version which is not ABI
compatible with the NodeJS version used by the currently used Electron
version, the user will get an incompatibility error.
Fixes: https://github.com/resin-io/etcher/issues/801
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Setting a Chocolatey cache and Making sure it gets persisted means that
future builds don't have to download every Chocolatey package from the
internet every time.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We are not using Hound CI to display lint warnings anymore. The CI
servers are in charge of running the linters now.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The usual case is images requiring special treatment. We recommend the
users to use specialised tooling for those cases.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
If a drive contains multiple partitions that Windows recognises and
mounts, then `drivelist` will incorrectly display separate drive objects
for each partition, causing `ngRepeat` to complain in the drive selector
component.
The issue was fixed by grouping the mountpoints of all recognised
partitions in a single drive object, as we do with the other supported
operating systems.
After the fix, `drivelist` also removed its `name` property (since its
now always equal to `device`), so some extra logic to compute an
appropriate display name for the drive has been introduced to
`DriveScannerService`.
Fixes: https://github.com/resin-io/etcher/issues/720
See: https://github.com/resin-io-modules/drivelist/pull/100
Change-Type: patch
Changelog-Entry: Fix duplicate drives in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We're now including the version as part of the filename, which means
`Etcher-linux-x64` is no longer 100% accurate. As a solution, we include
a filename with "placeholders" for the version and architecture, to
avoid harcoding a specific version.
See: 18e9d1eb11 (commitcomment-19619181)
See: https://github.com/resin-io/etcher/pull/764
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We do this for macOS and GNU/Linux for debugging purposes, but we
weren't doing it for Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The AppImage `desktopintegration` prompt can also be disabled by setting
the `SKIP` environment variable.
As a matter of fact, we use this trick inside Etcher itself when
executing the Etcher CLI as a child process of the Etcher GUI.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This PR makes sure every command line argument that represents an
absolute path is surrounded by double quotes, to avoid any potential
escaping issue.
This simplifies a lot the various special character escaping routines we
had in place, since we now only have to make sure double quotes inside
the paths are escaped.
Fixes: https://github.com/resin-io/etcher/issues/773
Change-Type: patch
Changelog-Entry: Prevent escaping issues during elevation by surrounding paths in double quotes.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
When running the install script as root (e.g. inside a Docker container), bower complained that it
"shouldn't" be run with sudo. When running the x86 install multiple times, it tried to move
Etcher-linux-ia32 inside the existing Etcher-linux-x86/ folder, rather than renaming it, which meant
later commands failed.
If we pass relative paths as arguments to the AppImage, they get
resolved from `/tmp/.mount_XXXXXX/usr`. We can exploit this to run the
Etcher CLI directly from the AppImage, rather than having to mount it
ourselves:
```sh
ELECTRON_RUN_AS_NODE=1 Etcher-linux-x64.AppImage bin/resources/app.asar [OPTIONS]
```
By using this little trick, we get rid of both our custom mounting logic
and the need of surrounding the command to run in single quotes,
therefore avoiding a whole new kind of escaping issues.
Since running the CLI directly from the AppImage means that the
`desktopintegration` will be ran for the CLI, we pass the `SKIP`
environment variable to avoid having it prompt the user for
installation.
We also updated the `desktopintegration` script to the latest version,
which reduces the amount of logging plus other minor fixes.
Fixes: https://github.com/resin-io/etcher/issues/637
Change-Type: patch
Changelog-Entry: Fix Etcher leaving zombie processes behind in GNU/Linux.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.
This change was motivated by the following Electron fix which landed in
v1.4.4: https://github.com/electron/electron/pull/7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.
Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.
This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.
Fixes: https://github.com/resin-io/etcher/issues/642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This PR zips the package that is built by running:
```sh
.\scripts\build\windows.bat package <arch>
```
And puts it in `etcher-release/installers`.
Fixes: https://github.com/resin-io/etcher/issues/760
Change-Type: minor
Changelog-Entry: Publish standalone Windows builds.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
AppImages need to be marked as executables before they can be used.
Distributing them directly means that virtually all web browsers will
automatically remove the execution permissions, leading us to have to
explain users how to add it back with `chmod`, etc.
For simplicity purposes, we'll be distributing AppImages inside ZIPs,
which ensure the execution permissions are added back when the user
decompresses it.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We translate function arguments (e.g: `$1`, `$2`, etc) to readable names
using shell variables in the top of every shell function in the build
scripts.
Since we were not declaring these variables as `local`, two functions
using the same "argument name" would override each other.
For example:
```sh
function foo() {
variable=$1
# Do something with $variable
}
function bar() {
variable=$1
# Do something with $variable
}
foo "Hello World"
echo $variable
> Hello World
bar "Changed variable"
echo $variable
> Changed variable
```
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The main purpose of this change is to simplify the interface and avoid
unnecessary text.
Fixes: https://github.com/resin-io/etcher/issues/742
Change-Type: minor
Changelog-Entry: Use info icon instead of "SHOW FULL FILE NAME" in first step.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The `$output_package` variable is defined inside the `package_x$ARCH`
functions, which means that if we run the following commands:
```sh
./scripts/build/linux.sh package x64
./scripts/build/linux.sh appimage x64
```
The `$output_package` variable will not be defined when the script runs
the `appimage` command.
To workaround this issue, we declare a new `$package_directory` variable
inside the `appimage` command clause.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The "dropzone" directive, which we use to implement drag and drop
support, was not being loaded in the application at all for some reason.
It was probably accidentally deleted during major refactorings.
Change-Type: patch
Changelog-Entry: Fix drag and drop not working anymore.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Document the need to have a polkit authentication running in GNU/Linux
to be able to go through the authentication system.
Fixes: https://github.com/resin-io/etcher/issues/756
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We're particularly interested in the following change:
- Add `etch` support.
Also:
- Add a `.description` property to all archive related errors.
- Rename archive metadata base path from `_info` to `.meta`.
Change-Type: minor
Changelog-Entry: Add support for `etch` images.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Currently, if the "CHANGE" label at the bottom of the image selection
step, once an image has been selected, is clicked, the selection state
is cleared.
Since https://github.com/resin-io/etcher/pull/602, we allow the drive
state to change independently of the image selection state, so the above
behaviour doesn't make sense anymore.
Fixes: https://github.com/resin-io/etcher/issues/730
Change-Type: patch
Changelog-Entry: Don't clear selection state when re-selecting an image.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
In Windows, if the user unmounts a drive, then the drive becomes
inaccessible to the OS. Compare this to UNIX based operating systems,
where an unmounted drive is still available for many I/O operations.
To prevent confusion, we say "eject" instead of "unmount" when running
on Windows, despite "unmount" being the correct way of saying it.
See: https://github.com/resin-io/etcher/issues/750
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We list all the pre-requisites needed to get up and running with Etcher,
and then say "run this script to install dependencies", which can be
interpreted as if the install script actually also installs the
pre-requisites, which is not the case.
To clarify this, we add a clear bold notice, and change "dependencies"
to "npm dependencies", to make the distinction clearer.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Debian packaging tools cannot analyze the binaries if they are compressed
with upx. If we move the compression to the appimage command, then the
output of the package command can be used for building debian packages.
With this addition, the `package` command simply creates a standalone package, while "appimage" is the one that creates the actual AppImage. The "all" command still generates the AppImage as before.
Some of the packaging modules that we use don't work on previous NodeJS
versions.
Fixes: https://github.com/resin-io/etcher/issues/725
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>