Report non-zero exit code when installation fails

See #1493
Related #1430