generator-nsis 0.10.0 → 0.10.2
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/generators/app/index.js +45 -51
- package/generators/lib/choices.js +104 -76
- package/generators/lib/helpers.js +7 -7
- package/package.json +71 -65
- package/license.txt +0 -7
package/generators/app/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { meta as languageData } from '@nsis/language-data';
|
|
3
2
|
|
|
4
3
|
import { getAllLibraries, getLanguageChoices, licenseChoices } from '../lib/helpers.js';
|
|
@@ -18,10 +17,10 @@ export default class extends Generator {
|
|
|
18
17
|
this.option('unlock-all', { desc: 'Unlocks all disabled features', default: false });
|
|
19
18
|
this.option('debug', { desc: 'Prints debug messages', default: false });
|
|
20
19
|
|
|
21
|
-
this.looseVersion =
|
|
22
|
-
this.disabled =
|
|
23
|
-
this.firstParty =
|
|
24
|
-
this.debug =
|
|
20
|
+
this.looseVersion = this.options.looseVersion ? true : false;
|
|
21
|
+
this.disabled = this.options.unlockAll ? false : true;
|
|
22
|
+
this.firstParty = this.options.firstParty ? true : false;
|
|
23
|
+
this.debug = this.options.debug ? true : false;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
// languageDialog(isUnicode) {
|
|
@@ -44,25 +43,28 @@ export default class extends Generator {
|
|
|
44
43
|
message: `Application name`,
|
|
45
44
|
default: slugify(this.appname),
|
|
46
45
|
store: true,
|
|
47
|
-
validate: name => (name.trim().length > 0
|
|
46
|
+
validate: name => (name.trim().length > 0 ? true : 'Not a valid name'),
|
|
48
47
|
},
|
|
49
48
|
{
|
|
50
49
|
name: 'version',
|
|
51
50
|
message: `Application version`,
|
|
52
51
|
default: '0.0.0',
|
|
53
52
|
store: true,
|
|
54
|
-
validate: version =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
validate: version =>
|
|
54
|
+
this.looseVersion === true || semver.valid(version) !== null
|
|
55
|
+
? true
|
|
56
|
+
: `Not a valid ${terminalLink('semantic version', 'https://semver.org', {
|
|
57
|
+
fallback() {
|
|
58
|
+
return 'semantic version';
|
|
59
|
+
},
|
|
60
|
+
})}`,
|
|
59
61
|
},
|
|
60
62
|
{
|
|
61
63
|
name: 'unicode',
|
|
62
64
|
message: 'Unicode installer',
|
|
63
65
|
type: 'confirm',
|
|
64
66
|
default: 'true',
|
|
65
|
-
store: true
|
|
67
|
+
store: true,
|
|
66
68
|
},
|
|
67
69
|
{
|
|
68
70
|
name: 'elevation',
|
|
@@ -70,35 +72,35 @@ export default class extends Generator {
|
|
|
70
72
|
type: 'list',
|
|
71
73
|
default: 'user',
|
|
72
74
|
store: true,
|
|
73
|
-
choices: choices.elevation
|
|
75
|
+
choices: choices.elevation,
|
|
74
76
|
},
|
|
75
|
-
|
|
77
|
+
{
|
|
76
78
|
name: 'compression',
|
|
77
79
|
message: 'Set compression',
|
|
78
80
|
type: 'list',
|
|
79
81
|
default: 'lzma',
|
|
80
82
|
store: true,
|
|
81
|
-
choices: choices.compression
|
|
83
|
+
choices: choices.compression,
|
|
82
84
|
},
|
|
83
85
|
{
|
|
84
86
|
name: 'pages',
|
|
85
87
|
message: 'Installer pages',
|
|
86
88
|
type: 'checkbox',
|
|
87
89
|
store: true,
|
|
88
|
-
default: [
|
|
89
|
-
choices: choices.pages
|
|
90
|
+
default: ['instfiles'],
|
|
91
|
+
choices: choices.pages,
|
|
90
92
|
},
|
|
91
93
|
{
|
|
92
94
|
name: 'spdxQuestion',
|
|
93
95
|
message: `Choose a license from ${terminalLink('SPDX License List', 'https://spdx.org/licenses/', {
|
|
94
96
|
fallback() {
|
|
95
|
-
return 'SPDX License List'
|
|
96
|
-
}
|
|
97
|
+
return 'SPDX License List';
|
|
98
|
+
},
|
|
97
99
|
})}`,
|
|
98
100
|
type: 'confirm',
|
|
99
101
|
default: true,
|
|
100
102
|
store: true,
|
|
101
|
-
when: answers => answers.pages?.includes('license') ? true : false
|
|
103
|
+
when: answers => (answers.pages?.includes('license') ? true : false),
|
|
102
104
|
},
|
|
103
105
|
{
|
|
104
106
|
name: 'spdxLicense',
|
|
@@ -107,14 +109,14 @@ export default class extends Generator {
|
|
|
107
109
|
default: 'MIT',
|
|
108
110
|
choices: licenseChoices,
|
|
109
111
|
store: true,
|
|
110
|
-
when: answers => answers.pages?.includes('license') && answers.spdxQuestion ? true : false
|
|
112
|
+
when: answers => (answers.pages?.includes('license') && answers.spdxQuestion ? true : false),
|
|
111
113
|
},
|
|
112
114
|
{
|
|
113
115
|
name: 'sections',
|
|
114
116
|
message: 'Number of sections',
|
|
115
117
|
default: 1,
|
|
116
118
|
store: true,
|
|
117
|
-
validate: number => (Number.isInteger(parseInt(number)) && parseInt(number) > 0
|
|
119
|
+
validate: number => (Number.isInteger(parseInt(number)) && parseInt(number) > 0 ? true : 'Not a valid integer'),
|
|
118
120
|
},
|
|
119
121
|
{
|
|
120
122
|
name: 'callbacks',
|
|
@@ -122,7 +124,7 @@ export default class extends Generator {
|
|
|
122
124
|
type: 'checkbox',
|
|
123
125
|
store: true,
|
|
124
126
|
default: [],
|
|
125
|
-
choices: choices.callbacks
|
|
127
|
+
choices: choices.callbacks,
|
|
126
128
|
},
|
|
127
129
|
{
|
|
128
130
|
name: 'includes',
|
|
@@ -130,16 +132,17 @@ export default class extends Generator {
|
|
|
130
132
|
type: 'checkbox',
|
|
131
133
|
store: true,
|
|
132
134
|
default: [],
|
|
133
|
-
choices: async () => this.firstParty ? choices.includes : await getAllLibraries(),
|
|
134
|
-
validate: callbacks =>
|
|
135
|
+
choices: async () => (this.firstParty ? choices.includes : await getAllLibraries()),
|
|
136
|
+
validate: callbacks =>
|
|
137
|
+
callbacks.includes('MUI') && callbacks.includes('MUI2') ? "Don't mix MUI versions" : true,
|
|
135
138
|
},
|
|
136
139
|
{
|
|
137
140
|
name: 'languages',
|
|
138
|
-
message:
|
|
141
|
+
message: this.disabled === true ? 'Add languages other than English' : 'Add languages',
|
|
139
142
|
type: 'checkbox',
|
|
140
143
|
store: true,
|
|
141
144
|
default: [],
|
|
142
|
-
choices: getLanguageChoices(this.disabled)
|
|
145
|
+
choices: getLanguageChoices(this.disabled),
|
|
143
146
|
},
|
|
144
147
|
{
|
|
145
148
|
name: 'languageDialog',
|
|
@@ -149,14 +152,14 @@ export default class extends Generator {
|
|
|
149
152
|
store: true,
|
|
150
153
|
when: answers => {
|
|
151
154
|
switch (true) {
|
|
152
|
-
case
|
|
153
|
-
case
|
|
155
|
+
case this.options['unlock-all'] === true && answers.languages?.length > 1:
|
|
156
|
+
case this.options['unlock-all'] === false && answers.languages?.length > 0:
|
|
154
157
|
return true;
|
|
155
158
|
|
|
156
159
|
default:
|
|
157
160
|
return false;
|
|
158
161
|
}
|
|
159
|
-
}
|
|
162
|
+
},
|
|
160
163
|
},
|
|
161
164
|
{
|
|
162
165
|
name: 'editInstallerScript',
|
|
@@ -165,11 +168,10 @@ export default class extends Generator {
|
|
|
165
168
|
default: 'true',
|
|
166
169
|
store: true,
|
|
167
170
|
when: () => {
|
|
168
|
-
return
|
|
169
|
-
}
|
|
171
|
+
return process.env.EDITOR ? true : false;
|
|
172
|
+
},
|
|
170
173
|
},
|
|
171
174
|
]).then(async props => {
|
|
172
|
-
|
|
173
175
|
if (this.options.debug) {
|
|
174
176
|
console.log(props);
|
|
175
177
|
}
|
|
@@ -204,29 +206,21 @@ export default class extends Generator {
|
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
208
|
|
|
207
|
-
await this.fs.copyTplAsync(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
unlockAll: this.options['unlock-all'],
|
|
214
|
-
debug: this.options.debug
|
|
215
|
-
}
|
|
216
|
-
);
|
|
209
|
+
await this.fs.copyTplAsync(this.templatePath('installer.nsi.ejs'), this.destinationPath('installer.nsi'), {
|
|
210
|
+
languageData: languageData,
|
|
211
|
+
pkg: props,
|
|
212
|
+
unlockAll: this.options['unlock-all'],
|
|
213
|
+
debug: this.options.debug,
|
|
214
|
+
});
|
|
217
215
|
|
|
218
216
|
if (typeof props.spdxLicense !== 'undefined') {
|
|
219
|
-
await this.fs.copyTplAsync(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
{
|
|
223
|
-
licenseText: props.licenseText
|
|
224
|
-
}
|
|
225
|
-
);
|
|
217
|
+
await this.fs.copyTplAsync(this.templatePath('license.txt.ejs'), this.destinationPath('license.txt'), {
|
|
218
|
+
licenseText: props.licenseText,
|
|
219
|
+
});
|
|
226
220
|
}
|
|
227
221
|
|
|
228
222
|
if (props.editInstallerScript === true) {
|
|
229
|
-
this.spawnCommand(process.env.EDITOR, [
|
|
223
|
+
this.spawnCommand(process.env.EDITOR, ['installer.nsi']);
|
|
230
224
|
}
|
|
231
225
|
});
|
|
232
226
|
}
|
|
@@ -11,81 +11,109 @@ export const callbacks = [
|
|
|
11
11
|
name: terminalLink('.onInit', 'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onInit.md', {
|
|
12
12
|
fallback() {
|
|
13
13
|
return '.onInit';
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
15
|
}),
|
|
16
|
-
value: '.onInit'
|
|
16
|
+
value: '.onInit',
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
name: terminalLink('.onGUIInit', 'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onGUIInit.md', {
|
|
20
20
|
fallback() {
|
|
21
21
|
return '.onGUIInit';
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
23
|
}),
|
|
24
|
-
value: '.onGUIInit'
|
|
24
|
+
value: '.onGUIInit',
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
name: terminalLink('.onGUIEnd', 'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onGUIEnd.md', {
|
|
28
28
|
fallback() {
|
|
29
29
|
return '.onGUIEnd';
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
31
|
}),
|
|
32
|
-
value: '.onGUIEnd'
|
|
32
|
+
value: '.onGUIEnd',
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
name: terminalLink(
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
name: terminalLink(
|
|
36
|
+
'.onInstSuccess',
|
|
37
|
+
'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onInstSuccess.md',
|
|
38
|
+
{
|
|
39
|
+
fallback() {
|
|
40
|
+
return '.onInstSuccess';
|
|
41
|
+
},
|
|
38
42
|
}
|
|
39
|
-
|
|
40
|
-
value: '.onInstSuccess'
|
|
43
|
+
),
|
|
44
|
+
value: '.onInstSuccess',
|
|
41
45
|
},
|
|
42
46
|
{
|
|
43
|
-
name: terminalLink(
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
name: terminalLink(
|
|
48
|
+
'.onInstFailed',
|
|
49
|
+
'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onInstFailed.md',
|
|
50
|
+
{
|
|
51
|
+
fallback() {
|
|
52
|
+
return '.onInstFailed';
|
|
53
|
+
},
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
value: '.onInstFailed'
|
|
55
|
+
),
|
|
56
|
+
value: '.onInstFailed',
|
|
49
57
|
},
|
|
50
58
|
{
|
|
51
|
-
name: terminalLink(
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
name: terminalLink(
|
|
60
|
+
'.onUserAbort',
|
|
61
|
+
'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onUserAbort.md',
|
|
62
|
+
{
|
|
63
|
+
fallback() {
|
|
64
|
+
return '.onUserAbort';
|
|
65
|
+
},
|
|
54
66
|
}
|
|
55
|
-
|
|
56
|
-
value: '.onUserAbort'
|
|
67
|
+
),
|
|
68
|
+
value: '.onUserAbort',
|
|
57
69
|
},
|
|
58
70
|
{
|
|
59
|
-
name: terminalLink(
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
name: terminalLink(
|
|
72
|
+
'.onVerifyInstDir',
|
|
73
|
+
'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onVerifyInstDir.md',
|
|
74
|
+
{
|
|
75
|
+
fallback() {
|
|
76
|
+
return '.onVerifyInstDir';
|
|
77
|
+
},
|
|
62
78
|
}
|
|
63
|
-
|
|
64
|
-
value: '.onVerifyInstDir'
|
|
79
|
+
),
|
|
80
|
+
value: '.onVerifyInstDir',
|
|
65
81
|
},
|
|
66
82
|
{
|
|
67
|
-
name: terminalLink(
|
|
68
|
-
|
|
69
|
-
|
|
83
|
+
name: terminalLink(
|
|
84
|
+
'.onRebootFailed',
|
|
85
|
+
'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onRebootFailed.md',
|
|
86
|
+
{
|
|
87
|
+
fallback() {
|
|
88
|
+
return '.onRebootFailed';
|
|
89
|
+
},
|
|
70
90
|
}
|
|
71
|
-
|
|
72
|
-
value: '.onRebootFailed'
|
|
91
|
+
),
|
|
92
|
+
value: '.onRebootFailed',
|
|
73
93
|
},
|
|
74
94
|
{
|
|
75
|
-
name: terminalLink(
|
|
76
|
-
|
|
77
|
-
|
|
95
|
+
name: terminalLink(
|
|
96
|
+
'.onSelChange',
|
|
97
|
+
'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onSelChange.md',
|
|
98
|
+
{
|
|
99
|
+
fallback() {
|
|
100
|
+
return '.onSelChange';
|
|
101
|
+
},
|
|
78
102
|
}
|
|
79
|
-
|
|
80
|
-
value: '.onSelChange'
|
|
103
|
+
),
|
|
104
|
+
value: '.onSelChange',
|
|
81
105
|
},
|
|
82
106
|
{
|
|
83
|
-
name: terminalLink(
|
|
84
|
-
|
|
85
|
-
|
|
107
|
+
name: terminalLink(
|
|
108
|
+
'.onMouseOverSection',
|
|
109
|
+
'https://github.com/NSIS-Dev/Documentation/blob/master/Callbacks/onMouseOverSection.md',
|
|
110
|
+
{
|
|
111
|
+
fallback() {
|
|
112
|
+
return '.onMouseOverSection';
|
|
113
|
+
},
|
|
86
114
|
}
|
|
87
|
-
|
|
88
|
-
value: '.onMouseOverSection'
|
|
115
|
+
),
|
|
116
|
+
value: '.onMouseOverSection',
|
|
89
117
|
},
|
|
90
118
|
];
|
|
91
119
|
|
|
@@ -93,155 +121,155 @@ export const includes = [
|
|
|
93
121
|
{
|
|
94
122
|
name: 'Colors.nsh',
|
|
95
123
|
value: 'Colors',
|
|
96
|
-
checked: false
|
|
124
|
+
checked: false,
|
|
97
125
|
},
|
|
98
126
|
{
|
|
99
127
|
name: terminalLink('FileFunc.nsh', `${docsURL}/Includes/FileFunc`, {
|
|
100
128
|
fallback() {
|
|
101
129
|
return 'FileFunc.nsh';
|
|
102
|
-
}
|
|
130
|
+
},
|
|
103
131
|
}),
|
|
104
132
|
value: 'FileFunc',
|
|
105
|
-
checked: false
|
|
133
|
+
checked: false,
|
|
106
134
|
},
|
|
107
135
|
{
|
|
108
136
|
name: 'InstallOptions.nsh',
|
|
109
137
|
value: 'InstallOptions',
|
|
110
|
-
checked: false
|
|
138
|
+
checked: false,
|
|
111
139
|
},
|
|
112
140
|
{
|
|
113
141
|
name: 'Integration.nsh',
|
|
114
142
|
value: 'Integration',
|
|
115
|
-
checked: false
|
|
143
|
+
checked: false,
|
|
116
144
|
},
|
|
117
145
|
{
|
|
118
146
|
name: 'LangFile.nsh',
|
|
119
147
|
value: 'LangFile',
|
|
120
|
-
checked: false
|
|
148
|
+
checked: false,
|
|
121
149
|
},
|
|
122
150
|
{
|
|
123
151
|
name: 'Library.nsh',
|
|
124
152
|
value: 'Library',
|
|
125
|
-
checked: false
|
|
153
|
+
checked: false,
|
|
126
154
|
},
|
|
127
155
|
{
|
|
128
156
|
name: terminalLink('LogicLib.nsh', `${docsURL}/Includes/LogicLib`, {
|
|
129
157
|
fallback() {
|
|
130
158
|
return 'LogicLib.nsh';
|
|
131
|
-
}
|
|
159
|
+
},
|
|
132
160
|
}),
|
|
133
161
|
value: 'LogicLib',
|
|
134
|
-
checked: false
|
|
162
|
+
checked: false,
|
|
135
163
|
},
|
|
136
164
|
{
|
|
137
165
|
name: terminalLink('Memento.nsh', `${docsURL}/Includes/Memento`, {
|
|
138
166
|
fallback() {
|
|
139
167
|
return 'Memento.nsh';
|
|
140
|
-
}
|
|
168
|
+
},
|
|
141
169
|
}),
|
|
142
170
|
value: 'Memento',
|
|
143
|
-
checked: false
|
|
171
|
+
checked: false,
|
|
144
172
|
},
|
|
145
173
|
{
|
|
146
174
|
name: 'MUI.nsh',
|
|
147
175
|
value: 'MUI',
|
|
148
|
-
checked: false
|
|
176
|
+
checked: false,
|
|
149
177
|
},
|
|
150
178
|
{
|
|
151
179
|
name: 'MUI2.nsh',
|
|
152
180
|
value: 'MUI2',
|
|
153
|
-
checked: false
|
|
181
|
+
checked: false,
|
|
154
182
|
},
|
|
155
183
|
{
|
|
156
184
|
name: 'MultiUser.nsh',
|
|
157
185
|
value: 'MultiUser',
|
|
158
|
-
checked: false
|
|
186
|
+
checked: false,
|
|
159
187
|
},
|
|
160
188
|
{
|
|
161
189
|
name: 'nsDialogs.nsh',
|
|
162
190
|
value: 'nsDialogs',
|
|
163
|
-
checked: false
|
|
191
|
+
checked: false,
|
|
164
192
|
},
|
|
165
193
|
{
|
|
166
194
|
name: 'Sections.nsh',
|
|
167
195
|
value: 'Sections',
|
|
168
|
-
checked: false
|
|
196
|
+
checked: false,
|
|
169
197
|
},
|
|
170
198
|
{
|
|
171
199
|
name: terminalLink('StrFunc.nsh', `${docsURL}/Includes/StrFunc`, {
|
|
172
200
|
fallback() {
|
|
173
201
|
return 'StrFunc.nsh';
|
|
174
|
-
}
|
|
202
|
+
},
|
|
175
203
|
}),
|
|
176
204
|
value: 'StrFunc',
|
|
177
|
-
checked: false
|
|
205
|
+
checked: false,
|
|
178
206
|
},
|
|
179
207
|
{
|
|
180
208
|
name: terminalLink('TextFunc.nsh', `${docsURL}/Includes/TextFunc`, {
|
|
181
209
|
fallback() {
|
|
182
210
|
return 'TextFunc.nsh';
|
|
183
|
-
}
|
|
211
|
+
},
|
|
184
212
|
}),
|
|
185
213
|
value: 'TextFunc',
|
|
186
|
-
checked: false
|
|
214
|
+
checked: false,
|
|
187
215
|
},
|
|
188
216
|
{
|
|
189
217
|
name: 'UpgradeDLL.nsh',
|
|
190
218
|
value: 'UpgradeDLL',
|
|
191
|
-
checked: false
|
|
219
|
+
checked: false,
|
|
192
220
|
},
|
|
193
221
|
{
|
|
194
222
|
name: 'Util.nsh',
|
|
195
223
|
value: 'Util',
|
|
196
|
-
checked: false
|
|
224
|
+
checked: false,
|
|
197
225
|
},
|
|
198
226
|
{
|
|
199
227
|
name: 'VB6RunTime.nsh',
|
|
200
228
|
value: 'VB6RunTime',
|
|
201
|
-
checked: false
|
|
229
|
+
checked: false,
|
|
202
230
|
},
|
|
203
231
|
{
|
|
204
232
|
name: 'VPatchLib.nsh',
|
|
205
233
|
value: 'VPatchLib',
|
|
206
|
-
checked: false
|
|
234
|
+
checked: false,
|
|
207
235
|
},
|
|
208
236
|
{
|
|
209
237
|
name: 'WinCore.nsh',
|
|
210
238
|
value: 'WinCore',
|
|
211
|
-
checked: false
|
|
239
|
+
checked: false,
|
|
212
240
|
},
|
|
213
241
|
{
|
|
214
242
|
name: 'WinMessages.nsh',
|
|
215
243
|
value: 'WinMessages',
|
|
216
|
-
checked: false
|
|
244
|
+
checked: false,
|
|
217
245
|
},
|
|
218
246
|
{
|
|
219
247
|
name: terminalLink('WinVer.nsh', `${docsURL}/Includes/WinVer`, {
|
|
220
248
|
fallback() {
|
|
221
249
|
return 'WinVer.nsh';
|
|
222
|
-
}
|
|
250
|
+
},
|
|
223
251
|
}),
|
|
224
252
|
value: 'WinVer',
|
|
225
|
-
checked: false
|
|
253
|
+
checked: false,
|
|
226
254
|
},
|
|
227
255
|
{
|
|
228
256
|
name: terminalLink('WordFunc.nsh', `${docsURL}/Includes/WordFunc`, {
|
|
229
257
|
fallback() {
|
|
230
258
|
return 'WordFunc.nsh';
|
|
231
|
-
}
|
|
259
|
+
},
|
|
232
260
|
}),
|
|
233
261
|
value: 'WordFunc',
|
|
234
|
-
checked: false
|
|
262
|
+
checked: false,
|
|
235
263
|
},
|
|
236
264
|
{
|
|
237
265
|
name: terminalLink('x64.nsh', `${docsURL}/Includes/x64`, {
|
|
238
266
|
fallback() {
|
|
239
267
|
return 'x64.nsh';
|
|
240
|
-
}
|
|
268
|
+
},
|
|
241
269
|
}),
|
|
242
270
|
value: 'x64',
|
|
243
|
-
checked: false
|
|
244
|
-
}
|
|
271
|
+
checked: false,
|
|
272
|
+
},
|
|
245
273
|
];
|
|
246
274
|
|
|
247
275
|
export const pages = [
|
|
@@ -260,6 +288,6 @@ export const pages = [
|
|
|
260
288
|
{
|
|
261
289
|
name: 'instfiles',
|
|
262
290
|
value: 'instfiles',
|
|
263
|
-
checked: true
|
|
264
|
-
}
|
|
291
|
+
checked: true,
|
|
292
|
+
},
|
|
265
293
|
];
|
|
@@ -13,7 +13,7 @@ export const licenseChoices = spdxCodes.map(obj => {
|
|
|
13
13
|
licenses['name'] = terminalLink(obj, `https://spdx.org/licenses/${obj}.html`, {
|
|
14
14
|
fallback() {
|
|
15
15
|
return obj;
|
|
16
|
-
}
|
|
16
|
+
},
|
|
17
17
|
});
|
|
18
18
|
licenses['value'] = obj;
|
|
19
19
|
|
|
@@ -22,18 +22,18 @@ export const licenseChoices = spdxCodes.map(obj => {
|
|
|
22
22
|
|
|
23
23
|
export const getAllLibraries = async () => {
|
|
24
24
|
const nsisPath = await nsisDir();
|
|
25
|
-
const includeDir = resolve(nsisPath, 'Include')
|
|
25
|
+
const includeDir = resolve(nsisPath, 'Include');
|
|
26
26
|
|
|
27
27
|
const headerFiles = await glob([`${includeDir}/*.nsh`, `!${includeDir}/MUI.nsh`], {
|
|
28
|
-
ignore: bundledLibraries.map(excludedFile => `${includeDir}/${excludedFile.value}.nsh`)
|
|
28
|
+
ignore: bundledLibraries.map(excludedFile => `${includeDir}/${excludedFile.value}.nsh`),
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const customHeaders = headerFiles.map(headerFile => {
|
|
32
32
|
return {
|
|
33
33
|
name: `${basename(headerFile)} [3rd party]`,
|
|
34
34
|
value: basename(headerFile, extname(headerFile)),
|
|
35
|
-
checked: false
|
|
36
|
-
}
|
|
35
|
+
checked: false,
|
|
36
|
+
};
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const allLibraries = [...bundledLibraries, ...customHeaders];
|
|
@@ -43,13 +43,13 @@ export const getAllLibraries = async () => {
|
|
|
43
43
|
|
|
44
44
|
export function getLanguageChoices(disabled) {
|
|
45
45
|
const languageChoices = Object.entries(languageData).map(([key, value]) => {
|
|
46
|
-
const isDisabled =
|
|
46
|
+
const isDisabled = key === 'English' ? disabled : false;
|
|
47
47
|
|
|
48
48
|
// Use long names
|
|
49
49
|
return {
|
|
50
50
|
name: value.english || key,
|
|
51
51
|
value: key,
|
|
52
|
-
disabled: isDisabled
|
|
52
|
+
disabled: isDisabled,
|
|
53
53
|
};
|
|
54
54
|
});
|
|
55
55
|
|
package/package.json
CHANGED
|
@@ -1,67 +1,73 @@
|
|
|
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
|
-
|
|
2
|
+
"name": "generator-nsis",
|
|
3
|
+
"version": "0.10.2",
|
|
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
|
+
"scripts": {
|
|
22
|
+
"lint:ejs": "ejslint generators/**/*.ejs",
|
|
23
|
+
"lint:js": "eslint generators/**/*.js --ignore-path .gitignore",
|
|
24
|
+
"lint:json": "eslint ./*.json --ignore-path .gitignore",
|
|
25
|
+
"lint": "npm-run-all --parallel lint:*",
|
|
26
|
+
"prepack": "rimraf installer.nsi license.txt",
|
|
27
|
+
"prepare": "husky",
|
|
28
|
+
"publish": "np --no-yarn",
|
|
29
|
+
"test": "uvu --ignore test/__helper.js"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/idleberg/generator-nsis"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@nsis/language-data": "^0.9.2",
|
|
40
|
+
"@sindresorhus/slugify": "^2.2.1",
|
|
41
|
+
"glob": "^10.3.10",
|
|
42
|
+
"makensis": "^2.0.8",
|
|
43
|
+
"semver": "^7.5.4",
|
|
44
|
+
"spdx-license-list": "^6.8.0",
|
|
45
|
+
"terminal-link": "^3.0.0",
|
|
46
|
+
"yeoman-generator": "^7.1.1"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@lukeed/uuid": "^2.0.1",
|
|
50
|
+
"ejs-lint": "^2.0.0",
|
|
51
|
+
"eslint": "^8.56.0",
|
|
52
|
+
"eslint-plugin-json": "^3.1.0",
|
|
53
|
+
"husky": "^9.0.7",
|
|
54
|
+
"lint-staged": "^15.2.0",
|
|
55
|
+
"mem-fs": "^4.0.0",
|
|
56
|
+
"np": "^9.2.0",
|
|
57
|
+
"npm-run-all2": "^6.1.1",
|
|
58
|
+
"prettier": "^3.2.4",
|
|
59
|
+
"rimraf": "^5.0.5",
|
|
60
|
+
"tsm": "^2.3.0",
|
|
61
|
+
"uvu": "^0.5.6",
|
|
62
|
+
"yeoman-assert": "^3.1.1",
|
|
63
|
+
"yeoman-environment": "^4.3.0",
|
|
64
|
+
"yeoman-test": "^8.2.0"
|
|
65
|
+
},
|
|
66
|
+
"lint-staged": {
|
|
67
|
+
"*.ejs": "ejslint",
|
|
68
|
+
"*.(js|json)": [
|
|
69
|
+
"eslint --cache --fix",
|
|
70
|
+
"prettier --write"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
67
73
|
}
|
package/license.txt
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<copyright notice>
|
|
2
|
-
|
|
3
|
-
By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, and will comply with the following terms and conditions:
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and distribute this software and its associated documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the copyright holder not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.
|
|
6
|
-
|
|
7
|
-
THE COPYRIGHT HOLDER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|