Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
feat(nsis-gen): custom icons for installer and uninstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
evshiron committed Apr 13, 2017
1 parent 113b02a commit 958e88d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/Options.md
Expand Up @@ -46,6 +46,8 @@ Currently noop.

Name | Type | Description
--- | --- | ---
icon | string | .ico icon file for NSIS installers. Defaults to `undefined`.
unIcon | string | .ico icon file for NSIS uninstallers. Defaults to `undefined`.
languages | string[] | Languages for NSIS installers. Multiple languages will result in a language selection dialog on startup. Defaults to `[ 'English' ]`.
diffUpdaters | boolean | Whether to build diff updaters. Defaults to `false`.
hashCalculation | boolean | Whether to calculate hashes for installers and updaters. Defaults to `true`.
9 changes: 9 additions & 0 deletions src/lib/Builder.ts
Expand Up @@ -412,6 +412,9 @@ export class Builder {
version: fixWindowsVersion(config.win.productVersion),
copyright: config.win.versionStrings.LegalCopyright,

icon: config.nsis.icon,
unIcon: config.nsis.unIcon,

// Compression.
compression: 'lzma',
solid: true,
Expand Down Expand Up @@ -534,6 +537,9 @@ export class Builder {
version: fixWindowsVersion(config.win.productVersion),
copyright: config.win.versionStrings.LegalCopyright,

icon: config.nsis.icon,
unIcon: config.nsis.unIcon,

// Compression.
compression: 'lzma',
solid: true,
Expand Down Expand Up @@ -595,6 +601,9 @@ export class Builder {
version: fixWindowsVersion(config.win.productVersion),
copyright: config.win.versionStrings.LegalCopyright,

icon: config.nsis.icon,
unIcon: config.nsis.unIcon,

// Compression.
compression: 'lzma',
solid: true,
Expand Down
3 changes: 3 additions & 0 deletions src/lib/config/NsisConfig.ts
@@ -1,6 +1,9 @@

export class NsisConfig {

public icon: string = undefined;
public unIcon: string = undefined;

public languages: string[] = [ 'English' ];

public diffUpdaters: boolean = false;
Expand Down
14 changes: 14 additions & 0 deletions src/lib/nsis-gen/NsisComposer.ts
Expand Up @@ -14,6 +14,9 @@ export interface INsisComposerOptions {
version: string;
copyright: string;

icon: string;
unIcon: string;

// Compression.
compression: 'zlib' | 'bzip2' | 'lzma';
solid: boolean;
Expand Down Expand Up @@ -95,6 +98,17 @@ ${ NsisComposer.DIVIDER }
Name "${ this.options.appName }"
Caption "${ this.options.appName }"
BrandingText "${ this.options.appName } ${ this.fixedVersion }"
${
this.options.icon
? `Icon "${ win32.normalize(resolve(this.options.icon)) }"`
: ''
}
${
this.options.unIcon
? `UninstallIcon "${ win32.normalize(resolve(this.options.unIcon)) }"`
: ''
}
SetCompressor ${ this.options.solid ? '/SOLID' : '' } ${ this.options.compression }
OutFile "${ win32.normalize(resolve(this.options.output)) }"
Expand Down

0 comments on commit 958e88d

Please sign in to comment.