Skip to content

Commit

Permalink
fix(nsis): no custom icon
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Aug 29, 2016
1 parent 8fa482e commit b7b18bc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ For an app that will be shipped to production, you should sign your application.
```
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).

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.
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.


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`.
: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.
: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.


6. Installing the [required system packages](https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build).
Expand Down
12 changes: 6 additions & 6 deletions src/install-app-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ async function main() {
getElectronVersion(devMetadata, devPackageFile)
])

if (results[0] === projectDir) {
throw new Error("install-app-deps is only useful for two package.json structure")
}

await installDependencies(results[0], results[1], args.arch)
}

try {
main()
}
catch (e) {
printErrorAndExit(e)
}
main()
.catch(printErrorAndExit)
8 changes: 2 additions & 6 deletions src/node-gyp-rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,5 @@ async function main() {
})
}

try {
main()
}
catch (e) {
printErrorAndExit(e)
}
main()
.catch(printErrorAndExit)
8 changes: 5 additions & 3 deletions src/targets/nsis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,17 @@ export default class NsisTarget extends Target {
APP_DESCRIPTION: appInfo.description,
VERSION: version,

MUI_ICON: iconPath,
MUI_UNICON: iconPath,

COMPANY_NAME: appInfo.companyName,

PROJECT_DIR: this.packager.projectDir,
BUILD_RESOURCES_DIR: this.packager.buildResourcesDir,
}

if (iconPath != null) {
defines.MUI_ICON = iconPath
defines.MUI_UNICON = iconPath
}

for (let [arch, file] of this.archs) {
defines[arch === Arch.x64 ? "APP_64" : "APP_32"] = await file
}
Expand Down

0 comments on commit b7b18bc

Please sign in to comment.