Skip to content

Commit 9762991

Browse files
worldjoedevelar
authored andcommitted
feat(nsis): option NSIS warnings as errors
Closes #763
1 parent 30426b3 commit 9762991

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/metadata.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,15 @@ export interface NsisOptions {
354354
* [LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`).
355355
*/
356356
readonly language?: string | null
357+
358+
/*
359+
Defaults to `false`.
360+
361+
If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors.
362+
363+
If `warningsAsErrors` is `false`: NSIS will allow warnings.
364+
*/
365+
readonly warningsAsErrors?: boolean | null
357366
}
358367

359368
/*
@@ -584,4 +593,4 @@ export function archFromString(name: string): Arch {
584593
}
585594

586595
throw new Error(`Unsupported arch ${name}`)
587-
}
596+
}

src/targets/nsis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export default class NsisTarget extends Target {
185185
}
186186

187187
private async executeMakensis(defines: any, commands: any, isInstaller: boolean, originalScript: string) {
188-
const args: Array<string> = ["-WX"]
188+
const args: Array<string> = (this.options.warningsAsErrors === false) ? [] : ["-WX"]
189189
for (let name of Object.keys(defines)) {
190190
const value = defines[name]
191191
if (value == null) {
@@ -271,4 +271,4 @@ export default class NsisTarget extends Target {
271271
childProcess.stdin.end(script)
272272
})
273273
}
274-
}
274+
}

0 commit comments

Comments
 (0)