Skip to content

Commit

Permalink
feat: custom NSIS installer icon (#969)
Browse files Browse the repository at this point in the history
Close #964
  • Loading branch information
unindented authored and develar committed Dec 3, 2016
1 parent 3b6af52 commit 75dd2cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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
| allowElevation | <a name="NsisOptions-allowElevation"></a>*boring installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions. Defaults to `true`.
| runAfterFinish | <a name="NsisOptions-runAfterFinish"></a>*one-click installer only.* Run application after finish. Defaults to `true`.
| guid | <a name="NsisOptions-guid"></a>See [GUID vs Application Name](https://github.com/electron-userland/electron-builder/wiki/NSIS#guid-vs-application-name).
| installerIcon | <a name="NsisOptions-installerIcon"></a>The path to installer icon, relative to the project directory. Defaults to `build/installerIcon.ico` or application icon.
| installerHeader | <a name="NsisOptions-installerHeader"></a>*boring installer only.* `MUI_HEADERIMAGE`, relative to the project directory. Defaults to `build/installerHeader.bmp`
| installerHeaderIcon | <a name="NsisOptions-installerHeaderIcon"></a>*one-click installer only.* The path to header icon (above the progress bar), relative to the project directory. Defaults to `build/installerHeaderIcon.ico` or application icon.
| include | <a name="NsisOptions-include"></a>The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](https://github.com/electron-userland/electron-builder/wiki/NSIS#custom-nsis-script).
Expand Down
5 changes: 5 additions & 0 deletions src/options/winOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export interface NsisOptions {
*/
readonly guid?: string | null

/*
The path to installer icon. Defaults to `build/installerIcon.ico` or application icon.
*/
readonly installerIcon?: string | null

/*
*boring installer only.* `MUI_HEADERIMAGE`, relative to the project directory. Defaults to `build/installerHeader.bmp`
*/
Expand Down
2 changes: 1 addition & 1 deletion src/targets/nsis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class NsisTarget extends Target {
const appInfo = packager.appInfo
const version = appInfo.version
const installerFilename = `${appInfo.productFilename} Setup ${version}.exe`
const iconPath = await packager.getIconPath()
const iconPath = await this.packager.getResource(this.options.installerIcon, "installerIcon.ico") || await this.packager.getIconPath()

const installerPath = path.join(this.outDir, installerFilename)
const guid = this.options.guid || await BluebirdPromise.promisify(uuid5)({namespace: ELECTRON_BUILDER_NS_UUID, name: appInfo.id})
Expand Down

0 comments on commit 75dd2cb

Please sign in to comment.