forked from mmckegg/msi-packager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
executable file
·82 lines (67 loc) · 1.55 KB
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env node
var packageMsi = require('./')
var path = require('path')
var opts = require("nomnom")
.script("msi-packager")
.options({
'source': {
position: 0,
help: 'Directory containing app to package',
required: true
},
'output': {
position: 1,
help: 'write output .msi to this path',
required: true
},
'name': {
abbr: 'n',
required: true
},
'version': {
abbr: 'v',
help: 'Specify application version',
required: true
},
'manufacturer': {
abbr: 'm',
required: true
},
'arch': {
abbr: 'a',
help: 'Specify the target architecture: x86 or x64 (optional)'
},
'upgradeCode': {
abbr: 'u',
full: 'upgrade-code',
help: 'Specify GUID to use for upgrading from other versions',
required: true
},
'iconPath': {
abbr: 'i',
full: 'icon',
help: 'Specify an icon to use on shortcuts and installer',
required: true
},
'executable': {
abbr: 'e',
help: 'Specify file to create shortcuts for',
required: true
},
'runAfter': {
abbr: 'r',
flag: true,
full: 'run-after',
help: 'Run the application after installation completes'
},
'localInstall': {
flag: true,
full: 'local',
help: 'Install per user (no administrator rights required)',
abbr: 'l',
}
}).parse();
packageMsi(opts, function (err) {
if (err) throw err
console.log('Outputed to ' + path.resolve(opts.output))
})