Skip to content

Commit

Permalink
feat(nsis): unicode option High Windows defender CPU usage when acces…
Browse files Browse the repository at this point in the history
…sing NSIS installer

Close #1165
  • Loading branch information
develar committed Feb 10, 2017
1 parent 3df2638 commit 0e9059c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ See [NSIS target notes](https://github.com/electron-userland/electron-builder/wi
| 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.
| 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.
| 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}`.
| unicode | <a name="NsisOptions-unicode"></a>Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode). Defaults to `true`.

<a name="NsisWebOptions"></a>
### `nsis` Web Installer Specific Options
Expand Down
5 changes: 5 additions & 0 deletions packages/electron-builder/src/options/winOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ export interface NsisOptions {
The [artifact file name pattern](https://github.com/electron-userland/electron-builder/wiki/Options#artifact-file-name-pattern). Defaults to `${productName} Setup ${version}.${ext}`.
*/
readonly artifactName?: string | null

/*
Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode). Defaults to `true`.
*/
readonly unicode?: boolean
}

/*
Expand Down
6 changes: 3 additions & 3 deletions packages/electron-builder/src/targets/nsis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import sanitizeFileName from "sanitize-filename"
import { copyFile } from "electron-builder-util/out/fs"
import { computeDownloadUrl, getPublishConfigs, getPublishConfigsForUpdateInfo } from "../publish/PublishManager"

const NSIS_VERSION = "3.0.1.6"
const NSIS_VERSION = "3.0.1.7"
//noinspection SpellCheckingInspection
const NSIS_SHA2 = "4bd85f3a54311fd55814ec87fbcb0ab9c64b3dea4179c891e7748df8748f87c8"
const NSIS_SHA2 = "0e797a7099283bf9caf97ee677e1d7986278c27b39916a501480978af039817c"

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

if (packager.config.compression === "store") {
Expand Down
3 changes: 3 additions & 0 deletions test/src/windows/nsisTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ test("one-click", app({
owner: "actperepo",
package: "TestApp",
},
nsis: {
unicode: false,
}
// wine creates incorrect filenames and registry entries for unicode, so, we use ASCII
// productName: "TestApp",
}
Expand Down

0 comments on commit 0e9059c

Please sign in to comment.