generator-nsis 0.10.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -11
- package/generators/app/index.js +8 -34
- package/generators/lib/choices.js +36 -100
- package/generators/lib/helpers.js +1 -3
- package/package.json +70 -72
package/README.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# generator-nsis
|
|
2
2
|
|
|
3
|
+
> A [Yeoman](http://yeoman.io/authoring/user-interactions.html) generator for NSIS scripts.
|
|
4
|
+
|
|
3
5
|
[](https://github.com/idleberg/generator-nsis/blob/main/LICENSE)
|
|
4
6
|
[](https://www.npmjs.org/package/generator-nsis)
|
|
5
7
|
[](https://github.com/idleberg/generator-nsis/actions)
|
|
6
8
|
|
|
7
|
-
## Description
|
|
8
|
-
|
|
9
|
-
A [Yeoman](http://yeoman.io/authoring/user-interactions.html) generator for NSIS scripts.
|
|
10
|
-
|
|
11
9
|

|
|
12
10
|
|
|
13
11
|
**Features**
|
|
@@ -17,8 +15,10 @@ A [Yeoman](http://yeoman.io/authoring/user-interactions.html) generator for NSIS
|
|
|
17
15
|
- adds core libraries (”Useful Headers”)
|
|
18
16
|
- adds callback functions
|
|
19
17
|
- adds translations
|
|
20
|
-
- adds
|
|
21
|
-
|
|
18
|
+
- adds languages (with optional dialog)
|
|
19
|
+
- defaults to SemVer
|
|
20
|
+
- SPDX license support
|
|
21
|
+
|
|
22
22
|
## Prerequisites
|
|
23
23
|
|
|
24
24
|
You need [Node.js](https://nodejs.org/en/) installed and available in your `PATH` [environment variable](http://superuser.com/a/284351/195953). Use your preferred Node package manager to install the Yeoman CLI tool.
|
|
@@ -45,11 +45,6 @@ $ yo nsis
|
|
|
45
45
|
|
|
46
46
|
*“That's all Folks!”*
|
|
47
47
|
|
|
48
|
-
## Related
|
|
49
|
-
|
|
50
|
-
- [Yeoman for Atom](https://atom.io/packages/atom-yeoman)
|
|
51
|
-
- [Yeoman for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=samverschueren.yo)
|
|
52
|
-
|
|
53
48
|
## License
|
|
54
49
|
|
|
55
50
|
This work is licensed under the [MIT License](https://opensource.org/licenses/MIT)
|
package/generators/app/index.js
CHANGED
|
@@ -23,19 +23,6 @@ export default class extends Generator {
|
|
|
23
23
|
this.debug = this.options.debug ? true : false;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// languageDialog(isUnicode) {
|
|
27
|
-
// const languageDialog = Object.entries(languageData).map(([key, value]) => {
|
|
28
|
-
// if (key === 'English') return;
|
|
29
|
-
|
|
30
|
-
// return {
|
|
31
|
-
// constant: `$\{LANG_${key.toUpperCase()}}`,
|
|
32
|
-
// string: (isUnicode) ? value.native : (value.long || key)
|
|
33
|
-
// };
|
|
34
|
-
// });
|
|
35
|
-
|
|
36
|
-
// return languageDialog;
|
|
37
|
-
// }
|
|
38
|
-
|
|
39
26
|
inquirer() {
|
|
40
27
|
return this.prompt([
|
|
41
28
|
{
|
|
@@ -54,9 +41,7 @@ export default class extends Generator {
|
|
|
54
41
|
this.looseVersion === true || semver.valid(version) !== null
|
|
55
42
|
? true
|
|
56
43
|
: `Not a valid ${terminalLink('semantic version', 'https://semver.org', {
|
|
57
|
-
fallback
|
|
58
|
-
return 'semantic version';
|
|
59
|
-
},
|
|
44
|
+
fallback: false,
|
|
60
45
|
})}`,
|
|
61
46
|
},
|
|
62
47
|
{
|
|
@@ -93,9 +78,7 @@ export default class extends Generator {
|
|
|
93
78
|
{
|
|
94
79
|
name: 'spdxQuestion',
|
|
95
80
|
message: `Choose a license from ${terminalLink('SPDX License List', 'https://spdx.org/licenses/', {
|
|
96
|
-
fallback
|
|
97
|
-
return 'SPDX License List';
|
|
98
|
-
},
|
|
81
|
+
fallback: false,
|
|
99
82
|
})}`,
|
|
100
83
|
type: 'confirm',
|
|
101
84
|
default: true,
|
|
@@ -161,23 +144,18 @@ export default class extends Generator {
|
|
|
161
144
|
}
|
|
162
145
|
},
|
|
163
146
|
},
|
|
164
|
-
{
|
|
165
|
-
name: 'editInstallerScript',
|
|
166
|
-
message: 'Edit installer script',
|
|
167
|
-
type: 'confirm',
|
|
168
|
-
default: 'true',
|
|
169
|
-
store: true,
|
|
170
|
-
when: () => {
|
|
171
|
-
return process.env.EDITOR ? true : false;
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
147
|
]).then(async props => {
|
|
175
148
|
if (this.options.debug) {
|
|
176
149
|
console.log(props);
|
|
177
150
|
}
|
|
178
151
|
|
|
179
152
|
if (typeof props.spdxLicense !== 'undefined') {
|
|
180
|
-
props.licenseText = spdxLicenseList[props.spdxLicense].licenseText
|
|
153
|
+
props.licenseText = spdxLicenseList[props.spdxLicense].licenseText
|
|
154
|
+
// normalize line endings
|
|
155
|
+
.split('\n')
|
|
156
|
+
|
|
157
|
+
// .map(line => line.trim())
|
|
158
|
+
.join(props.unicode ? '\n' : '\r\n');
|
|
181
159
|
}
|
|
182
160
|
|
|
183
161
|
if (props.name.includes('&')) {
|
|
@@ -218,10 +196,6 @@ export default class extends Generator {
|
|
|
218
196
|
licenseText: props.licenseText,
|
|
219
197
|
});
|
|
220
198
|
}
|
|
221
|
-
|
|
222
|
-
if (props.editInstallerScript === true) {
|
|
223
|
-
this.spawnCommand(process.env.EDITOR, ['installer.nsi']);
|
|
224
|
-
}
|
|
225
199
|
});
|
|
226
200
|
}
|
|
227
201
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import terminalLink from 'terminal-link';
|
|
2
2
|
|
|
3
|
-
const docsURL = 'https://github.com/NSIS-Dev/Documentation/tree/
|
|
3
|
+
const docsURL = 'https://github.com/NSIS-Dev/Documentation/tree/main/docs/';
|
|
4
4
|
|
|
5
5
|
export const binary = [false, true];
|
|
6
6
|
export const elevation = ['user', 'highest', 'admin', 'none'];
|
|
@@ -8,111 +8,63 @@ export const compression = ['zlib', 'bzip2', 'lzma'];
|
|
|
8
8
|
|
|
9
9
|
export const callbacks = [
|
|
10
10
|
{
|
|
11
|
-
name: terminalLink('.onInit',
|
|
12
|
-
fallback
|
|
13
|
-
return '.onInit';
|
|
14
|
-
},
|
|
11
|
+
name: terminalLink('.onInit', `${docsURL}/Callbacks/onInit.md`, {
|
|
12
|
+
fallback: false,
|
|
15
13
|
}),
|
|
16
14
|
value: '.onInit',
|
|
17
15
|
},
|
|
18
16
|
{
|
|
19
|
-
name: terminalLink('.onGUIInit',
|
|
20
|
-
fallback
|
|
21
|
-
return '.onGUIInit';
|
|
22
|
-
},
|
|
17
|
+
name: terminalLink('.onGUIInit', `${docsURL}/Callbacks/onGUIInit.md`, {
|
|
18
|
+
fallback: false,
|
|
23
19
|
}),
|
|
24
20
|
value: '.onGUIInit',
|
|
25
21
|
},
|
|
26
22
|
{
|
|
27
|
-
name: terminalLink('.onGUIEnd',
|
|
28
|
-
fallback
|
|
29
|
-
return '.onGUIEnd';
|
|
30
|
-
},
|
|
23
|
+
name: terminalLink('.onGUIEnd', `${docsURL}/Callbacks/onGUIEnd.md`, {
|
|
24
|
+
fallback: false,
|
|
31
25
|
}),
|
|
32
26
|
value: '.onGUIEnd',
|
|
33
27
|
},
|
|
34
28
|
{
|
|
35
|
-
name: terminalLink(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
fallback() {
|
|
40
|
-
return '.onInstSuccess';
|
|
41
|
-
},
|
|
42
|
-
}
|
|
43
|
-
),
|
|
29
|
+
name: terminalLink('.onInstSuccess', `${docsURL}/Callbacks/onInstSuccess.md`, {
|
|
30
|
+
fallback: false,
|
|
31
|
+
}),
|
|
44
32
|
value: '.onInstSuccess',
|
|
45
33
|
},
|
|
46
34
|
{
|
|
47
|
-
name: terminalLink(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{
|
|
51
|
-
fallback() {
|
|
52
|
-
return '.onInstFailed';
|
|
53
|
-
},
|
|
54
|
-
}
|
|
55
|
-
),
|
|
35
|
+
name: terminalLink('.onInstFailed', `${docsURL}/Callbacks/onInstFailed.md`, {
|
|
36
|
+
fallback: false,
|
|
37
|
+
}),
|
|
56
38
|
value: '.onInstFailed',
|
|
57
39
|
},
|
|
58
40
|
{
|
|
59
|
-
name: terminalLink(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
fallback() {
|
|
64
|
-
return '.onUserAbort';
|
|
65
|
-
},
|
|
66
|
-
}
|
|
67
|
-
),
|
|
41
|
+
name: terminalLink('.onUserAbort', `${docsURL}/Callbacks/onUserAbort.md`, {
|
|
42
|
+
fallback: false,
|
|
43
|
+
}),
|
|
68
44
|
value: '.onUserAbort',
|
|
69
45
|
},
|
|
70
46
|
{
|
|
71
|
-
name: terminalLink(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
fallback() {
|
|
76
|
-
return '.onVerifyInstDir';
|
|
77
|
-
},
|
|
78
|
-
}
|
|
79
|
-
),
|
|
47
|
+
name: terminalLink('.onVerifyInstDir', `${docsURL}/Callbacks/onVerifyInstDir.md`, {
|
|
48
|
+
fallback: false,
|
|
49
|
+
}),
|
|
80
50
|
value: '.onVerifyInstDir',
|
|
81
51
|
},
|
|
82
52
|
{
|
|
83
|
-
name: terminalLink(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
{
|
|
87
|
-
fallback() {
|
|
88
|
-
return '.onRebootFailed';
|
|
89
|
-
},
|
|
90
|
-
}
|
|
91
|
-
),
|
|
53
|
+
name: terminalLink('.onRebootFailed', `${docsURL}/Callbacks/onRebootFailed.md`, {
|
|
54
|
+
fallback: false,
|
|
55
|
+
}),
|
|
92
56
|
value: '.onRebootFailed',
|
|
93
57
|
},
|
|
94
58
|
{
|
|
95
|
-
name: terminalLink(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
{
|
|
99
|
-
fallback() {
|
|
100
|
-
return '.onSelChange';
|
|
101
|
-
},
|
|
102
|
-
}
|
|
103
|
-
),
|
|
59
|
+
name: terminalLink('.onSelChange', `${docsURL}/Callbacks/onSelChange.md`, {
|
|
60
|
+
fallback: false,
|
|
61
|
+
}),
|
|
104
62
|
value: '.onSelChange',
|
|
105
63
|
},
|
|
106
64
|
{
|
|
107
|
-
name: terminalLink(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
fallback() {
|
|
112
|
-
return '.onMouseOverSection';
|
|
113
|
-
},
|
|
114
|
-
}
|
|
115
|
-
),
|
|
65
|
+
name: terminalLink('.onMouseOverSection', `${docsURL}/Callbacks/onMouseOverSection.md`, {
|
|
66
|
+
fallback: false,
|
|
67
|
+
}),
|
|
116
68
|
value: '.onMouseOverSection',
|
|
117
69
|
},
|
|
118
70
|
];
|
|
@@ -125,9 +77,7 @@ export const includes = [
|
|
|
125
77
|
},
|
|
126
78
|
{
|
|
127
79
|
name: terminalLink('FileFunc.nsh', `${docsURL}/Includes/FileFunc`, {
|
|
128
|
-
fallback
|
|
129
|
-
return 'FileFunc.nsh';
|
|
130
|
-
},
|
|
80
|
+
fallback: false,
|
|
131
81
|
}),
|
|
132
82
|
value: 'FileFunc',
|
|
133
83
|
checked: false,
|
|
@@ -154,18 +104,14 @@ export const includes = [
|
|
|
154
104
|
},
|
|
155
105
|
{
|
|
156
106
|
name: terminalLink('LogicLib.nsh', `${docsURL}/Includes/LogicLib`, {
|
|
157
|
-
fallback
|
|
158
|
-
return 'LogicLib.nsh';
|
|
159
|
-
},
|
|
107
|
+
fallback: false,
|
|
160
108
|
}),
|
|
161
109
|
value: 'LogicLib',
|
|
162
110
|
checked: false,
|
|
163
111
|
},
|
|
164
112
|
{
|
|
165
113
|
name: terminalLink('Memento.nsh', `${docsURL}/Includes/Memento`, {
|
|
166
|
-
fallback
|
|
167
|
-
return 'Memento.nsh';
|
|
168
|
-
},
|
|
114
|
+
fallback: false,
|
|
169
115
|
}),
|
|
170
116
|
value: 'Memento',
|
|
171
117
|
checked: false,
|
|
@@ -197,18 +143,14 @@ export const includes = [
|
|
|
197
143
|
},
|
|
198
144
|
{
|
|
199
145
|
name: terminalLink('StrFunc.nsh', `${docsURL}/Includes/StrFunc`, {
|
|
200
|
-
fallback
|
|
201
|
-
return 'StrFunc.nsh';
|
|
202
|
-
},
|
|
146
|
+
fallback: false,
|
|
203
147
|
}),
|
|
204
148
|
value: 'StrFunc',
|
|
205
149
|
checked: false,
|
|
206
150
|
},
|
|
207
151
|
{
|
|
208
152
|
name: terminalLink('TextFunc.nsh', `${docsURL}/Includes/TextFunc`, {
|
|
209
|
-
fallback
|
|
210
|
-
return 'TextFunc.nsh';
|
|
211
|
-
},
|
|
153
|
+
fallback: false,
|
|
212
154
|
}),
|
|
213
155
|
value: 'TextFunc',
|
|
214
156
|
checked: false,
|
|
@@ -245,27 +187,21 @@ export const includes = [
|
|
|
245
187
|
},
|
|
246
188
|
{
|
|
247
189
|
name: terminalLink('WinVer.nsh', `${docsURL}/Includes/WinVer`, {
|
|
248
|
-
fallback
|
|
249
|
-
return 'WinVer.nsh';
|
|
250
|
-
},
|
|
190
|
+
fallback: false,
|
|
251
191
|
}),
|
|
252
192
|
value: 'WinVer',
|
|
253
193
|
checked: false,
|
|
254
194
|
},
|
|
255
195
|
{
|
|
256
196
|
name: terminalLink('WordFunc.nsh', `${docsURL}/Includes/WordFunc`, {
|
|
257
|
-
fallback
|
|
258
|
-
return 'WordFunc.nsh';
|
|
259
|
-
},
|
|
197
|
+
fallback: false,
|
|
260
198
|
}),
|
|
261
199
|
value: 'WordFunc',
|
|
262
200
|
checked: false,
|
|
263
201
|
},
|
|
264
202
|
{
|
|
265
203
|
name: terminalLink('x64.nsh', `${docsURL}/Includes/x64`, {
|
|
266
|
-
fallback
|
|
267
|
-
return 'x64.nsh';
|
|
268
|
-
},
|
|
204
|
+
fallback: false,
|
|
269
205
|
}),
|
|
270
206
|
value: 'x64',
|
|
271
207
|
checked: false,
|
|
@@ -11,9 +11,7 @@ const spdxCodes = Object.getOwnPropertyNames(spdxLicenseList).sort();
|
|
|
11
11
|
export const licenseChoices = spdxCodes.map(obj => {
|
|
12
12
|
const licenses = {};
|
|
13
13
|
licenses['name'] = terminalLink(obj, `https://spdx.org/licenses/${obj}.html`, {
|
|
14
|
-
fallback
|
|
15
|
-
return obj;
|
|
16
|
-
},
|
|
14
|
+
fallback: true,
|
|
17
15
|
});
|
|
18
16
|
licenses['value'] = obj;
|
|
19
17
|
|
package/package.json
CHANGED
|
@@ -1,73 +1,71 @@
|
|
|
1
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
|
-
}
|
|
2
|
+
"name": "generator-nsis",
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "Yeoman generator for NSIS scripts",
|
|
5
|
+
"author": "Jan T. Sott",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"yeoman-generator",
|
|
9
|
+
"nsis",
|
|
10
|
+
"nullsoft",
|
|
11
|
+
"installer",
|
|
12
|
+
"setup"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": "./generators/app",
|
|
16
|
+
"files": [
|
|
17
|
+
"generators",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/idleberg/generator-nsis"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@nsis/language-data": "^0.9.2",
|
|
30
|
+
"@sindresorhus/slugify": "^2.2.1",
|
|
31
|
+
"glob": "^10.3.12",
|
|
32
|
+
"makensis": "^3.0.0-alpha.3",
|
|
33
|
+
"semver": "^7.6.0",
|
|
34
|
+
"spdx-license-list": "^6.9.0",
|
|
35
|
+
"terminal-link": "^3.0.0",
|
|
36
|
+
"yeoman-generator": "^7.1.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@lukeed/uuid": "^2.0.1",
|
|
40
|
+
"ejs-lint": "^2.0.0",
|
|
41
|
+
"eslint": "^8.57.0",
|
|
42
|
+
"eslint-plugin-json": "^3.1.0",
|
|
43
|
+
"husky": "^9.0.11",
|
|
44
|
+
"lint-staged": "^15.2.2",
|
|
45
|
+
"mem-fs": "^4.1.0",
|
|
46
|
+
"np": "^10.0.2",
|
|
47
|
+
"npm-run-all2": "^6.1.2",
|
|
48
|
+
"prettier": "^3.2.5",
|
|
49
|
+
"rimraf": "^5.0.5",
|
|
50
|
+
"tsm": "^2.3.0",
|
|
51
|
+
"uvu": "^0.5.6",
|
|
52
|
+
"yeoman-assert": "^3.1.1",
|
|
53
|
+
"yeoman-environment": "^4.4.0",
|
|
54
|
+
"yeoman-test": "^8.2.0"
|
|
55
|
+
},
|
|
56
|
+
"lint-staged": {
|
|
57
|
+
"*.ejs": "ejslint",
|
|
58
|
+
"*.(js|json)": [
|
|
59
|
+
"eslint --cache --fix",
|
|
60
|
+
"prettier --write"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"packageManager": "pnpm@8.15.2+sha256.90bb5d6382cb2cb8b8d4959a076b3953d84d1d94121717097bcd41c71344fa14",
|
|
64
|
+
"scripts": {
|
|
65
|
+
"lint:ejs": "ejslint generators/**/*.ejs",
|
|
66
|
+
"lint:js": "eslint generators/**/*.js --ignore-path .gitignore",
|
|
67
|
+
"lint:json": "eslint ./*.json --ignore-path .gitignore",
|
|
68
|
+
"lint": "npm-run-all --parallel lint:*",
|
|
69
|
+
"test": "uvu --ignore test/__helper.js"
|
|
70
|
+
}
|
|
71
|
+
}
|