Skip to content

Commit

Permalink
0.0.4 - almost done
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Sep 25, 2011
1 parent 19e6c43 commit c73b144
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 13 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
@@ -1,14 +1,17 @@
0.0.3 / September 25, 2011
0.0.4 / September 25, 2011
==================
* Overall improvements
* NodeJS src (for unix) is downloaded during installation to save on size
* Post-install configuration scripts

0.0.3 / September 25, 2011
==================
* .exe and .app compiling

0.0.2 / September 24, 2011
==================

* First working copy! .jar only

0.0.1 / September 21, 2011
==================

* Start of the project
5 changes: 2 additions & 3 deletions TODO.md
Expand Up @@ -9,6 +9,5 @@
### Major

* Installer customization through config files
* Windows - .exe - 100%
* OSX - .app - 100%
* Unix - .jar - 100% (Possibly look into .rpm and .deb generation)
* Test on OSX and Windows
* Desktop Icons
4 changes: 3 additions & 1 deletion lib/main.coffee
Expand Up @@ -16,7 +16,9 @@ module.exports =
pack = JSON.parse fs.readFileSync path.join(opt.in, 'package.json')
catch err
throw 'Failed to find package.json in ' + opt.in


throw '"main" property not in package.json' unless pack.main
throw '"author" property not in package.json' unless pack.author
throw '"name" property not in package.json' unless pack.name

log.info 'Starting ' + pack.name + ' build'
Expand Down
15 changes: 13 additions & 2 deletions lib/packer.coffee
Expand Up @@ -7,6 +7,15 @@ util = require './util'
async = require 'async'
rimraf = require 'rimraf'

writeRunners = (dirs, pack, opt, cb) ->
main = path.join path.basename(dirs.app), pack.main
unix = '#!/bin/sh\n'
unix += 'cd $( dirname "$0" )\n'
unix += './node/node ./' + main+ '\n'
fs.writeFile path.join(dirs.temp, 'run'), unix, (err) ->
throw err if err
cb()

copyApp = (dirs, pack, opt, cb) ->
log.info 'Cloning application...'
util.cloneDirectory opt.in, dirs.app, true, ['npkg-temp', opt.out], cb
Expand Down Expand Up @@ -38,7 +47,7 @@ saveNPM = (dirs, pack, opt, cb) ->

saveNode = (dirs, pack, opt, cb) ->
# throw new Error 'Please specify a node engine version in package.json' unless pack.engines and pack.engines.node
# TODO: Validate NodeJS versions with package.json using semver, make sure windows has a node.exe, all that jazz
# TODO: Validate NodeJS versions with package.json using semver
srcdl = 'http://nodejs.org/dist/node-v0.4.12.tar.gz'
exedl = 'http://nodejs.org/dist/v0.5.7/node.exe'

Expand Down Expand Up @@ -69,4 +78,6 @@ module.exports =
nodefn = (call) -> saveNode dirs, pack, opt, call
copyAppfn = (call) -> copyApp dirs, pack, opt, call
copyScriptsfn = (call) -> copyScripts dirs, pack, opt, call
async.parallel [copyAppfn, copyScriptsfn, npmfn, nodefn], cb
unixRun = (call) -> writeRunners dirs, pack, opt, call

async.parallel [copyAppfn, copyScriptsfn, unixRun, npmfn, nodefn], cb
2 changes: 2 additions & 0 deletions lib/scripts/PostInstall.xml
Expand Up @@ -3,12 +3,14 @@
<os family="windows" />
<executefile name="$INSTALL_PATH/config/windows.bat">
<env>BASE=$INSTALL_PATH</env>
<env>MAINFILE=$MAIN_FILE</env>
</executefile>
</job>
<job name="Installing NodeJS">
<os family="unix" />
<executefile name="$INSTALL_PATH/config/unix.sh">
<env>BASE=$INSTALL_PATH</env>
<env>MAINFILE=$MAIN_FILE</env>
</executefile>
</job>
<onFail previous="true" next="false" />
Expand Down
2 changes: 2 additions & 0 deletions lib/scripts/unix.sh
Expand Up @@ -5,4 +5,6 @@ curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
make
make install
wait
cd $BASE
chmod 0777 run
echo 'Installation finished!'
5 changes: 3 additions & 2 deletions lib/scripts/windows.bat
@@ -1,2 +1,3 @@
echo 'Configuring NodeJS - Windows'
echo 'Installation finished!'
echo "Configuring NodeJS - Windows"

echo "Installation finished!"
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name":"npkg",
"description":"Creates cross-platform installers for NodeJS applications",
"version":"0.0.3",
"version":"0.0.4",
"homepage":"http://github.com/wearefractal/npkg",
"repository":"git://github.com/wearefractal/npkg.git",
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
Expand Down
1 change: 1 addition & 0 deletions test/main.js
@@ -1,3 +1,4 @@
require('coffee-script');
var log = require('node-log')
log.setName('TestApp')

Expand Down
3 changes: 2 additions & 1 deletion test/package.json
Expand Up @@ -5,9 +5,10 @@
"homepage":"http://github.com/wearefractal/npkg",
"repository":"git://github.com/wearefractal/npkg.git",
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
"main":"./lib/main.js",
"main":"./main.js",

"dependencies":{
"coffee-script":"*",
"node-log":"*"
},
"engines":{
Expand Down

0 comments on commit c73b144

Please sign in to comment.