electron-builder
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -10,3 +10,3 @@ /* | ||
var camelCase = require( 'lodash.camelcase'); | ||
var camelCase = require( 'lodash.camelcase' ); | ||
@@ -13,0 +13,0 @@ |
@@ -8,7 +8,6 @@ /* | ||
var appdmg = require( 'appdmg' ); | ||
'use strict'; | ||
var fs = require( 'fs' ); | ||
var path = require( 'path' ); | ||
var writeConfigFile = require( './helper/writeConfigFile' ); | ||
var assign = require( 'lodash.assign' ); | ||
var os = require( 'os' ); | ||
@@ -28,2 +27,7 @@ | ||
build : function( options, callback ) { | ||
if ( process.platform !== 'darwin' ) { | ||
return callback( new Error( 'Invalid platform.' ) ); | ||
} | ||
options.log( '- Starting build for ´' + options.platform + '´ - ' ); | ||
@@ -50,2 +54,3 @@ | ||
var appdmg = require( 'appdmg' ); | ||
var ee = appdmg( { | ||
@@ -62,3 +67,3 @@ source : configFilePath, | ||
ee.on('finish', function () { | ||
ee.on( 'finish', function () { | ||
options.log( 'Finished ´appdmg´' ); | ||
@@ -65,0 +70,0 @@ callback(); |
@@ -10,3 +10,4 @@ /* | ||
macos : require( './macos' ), | ||
win : require( './win' ) | ||
}; | ||
win : require( './win' ), | ||
win32 : require( './win' ) | ||
}; |
@@ -8,2 +8,4 @@ /* | ||
'use strict'; | ||
var childProcess = require( 'child_process' ); | ||
@@ -30,5 +32,5 @@ var os = require( 'os' ); | ||
var configFilePath = writeConfigFile( 'installer.nsi', { | ||
appPath : _windowsify( options.appPath ), | ||
name : options.config.win.title, | ||
out : _windowsify( options.out ) | ||
appPath : _windowsify( options.appPath ), | ||
name : options.config.win.title, | ||
out : _windowsify( options.out ) | ||
} ); | ||
@@ -42,3 +44,3 @@ | ||
{ | ||
env : process.env | ||
env : process.env | ||
} | ||
@@ -52,5 +54,28 @@ ); | ||
makensis.stderr.on( 'data', function ( data ) { | ||
options.log('makensis error: ' + data); | ||
}); | ||
options.log( 'makensis error: ' + data ); | ||
} ); | ||
makensis.on( 'error', function ( err ) { | ||
if ( err.code === 'ENOENT' ) { | ||
options.log( '- makensis not found.' ); | ||
options.log( ' Please install "nullsoft scriptable install system"' ); | ||
switch( process.platform ) { | ||
case 'darwin': | ||
options.log( ' brew install wine makensis' ); | ||
break; | ||
case 'win32': | ||
options.log( ' http://nsis.sourceforge.net/Download' ); | ||
break; | ||
case 'linux': | ||
options.log( ' $ add-apt-repository ppa:ubuntu-wine/ppa -y' ); | ||
options.log( ' $ apt-get update' ); | ||
options.log( ' $ apt-get install wine nsis -y' ); | ||
break; | ||
} | ||
options.log(); | ||
return callback( new Error( 'makensis failed' ) ); | ||
} | ||
return callback( err ); | ||
} ); | ||
makensis.on( 'close', function ( code ) { | ||
@@ -99,2 +124,3 @@ options.log( 'Finished makensis with code ' + code ); | ||
* Replace / with \ to write file | ||
* also, ensure drive character is upper case when run on windows platforms | ||
* paths for windows | ||
@@ -105,4 +131,6 @@ * | ||
*/ | ||
function _windowsify( path ) { | ||
return path.replace( /\//g, '\\' ); | ||
function _windowsify( p ) { | ||
p = path.win32.normalize( p ); | ||
p = p[ 0 ].toUpperCase() + p.substr( 1 ); | ||
return p; | ||
} | ||
@@ -109,0 +137,0 @@ |
{ | ||
"name": "electron-builder", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Create electron apps installers the easy way", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "eslint ./lib/**/*.js cli.js index.js", | ||
"test": "npm run lint && tape ./**/*_spec.js | tnyan", | ||
"test:debug": "tape ./**/*_spec.js | tap-spec" | ||
"lint": "eslint ./lib cli.js index.js", | ||
"test": "npm run lint || exit 1; result=\"$(tape ./**/*_spec.js)\"; echo \"$result\" | tap-spec; echo \"$result\" | tnyan;" | ||
}, | ||
@@ -28,3 +27,2 @@ "repository": { | ||
"dependencies": { | ||
"appdmg": "^0.3.1", | ||
"fs-extra": "^0.18.4", | ||
@@ -36,2 +34,5 @@ "lodash.assign": "^3.2.0", | ||
}, | ||
"optionalDependencies": { | ||
"appdmg": "^0.3.1" | ||
}, | ||
"devDependencies": { | ||
@@ -38,0 +39,0 @@ "eslint": "^0.21.2", |
@@ -44,6 +44,23 @@ [![npm version](http://img.shields.io/npm/v/electron-builder.svg?style=flat)](https://www.npmjs.org/package/electron-builder) [![npm downloads](http://img.shields.io/npm/dm/electron-builder.svg?style=flat)](https://www.npmjs.org/package/electron-builder) [![Dependency Status](http://img.shields.io/gemnasium/loopline-systems/electron-builder.svg?style=flat)](https://gemnasium.com/loopline-systems/electron-builder) | ||
You will also need the nullsoft scriptable install system for all platforms. | ||
On osx via brew | ||
``` | ||
$ brew install wine makensis | ||
``` | ||
On linux via apt-get | ||
``` | ||
$ add-apt-repository ppa:ubuntu-wine/ppa -y | ||
$ apt-get update | ||
$ apt-get install wine nsis -y | ||
``` | ||
On Windows download the [nullsoft scriptable installer](http://nsis.sourceforge.net/Download) | ||
If you're on OS X/Linux and want to build for Windows, make also sure you're running at least `v0.12.0` of node.js. | ||
``` | ||
$ node --version | ||
v0.12.0 | ||
``` | ||
## Build MacOS installer | ||
@@ -183,1 +200,9 @@ | ||
``` | ||
## Contribution | ||
You want to help out and have ideas to make it better? Great! | ||
Create an issue and we will tackle it. | ||
If you decide to propose a pull request ( even better ) make sure `npm test` is succeeding. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29850
486
207
- Removedappdmg@^0.3.1