Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customization of NSIS installer icon #969

Merged
merged 1 commit into from
Dec 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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