diff --git a/BUILD.md b/BUILD.md index 2bb81401..46b00bb0 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,9 +1,8 @@ -# Building Nodist +# Building the Nodist installer Moving forward as of 0.7.0 Nodist no longer installs like it had previously. -Now an installer is generated from the build process. This document is going -to overview the build process in the hope that it can then be scripted. +Now an installer is generated from the build process. ## Preparation @@ -20,23 +19,17 @@ Before a build can be made the following software is needed. * Extract ZIP File * Copy `Plugin\AccessControl.dll` to `C:\Program Files x86\NSIS\Plugins\x86-ansi` * Copy `Unicode\Plugin\AccessControl.dll` to `C:\Program Files x86\NSIS\Plugins\x86-unicode` +* Add C:\Program Files\NSIS to your PATH ## Build Process - -First run the build script to prepare the installer for compilation. - ``` $ cd $ node build\build.js `` -Next compile the installer by opening NSIS and selecting the "Compile Scripts" -option. Point the compiler to `\build\Nodist.nsi` this will -start the compile process. - Provided the process is successful the installer will be at -`\build\NodistSetup.exe` +`\build\out\NodistSetup.exe` Next, move the `NodistSetup.exe` to the final production name of `NodistSetup-v.exe` for example `NodistSetup-v0.7.0.exe` diff --git a/build/build.js b/build/build.js index 279d2fa3..a134d0e4 100644 --- a/build/build.js +++ b/build/build.js @@ -65,8 +65,9 @@ var npmLatestReleaseUrl = 'https://github.com/npm/npm/releases/latest'; var npmLatestUrl = 'https://codeload.github.com/npm/npm/zip/vVERSION'; //setup some folders -var tmpDir = path.resolve(path.join(__dirname,'tmp')); -var stagingDir = path.resolve(path.join(__dirname,'staging')); +var outDir = path.resolve(path.join(__dirname, 'out')) +var tmpDir = path.resolve(path.join(outDir, 'tmp')); +var stagingDir = path.resolve(path.join(outDir, 'staging')); var stagingBin = path.join(stagingDir,'bin'); var stagingLib = path.join(stagingDir,'lib'); var stagingNpmDir = stagingBin + '/node_modules/npm'; @@ -91,13 +92,12 @@ console.log(' before going further we need to prep our staging folder'); //start by clearing the staging and tmp folders P.all([ - rimraf(stagingDir), - rimraf(tmpDir) + rimraf(outDir) ]) .then(function(){ return P.all([ - fs.mkdirAsync(stagingDir), - fs.mkdirAsync(tmpDir) + mkdirp(stagingDir), + mkdirp(tmpDir) ]); }) .then(function(){ @@ -226,14 +226,16 @@ P.all([ uninstallFolders.join('\n') ); return fs.writeFileAsync( - path.resolve(nodistDir + '/build/Nodist.nsi'), + path.resolve(nodistDir + '/build/out/Nodist.nsi'), nsiTemplate ); }) + .then(function() { + console.log('Run NSIS compiler') + return exec('makensis "' + nodistDir + '/build/out/Nodist.nsi"') + }) .then(function(){ - console.log('NSI template created!'); console.log('Build complete!'); - console.log('Just compile the Nodist.nsi file to complete the build'); process.exit(0); }) .catch(function(err){