Skip to content

Commit 0e9059c

Browse files
committed
feat(nsis): unicode option High Windows defender CPU usage when accessing NSIS installer
Close #1165
1 parent 3df2638 commit 0e9059c

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

docs/Options.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ See [NSIS target notes](https://github.com/electron-userland/electron-builder/wi
191191
| warningsAsErrors | <a name="NsisOptions-warningsAsErrors"></a>Defaults to `true`. If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.
192192
| menuCategory | <a name="NsisOptions-menuCategory"></a>Whether to create submenu for start menu shortcut and program files directory. Defaults to `false`. If `true`, company name will be used. Or string value.
193193
| artifactName | <a name="NsisOptions-artifactName"></a>The [artifact file name pattern](https://github.com/electron-userland/electron-builder/wiki/Options#artifact-file-name-pattern). Defaults to `${productName} Setup ${version}.${ext}`.
194+
| unicode | <a name="NsisOptions-unicode"></a>Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode). Defaults to `true`.
194195

195196
<a name="NsisWebOptions"></a>
196197
### `nsis` Web Installer Specific Options

packages/electron-builder/src/options/winOptions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ export interface NsisOptions {
150150
The [artifact file name pattern](https://github.com/electron-userland/electron-builder/wiki/Options#artifact-file-name-pattern). Defaults to `${productName} Setup ${version}.${ext}`.
151151
*/
152152
readonly artifactName?: string | null
153+
154+
/*
155+
Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode). Defaults to `true`.
156+
*/
157+
readonly unicode?: boolean
153158
}
154159

155160
/*

packages/electron-builder/src/targets/nsis.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import sanitizeFileName from "sanitize-filename"
1414
import { copyFile } from "electron-builder-util/out/fs"
1515
import { computeDownloadUrl, getPublishConfigs, getPublishConfigsForUpdateInfo } from "../publish/PublishManager"
1616

17-
const NSIS_VERSION = "3.0.1.6"
17+
const NSIS_VERSION = "3.0.1.7"
1818
//noinspection SpellCheckingInspection
19-
const NSIS_SHA2 = "4bd85f3a54311fd55814ec87fbcb0ab9c64b3dea4179c891e7748df8748f87c8"
19+
const NSIS_SHA2 = "0e797a7099283bf9caf97ee677e1d7986278c27b39916a501480978af039817c"
2020

2121
//noinspection SpellCheckingInspection
2222
const ELECTRON_BUILDER_NS_UUID = "50e065bc-3134-11e6-9bab-38c9862bdaf3"
@@ -149,7 +149,7 @@ export default class NsisTarget extends Target {
149149
OutFile: `"${installerPath}"`,
150150
VIProductVersion: appInfo.versionInWeirdWindowsForm,
151151
VIAddVersionKey: this.computeVersionKey(),
152-
Unicode: true,
152+
Unicode: options.unicode == null ? true : options.unicode,
153153
}
154154

155155
if (packager.config.compression === "store") {

test/src/windows/nsisTest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ test("one-click", app({
2020
owner: "actperepo",
2121
package: "TestApp",
2222
},
23+
nsis: {
24+
unicode: false,
25+
}
2326
// wine creates incorrect filenames and registry entries for unicode, so, we use ASCII
2427
// productName: "TestApp",
2528
}

0 commit comments

Comments
 (0)