Skip to content

Commit b7b18bc

Browse files
committed
fix(nsis): no custom icon
1 parent 8fa482e commit b7b18bc

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ For an app that will be shipped to production, you should sign your application.
7474
```
7575
Then you can run `npm run dist` (to package in a distributable format (e.g. dmg, windows installer, deb package)) or `npm run pack` (only generates the package directory without really packaging it. This is useful for testing purposes).
7676

77-
If you use the two `package.json` files approach, you'll only have your `devDependencies` in your development `package.json` and your `dependencies` in your app `package.json`. To ensure your dependencies are always updated based on both files, simply add `"postinstall": "install-app-deps"` to your development `package.json`. This will basically automatically trigger an `npm install` within your app directory so you don't have to do this work everytime you install/update your dependencies.
77+
If you use the [two-package.json project structure](#two-packagejson-structure), you'll only have your `devDependencies` in your development `package.json` and your `dependencies` in your app `package.json`. To ensure your dependencies are always updated based on both files, simply add `"postinstall": "install-app-deps"` to your development `package.json`. This will basically automatically trigger an `npm install` within your app directory so you don't have to do this work everytime you install/update your dependencies.
7878

7979

8080
5. If you have native addons of your own that are part of the application (not as a dependency), add `"nodeGypRebuild": true` to the `build` section of your development `package.json`.
81-
:bulb: Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [`npm`](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use [`node-gyp-rebuild`](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241488783) bin instead.
81+
:bulb: Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use [node-gyp-rebuild](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241488783) bin instead.
8282

8383

8484
6. Installing the [required system packages](https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build).

src/install-app-deps.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ async function main() {
2626
getElectronVersion(devMetadata, devPackageFile)
2727
])
2828

29+
if (results[0] === projectDir) {
30+
throw new Error("install-app-deps is only useful for two package.json structure")
31+
}
32+
2933
await installDependencies(results[0], results[1], args.arch)
3034
}
3135

32-
try {
33-
main()
34-
}
35-
catch (e) {
36-
printErrorAndExit(e)
37-
}
36+
main()
37+
.catch(printErrorAndExit)

src/node-gyp-rebuild.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,5 @@ async function main() {
2626
})
2727
}
2828

29-
try {
30-
main()
31-
}
32-
catch (e) {
33-
printErrorAndExit(e)
34-
}
29+
main()
30+
.catch(printErrorAndExit)

src/targets/nsis.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,17 @@ export default class NsisTarget extends Target {
6969
APP_DESCRIPTION: appInfo.description,
7070
VERSION: version,
7171

72-
MUI_ICON: iconPath,
73-
MUI_UNICON: iconPath,
74-
7572
COMPANY_NAME: appInfo.companyName,
7673

7774
PROJECT_DIR: this.packager.projectDir,
7875
BUILD_RESOURCES_DIR: this.packager.buildResourcesDir,
7976
}
8077

78+
if (iconPath != null) {
79+
defines.MUI_ICON = iconPath
80+
defines.MUI_UNICON = iconPath
81+
}
82+
8183
for (let [arch, file] of this.archs) {
8284
defines[arch === Arch.x64 ? "APP_64" : "APP_32"] = await file
8385
}

0 commit comments

Comments
 (0)