mirror of https://github.com/keeweb/keeweb
nsis
parent
32a826c8e8
commit
0ec98dde6c
23
Gruntfile.js
23
Gruntfile.js
|
@ -381,6 +381,26 @@ module.exports = function(grunt) {
|
|||
dest: 'dist/desktop/KeeWeb.mac.dmg'
|
||||
}
|
||||
},
|
||||
nsis: {
|
||||
options: {
|
||||
installScript: 'package/nsis/main.nsi',
|
||||
vars: {
|
||||
version: pkg.version,
|
||||
rev: function() { return grunt.config.get('gitinfo.local.branch.current.shortSHA'); },
|
||||
homepage: pkg.homepage
|
||||
}
|
||||
},
|
||||
'win32-x64': {
|
||||
options: {
|
||||
arch: 'x64'
|
||||
}
|
||||
},
|
||||
'win32-ia32': {
|
||||
options: {
|
||||
arch: 'ia32'
|
||||
}
|
||||
}
|
||||
},
|
||||
deb: {
|
||||
'linux-x64': {
|
||||
options: {
|
||||
|
@ -513,7 +533,8 @@ module.exports = function(grunt) {
|
|||
]);
|
||||
|
||||
grunt.registerTask('build-desktop-dist-win32', [
|
||||
// TODO: windows installer
|
||||
'nsis:win32-x64',
|
||||
'nsis:win32-ia32'
|
||||
]);
|
||||
|
||||
grunt.registerTask('build-desktop-dist-linux', [
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = function (grunt) {
|
||||
grunt.registerMultiTask('nsis', 'Launches NSIS installer', function (done) {
|
||||
let opt = this.options();
|
||||
let args = [];
|
||||
Object.keys(opt.vars).forEach(key => {
|
||||
let value = opt.vars[key];
|
||||
if (typeof value === 'function') {
|
||||
value = value();
|
||||
}
|
||||
args.push(`-D${key}=${value}`);
|
||||
});
|
||||
args.push('-Darch=' + opt.arch);
|
||||
args.push('-NOCD');
|
||||
args.push(opt.installScript);
|
||||
grunt.util.spawn({
|
||||
cmd: 'makensis',
|
||||
args: args,
|
||||
opts: {stdio: 'inherit'}
|
||||
}, function (error, result, code) {
|
||||
if (error) {
|
||||
return grunt.warn('NSIS error: ' + error);
|
||||
}
|
||||
if (code) {
|
||||
return grunt.warn('NSIS exit code ' + code);
|
||||
}
|
||||
done();
|
||||
});
|
||||
});
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
OutFile dist/desktop/KeeWeb.win32.${arch}.exe
|
||||
|
||||
Section
|
||||
|
||||
# TODO
|
||||
|
||||
SectionEnd
|
Loading…
Reference in New Issue