├── .eslintignore ├── .eslintrc ├── .github ├── ISSUE_TEMPLATE.md ├── dependabot.yml └── workflows │ └── ci.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NEWS.md ├── README.md ├── SUPPORT.md ├── ci └── install-os-dependencies.sh ├── example ├── README.md ├── config.json ├── package.json ├── resources │ ├── Icon.icns │ ├── Icon.ico │ ├── Icon.png │ ├── IconBlackTemplate.png │ ├── IconBlackTemplate@2x.png │ ├── IconWhiteTemplate.png │ └── IconWhiteTemplate@2x.png └── src │ ├── index.js │ ├── main │ └── index.js │ └── renderer │ ├── index.css │ ├── index.html │ └── index.js ├── package.json ├── resources ├── control.ejs ├── desktop.ejs ├── icon.png ├── logo.png └── overrides.ejs ├── src ├── cli.js ├── dependencies.js ├── installer.js └── spawn.js └── test ├── .eslintrc ├── cli.js ├── fixtures ├── app-with-asar │ ├── LICENSE │ ├── chrome-sandbox │ ├── content_shell.pak │ ├── footest │ ├── icudtl.dat │ ├── libffmpegsumo.so │ ├── libgcrypt.so.11 │ ├── libnode.so │ ├── libnotify.so.4 │ ├── locales │ │ ├── am.pak │ │ ├── ar.pak │ │ ├── bg.pak │ │ ├── bn.pak │ │ ├── ca.pak │ │ ├── cs.pak │ │ ├── da.pak │ │ ├── de.pak │ │ ├── el.pak │ │ ├── en-GB.pak │ │ ├── en-US.pak │ │ ├── es-419.pak │ │ ├── es.pak │ │ ├── et.pak │ │ ├── fa.pak │ │ ├── fi.pak │ │ ├── fil.pak │ │ ├── fr.pak │ │ ├── gu.pak │ │ ├── he.pak │ │ ├── hi.pak │ │ ├── hr.pak │ │ ├── hu.pak │ │ ├── id.pak │ │ ├── it.pak │ │ ├── ja.pak │ │ ├── kn.pak │ │ ├── ko.pak │ │ ├── lt.pak │ │ ├── lv.pak │ │ ├── ml.pak │ │ ├── mr.pak │ │ ├── ms.pak │ │ ├── nb.pak │ │ ├── nl.pak │ │ ├── pl.pak │ │ ├── pt-BR.pak │ │ ├── pt-PT.pak │ │ ├── ro.pak │ │ ├── ru.pak │ │ ├── sk.pak │ │ ├── sl.pak │ │ ├── sr.pak │ │ ├── sv.pak │ │ ├── sw.pak │ │ ├── ta.pak │ │ ├── te.pak │ │ ├── th.pak │ │ ├── tr.pak │ │ ├── uk.pak │ │ ├── vi.pak │ │ ├── zh-CN.pak │ │ └── zh-TW.pak │ ├── natives_blob.bin │ ├── resources │ │ ├── app.asar │ │ └── atom.asar │ ├── snapshot_blob.bin │ └── version ├── app-without-asar │ ├── LICENSE │ ├── bartest │ ├── content_shell.pak │ ├── icudtl.dat │ ├── libffmpegsumo.so │ ├── libgcrypt.so.11 │ ├── libnode.so │ ├── libnotify.so.4 │ ├── locales │ │ ├── am.pak │ │ ├── ar.pak │ │ ├── bg.pak │ │ ├── bn.pak │ │ ├── ca.pak │ │ ├── cs.pak │ │ ├── da.pak │ │ ├── de.pak │ │ ├── el.pak │ │ ├── en-GB.pak │ │ ├── en-US.pak │ │ ├── es-419.pak │ │ ├── es.pak │ │ ├── et.pak │ │ ├── fa.pak │ │ ├── fi.pak │ │ ├── fil.pak │ │ ├── fr.pak │ │ ├── gu.pak │ │ ├── he.pak │ │ ├── hi.pak │ │ ├── hr.pak │ │ ├── hu.pak │ │ ├── id.pak │ │ ├── it.pak │ │ ├── ja.pak │ │ ├── kn.pak │ │ ├── ko.pak │ │ ├── lt.pak │ │ ├── lv.pak │ │ ├── ml.pak │ │ ├── mr.pak │ │ ├── ms.pak │ │ ├── nb.pak │ │ ├── nl.pak │ │ ├── pl.pak │ │ ├── pt-BR.pak │ │ ├── pt-PT.pak │ │ ├── ro.pak │ │ ├── ru.pak │ │ ├── sk.pak │ │ ├── sl.pak │ │ ├── sr.pak │ │ ├── sv.pak │ │ ├── sw.pak │ │ ├── ta.pak │ │ ├── te.pak │ │ ├── th.pak │ │ ├── tr.pak │ │ ├── uk.pak │ │ ├── vi.pak │ │ ├── zh-CN.pak │ │ └── zh-TW.pak │ ├── natives_blob.bin │ ├── resources │ │ ├── app │ │ │ ├── index.js │ │ │ ├── node_modules │ │ │ │ └── lodash │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── atom.asar │ │ └── cli │ │ │ └── bar.sh │ ├── snapshot_blob.bin │ └── version ├── app-without-description-or-product-description │ ├── resources │ │ └── app │ │ │ └── package.json │ └── version ├── config.json ├── custom.desktop.ejs ├── debian-scripts │ ├── postinst.sh │ ├── postrm.sh │ ├── preinst.sh │ └── prerm.sh ├── icon.png └── icon.svg ├── helpers ├── access.js └── describe_installer.js ├── installer.js └── spawn.js /.eslintignore: -------------------------------------------------------------------------------- 1 | test/fixtures 2 | node_modules 3 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["standard", "plugin:promise/recommended"] 3 | } 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **What version of `electron-installer-debian` are you using?** 2 | 3 | **What version of `node` and `npm` are you using?** 4 | 5 | **What operating system are you using?** 6 | 7 | **Can you compile the [example app](https://github.com/electron-userland/electron-installer-debian/tree/master/example) successfully?** 8 | 9 | **If not, paste here the output of the following commands:** 10 | 11 | ``` 12 | $ git clone https://github.com/electron-userland/electron-installer-debian.git 13 | $ cd electron-installer-debian/example 14 | $ DEBUG='electron-installer-debian' npm run build 15 | ``` 16 | 17 | **What did you do? Please include the configuration you are using for `electron-installer-debian`.** 18 | 19 | **What did you expect to happen?** 20 | 21 | **What actually happened?** 22 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | ignore: 9 | - dependency-name: get-folder-size 10 | versions: 11 | - ">= 3" 12 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | tags: 8 | - v[0-9]+.[0-9]+.[0-9]+* 9 | pull_request: 10 | 11 | jobs: 12 | build: 13 | runs-on: ${{ matrix.os }} 14 | strategy: 15 | matrix: 16 | node-version: [14.x, 16.x, 18.x] 17 | os: [macOS-latest, ubuntu-latest] 18 | 19 | steps: 20 | - uses: actions/checkout@v2 21 | - name: Install dependencies 22 | run: ci/install-os-dependencies.sh 23 | - uses: actions/setup-node@v2 24 | with: 25 | node-version: ${{ matrix.node-version }} 26 | - uses: actions/cache@v2 27 | with: 28 | path: ~/.npm 29 | key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} 30 | restore-keys: | 31 | ${{ runner.os }}-node- 32 | - name: Install 33 | run: | 34 | npm install --engine-strict 35 | npm update 36 | - name: Fix permission for test fixtures 37 | if: runner.os == 'ubuntu-latest' 38 | run: chmod --recursive g-w test/fixtures 39 | - name: Test 40 | run: npm test 41 | env: 42 | DEBUG: 'electron-installer-debian' 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output 2 | node_modules 3 | package-lock.json 4 | yarn.lock 5 | /example/dist/ 6 | /test/fixtures/out/ 7 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project is a part of the Electron ecosystem. As such, all contributions to this project follow 4 | [Electron's code of conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) 5 | where appropriate. 6 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to `electron-installer-debian` 2 | 3 | `electron-installer-debian` is a community-driven project. As such, we welcome and encourage all 4 | sorts of contributions. They include, but are not limited to: 5 | 6 | - Constructive feedback 7 | - [Questions about usage](https://github.com/electron-userland/electron-installer-debian/blob/main/SUPPORT.md) 8 | - [Bug reports / technical issues](#before-opening-bug-reportstechnical-issues) 9 | - Documentation changes 10 | - Feature requests 11 | - [Pull requests](#filing-pull-requests) 12 | 13 | We strongly suggest that before filing an issue, you search through the existing issues (both open 14 | and closed) to see if it has already been filed by someone else. 15 | 16 | This project is a part of the Electron ecosystem. As such, all contributions to this project follow 17 | [Electron's code of conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) 18 | where appropriate. 19 | 20 | ## Before opening bug reports/technical issues 21 | 22 | ### Debugging 23 | 24 | Troubleshooting suggestions can be found in the [support 25 | documentation](https://github.com/electron-userland/electron-installer-debian/blob/main/SUPPORT.md#troubleshooting). 26 | 27 | ## Contribution suggestions 28 | 29 | We use the label [`help wanted`](https://github.com/electron-userland/electron-installer-debian/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) in the issue tracker to denote fairly-well-scoped-out bugs or feature requests that the community can pick up and work on. If any of those labeled issues do not have enough information, please feel free to ask constructive questions. (This applies to any open issue.) 30 | 31 | ## Filing Pull Requests 32 | 33 | Here are some things to keep in mind as you file pull requests to fix bugs, add new features, etc.: 34 | 35 | * Travis CI is used to make sure that the project builds packages as expected on the supported 36 | platforms, using supported Node.js versions. 37 | * Unless it's impractical, please write tests for your changes. This will help us so that we can 38 | spot regressions much easier. 39 | * If your PR changes the behavior of an existing feature, or adds a new feature, please add/edit 40 | the package's documentation. Files that will likely need to be updated include `README.md`. 41 | * This project uses the [JavaScript Standard Style](https://standardjs.com/) as a coding convention. 42 | CI will fail if the PR does not conform to this standard. 43 | * One of the philosophies of the project is to keep the code base as small as possible. If you are 44 | adding a new feature, think about whether it is appropriate to go into a separate Node module, 45 | and then be integrated into this project. 46 | * If you are contributing a nontrivial change, please add an entry to `NEWS.md`. The format is 47 | similar to the one described at [Keep a Changelog](http://keepachangelog.com/). 48 | * Please **do not** bump the version number in your pull requests, the maintainers will do that. 49 | Feel free to indicate whether the changes require a major, minor, or patch version bump, as 50 | prescribed by the [semantic versioning specification](http://semver.org/). 51 | * Once your pull request is approved, please make sure your commits are rebased onto the latest 52 | commit in the main branch, and that you limit/squash the number of commits created to a 53 | "feature"-level. For instance: 54 | 55 | bad: 56 | 57 | ``` 58 | commit 1: add foo option 59 | commit 2: standardize code 60 | commit 3: add test 61 | commit 4: add docs 62 | commit 5: add bar option 63 | commit 6: add test + docs 64 | ``` 65 | 66 | good: 67 | 68 | ``` 69 | commit 1: add foo option 70 | commit 2: add bar option 71 | ``` 72 | 73 | Squashing commits during discussion of the pull request is almost always unnecessary, and makes it 74 | more difficult for both the submitters and reviewers to understand what changed in between comments. 75 | However, rebasing is encouraged when practical, particularly when there's a merge conflict. 76 | 77 | If you are continuing the work of another person's PR and need to rebase/squash, please retain the 78 | attribution of the original author(s) and continue the work in subsequent commits. 79 | 80 | ## Running tests 81 | 82 | A few of the tests require `lintian` to be installed. 83 | 84 | ## For collaborators 85 | 86 | Make sure to get an approval from another collaborator before merging a PR. 87 | 88 | ### Release process 89 | 90 | - if you aren't sure if a release should happen, open an issue 91 | - create a release branch 92 | - make sure that `NEWS.md` is up to date 93 | - make sure the tests pass 94 | - increment the version number appropriately, but not via `npm version` (we'll need to create the 95 | tag ourselves) 96 | - push the release branch and create a PR 97 | - once the PR's merged, `git checkout main && git pull && git tag $VERSION && git push --tags` 98 | - create a new GitHub release from the pushed tag with the contents of `NEWS.md` for that version 99 | - close the milestone associated with the version if one is open 100 | - `npm publish` 101 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Daniel Perez Alvarez 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # `electron-installer-debian` - Changes by Version 2 | 3 | ## [Unreleased] 4 | 5 | [Unreleased]: https://github.com/electron-userland/electron-installer-debian/compare/v3.2.0...main 6 | 7 | ## [3.2.0] - 2023-08-18 8 | 9 | [3.2.0]: https://github.com/electron-userland/electron-installer-debian/compare/v3.1.0...v3.2.0 10 | 11 | ### Added 12 | 13 | * Allow passing in compression option (#342) 14 | 15 | ### Removed 16 | 17 | * Node < 12 support (#220) 18 | 19 | ## [3.1.0] - 2020-06-28 20 | 21 | [3.1.0]: https://github.com/electron-userland/electron-installer-debian/compare/v3.0.0...v3.1.0 22 | 23 | ### Added 24 | 25 | * Electron 9 dependency compatibility (#224) 26 | 27 | ## [3.0.0] - 2020-01-22 28 | 29 | [3.0.0]: https://github.com/electron-userland/electron-installer-debian/compare/v2.0.1...v3.0.0 30 | 31 | ### Added 32 | 33 | * Electron 8 dependency compatibility (electron-userland/electron-installer-common#45) 34 | 35 | ### Removed 36 | 37 | * Node < 10 support (#220) 38 | 39 | ## [2.0.1] - 2019-09-12 40 | 41 | [2.0.1]: https://github.com/electron-userland/electron-installer-debian/compare/v2.0.0...v2.0.1 42 | 43 | ### Fixed 44 | 45 | * Ensure scripts have the executable bit set (#211) 46 | 47 | ## [2.0.0] - 2019-06-11 48 | 49 | [2.0.0]: https://github.com/electron-userland/electron-installer-debian/compare/v1.2.0...v2.0.0 50 | 51 | ### Added 52 | 53 | * ATSPI dependency for Electron >= 5 (#200) 54 | 55 | ### Fixed 56 | 57 | * Add revision, when present, to the default output filename (#199) 58 | 59 | ### Removed 60 | 61 | * Node < 8 support (#194) 62 | 63 | ## [1.2.0] - 2019-05-01 64 | 65 | [1.2.0]: https://github.com/electron-userland/electron-installer-debian/compare/v1.1.1...v1.2.0 66 | 67 | ### Added 68 | 69 | * Support for SUID sandbox helper in Electron >= 5 (#184) 70 | 71 | ### Fixed 72 | 73 | * Allow GConf dependency with non-deprecated package name (#185) 74 | 75 | ## [1.1.1] - 2019-02-20 76 | 77 | [1.1.1]: https://github.com/electron-userland/electron-installer-debian/compare/v1.1.0...v1.1.1 78 | 79 | ### Changed 80 | 81 | * Upgrade to `electron-installer-common@^0.6.1` (#174) 82 | 83 | ## [1.1.0] - 2019-01-06 84 | 85 | [1.1.0]: https://github.com/electron-userland/electron-installer-debian/compare/v1.0.1...v1.1.0 86 | 87 | ### Added 88 | 89 | * Package names are normalized to conform to Debian policy (#170) 90 | 91 | ### Fixed 92 | 93 | * Make sure that binary symlinks actually point to a valid file 94 | (electron-userland/electron-installer-common#6) 95 | 96 | ## [1.0.1] - 2018-12-12 97 | 98 | [1.0.1]: https://github.com/electron-userland/electron-installer-debian/compare/v1.0.0...v1.0.1 99 | 100 | ### Fixed 101 | 102 | * Provide a suggestion for how to resolve the description error (#149) 103 | * Don't trim the leading v from the Electron version (#153) 104 | * Ensure that certain CLI options are always parsed as arrays (#155) 105 | * Update Electron dependencies for 3.x/4.x (#159) 106 | 107 | ## [1.0.0] - 2018-10-05 108 | 109 | [1.0.0]: https://github.com/electron-userland/electron-installer-debian/compare/v0.8.1...v1.0.0 110 | 111 | ### Added 112 | 113 | * Support for Electron >= 2.0 (#132) 114 | * `transformVersion` as an exportable function (#144) 115 | 116 | ### Fixed 117 | 118 | * Warn when directory umask may not work with dpkg (#134) 119 | 120 | ### Removed 121 | 122 | * Node-style callback support (use [`nodeify`](https://npm.im/nodeify) if you need that 123 | functionality) 124 | * Node < 6 support (#145) 125 | 126 | ## [0.8.1] - 2018-02-20 127 | 128 | [0.8.1]: https://github.com/electron-userland/electron-installer-debian/compare/v0.8.0...v0.8.1 129 | 130 | ### Fixed 131 | 132 | * Handling executables trying to spawn that don't exist (#130) 133 | 134 | ## [0.8.0] - 2018-01-18 135 | 136 | [0.8.0]: https://github.com/electron-userland/electron-installer-debian/compare/v0.7.2...v0.8.0 137 | 138 | ### Added 139 | 140 | * Promise support (#124) 141 | 142 | ## [0.7.2] - 2018-01-18 143 | 144 | [0.7.2]: https://github.com/electron-userland/electron-installer-debian/compare/v0.7.1...v0.7.2 145 | 146 | ### Fixed 147 | 148 | * Multiple-line `productDescription`s with lines beginning with spaces (#125) 149 | 150 | ## [0.7.1] - 2017-11-13 151 | 152 | [0.7.1]: https://github.com/electron-userland/electron-installer-debian/compare/v0.7.0...v0.7.1 153 | 154 | ### Fixed 155 | 156 | * Deduplicate dependencies when passing options via the command line (#112) 157 | 158 | ## [0.7.0] - 2017-11-09 159 | 160 | [0.7.0]: https://github.com/electron-userland/electron-installer-debian/compare/v0.6.0...v0.7.0 161 | 162 | ### Added 163 | 164 | * Support for SVG icons (#104) 165 | 166 | ### Fixed 167 | 168 | * Update Debian dependencies for Electron apps (#105) 169 | * Throw proper error when no description or productDescription is provided (#109) 170 | * Append user dependencies to defaults & deduplicate (#111) 171 | 172 | ## [0.6.0] - 2017-09-27 173 | 174 | [0.6.0]: https://github.com/electron-userland/electron-installer-debian/compare/v0.5.2...v0.6.0 175 | 176 | ### Added 177 | 178 | * Support custom desktop file templates (#98) 179 | * Support package maintainer scripts (#91) 180 | 181 | ### Fixed 182 | 183 | * Remove lintian warnings/errors (#96) 184 | 185 | ---- 186 | 187 | For versions prior to 0.6.0, please see `git log`. 188 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Electron Installer for Debian](resources/logo.png) 2 | 3 | # electron-installer-debian [![Version](https://img.shields.io/npm/v/electron-installer-debian.svg)](https://www.npmjs.com/package/electron-installer-debian) [![Build Status](https://img.shields.io/travis/electron-userland/electron-installer-debian.svg)](http://travis-ci.org/electron-userland/electron-installer-debian) 4 | 5 | > Create a Debian package for your Electron app. 6 | 7 | ---- 8 | 9 | [Usage](#usage) | 10 | [Options](#options) | 11 | [Release Notes](https://github.com/electron-userland/electron-installer-debian/blob/main/NEWS.md) | 12 | [License](https://github.com/electron-userland/electron-installer-debian/blob/main/LICENSE) | 13 | [Code of Conduct](https://github.com/electron-userland/electron-installer-debian/blob/main/CODE_OF_CONDUCT.md) | 14 | [Support](https://github.com/electron-userland/electron-installer-debian/blob/main/SUPPORT.md) 15 | 16 | ## Requirements 17 | 18 | This tool requires Node 10 or greater, `fakeroot`, and `dpkg` to build the `.deb` package. 19 | 20 | I'd recommend building your packages on your target platform, but if you insist on using Mac OS X, you can install these tools through [Homebrew](http://brew.sh/): 21 | 22 | ``` 23 | $ brew install fakeroot dpkg 24 | ``` 25 | 26 | 27 | ## Installation 28 | 29 | For use from command-line: 30 | 31 | ``` 32 | $ npm install -g electron-installer-debian 33 | ``` 34 | 35 | For use in npm scripts or programmatically: 36 | 37 | ``` 38 | $ npm install --save-dev electron-installer-debian 39 | ``` 40 | 41 | 42 | ## Usage 43 | 44 | Say your Electron app lives in `path/to/app`, and has a structure like this: 45 | 46 | ``` 47 | . 48 | ├── LICENSE 49 | ├── README.md 50 | ├── node_modules 51 | │   ├── electron-packager 52 | │   └── electron 53 | ├── package.json 54 | ├── resources 55 | │   ├── Icon.png 56 | │   ├── IconTemplate.png 57 | │   └── IconTemplate@2x.png 58 | └── src 59 | ├── index.js 60 | ├── main 61 | │   └── index.js 62 | └── renderer 63 | ├── index.html 64 | └── index.js 65 | ``` 66 | 67 | You now run `electron-packager` to build the app for Debian: 68 | 69 | ``` 70 | $ electron-packager . app --platform linux --arch x64 --out dist/ 71 | ``` 72 | 73 | And you end up with something like this in your `dist` folder: 74 | 75 | ``` 76 | . 77 | └── dist 78 |    └── app-linux-x64 79 |    ├── LICENSE 80 |    ├── LICENSES.chromium.html 81 |    ├── content_shell.pak 82 |    ├── app 83 |    ├── icudtl.dat 84 |    ├── libgcrypt.so.11 85 |    ├── libnode.so 86 |    ├── locales 87 |    ├── natives_blob.bin 88 |    ├── resources 89 |    ├── snapshot_blob.bin 90 |    └── version 91 | ``` 92 | 93 | How do you turn that into a Debian package that your users can install? 94 | 95 | ### Command-Line 96 | 97 | If you want to run `electron-installer-debian` straight from the command-line, install the package globally: 98 | 99 | ``` 100 | $ npm install -g electron-installer-debian 101 | ``` 102 | 103 | And point it to your built app: 104 | 105 | ``` 106 | $ electron-installer-debian --src dist/app-linux-x64/ --dest dist/installers/ --arch amd64 107 | ``` 108 | 109 | You'll end up with the package at `dist/installers/app_0.0.1_amd64.deb`. 110 | 111 | ### Scripts 112 | 113 | If you want to run `electron-installer-debian` through npm, install the package locally: 114 | 115 | ``` 116 | $ npm install --save-dev electron-installer-debian 117 | ``` 118 | 119 | Edit the `scripts` section of your `package.json`: 120 | 121 | ```json 122 | { 123 | "name": "app", 124 | "description": "An awesome app!", 125 | "version": "0.0.1", 126 | "scripts": { 127 | "start": "electron .", 128 | "build": "electron-packager . app --platform linux --arch x64 --out dist/", 129 | "deb64": "electron-installer-debian --src dist/app-linux-x64/ --dest dist/installers/ --arch amd64" 130 | }, 131 | "devDependencies": { 132 | "electron-installer-debian": "^0.6.0", 133 | "electron-packager": "^9.0.0", 134 | "electron": "~1.7.0" 135 | } 136 | } 137 | ``` 138 | 139 | _*Note*: The versions in `devDependencies` are examples only, please use the latest package versions 140 | when possible._ 141 | 142 | And run the script: 143 | 144 | ``` 145 | $ npm run deb64 146 | ``` 147 | 148 | You'll end up with the package at `dist/installers/app_0.0.1_amd64.deb`. 149 | 150 | ### Programmatically 151 | 152 | Install the package locally: 153 | 154 | ``` 155 | $ npm install --save-dev electron-installer-debian 156 | ``` 157 | 158 | And write something like this: 159 | 160 | ```javascript 161 | const installer = require('electron-installer-debian') 162 | 163 | const options = { 164 | src: 'dist/app-linux-x64/', 165 | dest: 'dist/installers/', 166 | arch: 'amd64' 167 | } 168 | 169 | async function main (options) { 170 | console.log('Creating package (this may take a while)') 171 | try { 172 | await installer(options) 173 | console.log(`Successfully created package at ${options.dest}`) 174 | } catch (err) { 175 | console.error(err, err.stack) 176 | process.exit(1) 177 | } 178 | } 179 | main(options) 180 | ``` 181 | 182 | You'll end up with the package at `dist/installers/app_0.0.1_amd64.deb`. 183 | 184 | _Note: As of 1.0.0, the Node-style callback pattern is no longer available. You can use 185 | [`util.callbackify`](https://nodejs.org/api/util.html#util_util_callbackify_original) if this is 186 | required for your use case._ 187 | 188 | ### Options 189 | 190 | Even though you can pass most of these options through the command-line interface, it may be easier to create a configuration file: 191 | 192 | ```javascript 193 | { 194 | "dest": "dist/installers/", 195 | "icon": "resources/Icon.png", 196 | "compression": "gzip", 197 | "categories": [ 198 | "Utility" 199 | ], 200 | "lintianOverrides": [ 201 | "changelog-file-missing-in-native-package" 202 | ] 203 | } 204 | ``` 205 | 206 | And pass that instead with the `config` option: 207 | 208 | ``` 209 | $ electron-installer-debian --src dist/app-linux-x64/ --arch amd64 --config config.json 210 | ``` 211 | 212 | Anyways, here's the full list of options: 213 | 214 | #### src 215 | Type: `String` 216 | Default: `undefined` 217 | 218 | Path to the folder that contains your built Electron application. 219 | 220 | #### dest 221 | Type: `String` 222 | Default: `undefined` 223 | 224 | Path to the folder that will contain your Debian installer. 225 | 226 | #### rename 227 | Type: `Function` 228 | Default: `function (dest, src) { return path.join(dest, src); }` 229 | 230 | Function that renames all files generated by the task just before putting them in your `dest` folder. 231 | 232 | #### options.name 233 | Type: `String` 234 | Default: `package.name || "electron"` 235 | 236 | Name of the package (e.g. `atom`), used in the [`Package` field of the `control` specification](https://www.debian.org/doc/debian-policy/#package). 237 | 238 | According to the *Debian Policy Manual*: 239 | 240 | > Package names [...] must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character. 241 | 242 | `electron-installer-debian` will try to help conform to these requirements by lowercasing the name 243 | provided and replacing any invalid characters with `-`s. 244 | 245 | #### options.productName 246 | Type: `String` 247 | Default: `package.productName || package.name` 248 | 249 | Name of the application (e.g. `Atom`), used in the [`Name` field of the `desktop` specification](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). 250 | 251 | #### options.genericName 252 | Type: `String` 253 | Default: `package.genericName || package.productName || package.name` 254 | 255 | Generic name of the application (e.g. `Text Editor`), used in the [`GenericName` field of the `desktop` specification](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). 256 | 257 | #### options.description 258 | Type: `String` 259 | Default: `package.description` 260 | 261 | Short description of the application, used in the [`Description` field of the `control` specification](https://www.debian.org/doc/debian-policy/#the-single-line-synopsis). 262 | 263 | #### options.productDescription 264 | Type: `String` 265 | Default: `package.productDescription || package.description` 266 | 267 | Long description of the application, used in the [`Description` field of the `control` specification](https://www.debian.org/doc/debian-policy/#the-extended-description). 268 | 269 | #### options.version 270 | Type: `String` 271 | Default: `package.version || "0.0.0"` 272 | 273 | Version number of the package, used in the [`Version` field of the `control` specification](https://www.debian.org/doc/debian-policy/#version). 274 | 275 | #### options.revision 276 | Type: `String` 277 | Default: `undefined` 278 | 279 | Revision number of the package, used in the [`Version` field of the `control` specification](https://www.debian.org/doc/debian-policy/#version) and, by default, the filename of the generated `.deb` file. 280 | 281 | #### options.section 282 | Type: `String` 283 | Default: `"utils"` 284 | 285 | Application area into which the package has been classified, used in the [`Section` field of the `control` specification](https://www.debian.org/doc/debian-policy/#section). 286 | 287 | You can read more about [sections](https://www.debian.org/doc/debian-policy/#sections), and also check out the [list of existing sections in Debian unstable](https://packages.debian.org/unstable/). 288 | 289 | #### options.priority 290 | Type: `String` 291 | Default: `"optional"` 292 | 293 | How important it is that the user have the package installed., used in the [`Priority` field of the `control` specification](https://www.debian.org/doc/debian-policy/#priority). 294 | 295 | You can read more about [priorities](https://www.debian.org/doc/debian-policy/#priorities). 296 | 297 | #### options.arch 298 | Type: `String` 299 | Default: `undefined` 300 | 301 | Machine architecture the package is targeted to, used in the [`Architecture` field of the `control` specification](https://www.debian.org/doc/debian-policy/#architecture). 302 | 303 | For possible values see the output of `dpkg-architecture -L`. 304 | 305 | #### options.size 306 | Type: `Integer` 307 | Default: `size of the folder` 308 | 309 | Estimate of the total amount of disk space required to install the named package, used in the [`Installed-Size` field of the `control` specification](https://www.debian.org/doc/debian-policy/#installed-size). 310 | 311 | #### options.depends, recommends, suggests, enhances, preDepends 312 | Type: `Array[String]` 313 | Default: For `depends`, the minimum set of packages necessary for Electron to run; See [source code](https://github.com/electron-userland/electron-installer-debian/blob/53fb5c5/src/installer.js#L146-L157) for `recommends`, `suggests`, `enhances`, and `preDepends` default values 314 | 315 | Relationships to other packages, used in the [`Depends`, `Recommends`, `Suggests`, `Enhances` and `Pre-Depends` fields of the `control` specification](https://www.debian.org/doc/debian-policy/#binary-dependencies-depends-recommends-suggests-enhances-pre-depends). 316 | 317 | All user dependencies will be appended to the `Default` array of dependencies and any duplicates will be removed. 318 | 319 | #### options.maintainer 320 | Type: `String` 321 | Default: `package.author.name ` 322 | 323 | Maintainer of the package, used in the [`Maintainer` field of the `control` specification](https://www.debian.org/doc/debian-policy/#maintainer). 324 | 325 | #### options.homepage 326 | Type: `String` 327 | Default: `package.homepage || package.author.url` 328 | 329 | URL of the homepage for the package, used in the [`Homepage` field of the `control` specification](https://www.debian.org/doc/debian-policy/#homepage). 330 | 331 | #### options.bin 332 | Type: `String` 333 | Default: `package.name || "electron"` 334 | 335 | Relative path to the executable that will act as binary for the application, used in the [`Exec` field of the `desktop` specification](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). 336 | 337 | The generated package will contain a symlink `/usr/bin/<%= options.name %>` pointing to the path provided here. 338 | 339 | For example, providing this configuration: 340 | 341 | ```javascript 342 | { 343 | src: '...', 344 | dest: '...', 345 | name: 'foo', 346 | bin: 'resources/cli/launcher.sh' 347 | } 348 | ``` 349 | 350 | Will create a package with the following symlink: 351 | 352 | ``` 353 | usr/bin/foo@ -> ../lib/foo/resources/cli/launcher.sh 354 | ``` 355 | 356 | And a desktop specification with the following `Exec` key: 357 | 358 | ``` 359 | Exec=foo %U 360 | ``` 361 | 362 | #### options.icon 363 | Type: `String` or `Object[String:String]` 364 | Default: [`resources/icon.png`](https://github.com/electron-userland/electron-installer-debian/blob/main/resources/icon.png) 365 | 366 | Path to a single image that will act as icon for the application: 367 | 368 | ```javascript 369 | { 370 | icon: 'resources/Icon.png' 371 | } 372 | ``` 373 | 374 | Or multiple images with their corresponding resolutions: 375 | 376 | ```javascript 377 | { 378 | icon: { 379 | '48x48': 'resources/Icon48.png', 380 | '64x64': 'resources/Icon64.png', 381 | '128x128': 'resources/Icon128.png', 382 | '256x256': 'resources/Icon256.png', 383 | 'scalable': 'resources/Icon.svg' 384 | } 385 | } 386 | ``` 387 | Note that the image files must be one of the types: PNG or SVG. The support for SVG works only on `scalable` resolution. 388 | 389 | #### options.categories 390 | Type: `Array[String]` 391 | Default: `['GNOME', 'GTK', 'Utility']` 392 | 393 | Categories in which the application should be shown in a menu, used in the [`Categories` field of the `desktop` specification](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). 394 | 395 | For possible values check out the [Desktop Menu Specification](http://standards.freedesktop.org/menu-spec/latest/apa.html). 396 | 397 | #### options.mimeType 398 | Type: `Array[String]` 399 | Default: `[]` 400 | 401 | MIME types the application is able to open, used in the [`MimeType` field of the `desktop` specification](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). 402 | 403 | #### options.lintianOverrides 404 | Type: `Array[String]` 405 | Default: `[]` 406 | 407 | You can use these to quieten [`lintian`](https://lintian.debian.org/manual/). 408 | 409 | #### options.scripts 410 | Type: `Object[String:String]` 411 | Default: `undefined` 412 | 413 | Path to package maintainer scripts with their corresponding name, used in the [installation procedure](https://www.debian.org/doc/debian-policy/#introduction-to-package-maintainer-scripts): 414 | 415 | ```javascript 416 | { 417 | scripts: { 418 | 'preinst': 'resources/preinst_script', 419 | 'postinst': 'resources/postinst_script', 420 | 'prerm': 'resources/prerm_script', 421 | 'postrm': 'resources/postrm_script' 422 | } 423 | } 424 | ``` 425 | You can read more about [package maintainer scripts](https://www.debian.org/doc/debian-policy/#package-maintainer-scripts-and-installation-procedure) and [general scripts](https://www.debian.org/doc/debian-policy/#scripts) 426 | 427 | #### options.desktopTemplate 428 | Type: `String` 429 | Default: [`resources/desktop.ejs`](https://github.com/electron-userland/electron-installer-debian/blob/main/resources/desktop.ejs) 430 | 431 | The absolute path to a custom template for the generated [FreeDesktop.org desktop 432 | entry](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html) file. 433 | 434 | #### options.compression 435 | Type: `String` 436 | Default: `xz` 437 | 438 | Set the compression type used by dpkg-deb when building .deb package 439 | Allowed values: `'xz', 'gzip', 'bzip2', 'lzma', 'zstd', 'none'` 440 | 441 | Used by `dpkg-deb` to set the compression type. You can read more about it on the [manual page of `dpkg-deb`](https://man7.org/linux/man-pages/man1/dpkg-deb.1.html) 442 | 443 | ### Installed Package 444 | 445 | The package installs the Electron application into `/usr/lib`, since there are 446 | architecture-specific files in the package. There was a [discussion in the issue 447 | tracker](https://github.com/electron-userland/electron-installer-debian/issues/46) about the 448 | installation directory. 449 | 450 | In versions of `electron-installer-debian` prior to 0.5.0, the app was (incorrectly) installed in 451 | `/usr/share`. 452 | 453 | ## Meta 454 | 455 | * Code: `git clone git://github.com/electron-userland/electron-installer-debian.git` 456 | * Home: 457 | 458 | 459 | ## Contributors 460 | 461 | * Daniel Perez Alvarez ([unindented@gmail.com](mailto:unindented@gmail.com)) 462 | 463 | 464 | ## License 465 | 466 | Copyright (c) 2016 Daniel Perez Alvarez ([unindented.org](https://unindented.org/)). This is free software, and may be redistributed under the terms specified in the LICENSE file. 467 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support for `electron-installer-debian` 2 | 3 | If you have questions about usage, we encourage you to visit one of the several [community-driven 4 | sites](https://github.com/electron/electron#community). 5 | 6 | ## Troubleshooting 7 | 8 | One way to troubleshoot potential problems is to set the `DEBUG` environment variable before 9 | calling `electron-installer-debian`. This will print debug information from the specified modules. 10 | The value of the environment variable is a comma-separated list of modules which support this 11 | logging feature. Known modules include: 12 | 13 | * `electron-installer-debian` (always use this one before filing an issue) 14 | 15 | We use the [`debug`](https://www.npmjs.com/package/debug#usage) module for this functionality. It 16 | has examples on how to set environment variables if you don't know how. 17 | 18 | **If you are using `npm run` to execute `electron-installer-debian`, run the 19 | `electron-installer-debian` command without using `npm run` and make a note of the output, because 20 | `npm run` does not print out error messages when a script errors.** 21 | -------------------------------------------------------------------------------- /ci/install-os-dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | case "$(uname -s)" in 4 | Darwin) 5 | brew install dpkg fakeroot 6 | ;; 7 | Linux) 8 | sudo apt-get --yes --quiet install lintian 9 | ;; 10 | esac 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Example App 2 | 3 | From this directory, run the following commands to build the Debian packages for the app: 4 | 5 | ``` 6 | $ npm install 7 | $ npm run build 8 | ``` 9 | 10 | Take the `.deb` file in `dist/installers/` that matches your machine architecture, and install it as you would with any other package. 11 | -------------------------------------------------------------------------------- /example/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "dest": "dist/installers/", 3 | "icon": "resources/Icon.png", 4 | "categories": [ 5 | "Utility" 6 | ], 7 | "depends": [ 8 | "git", 9 | "gconf2", 10 | "gconf-service", 11 | "gvfs-bin", 12 | "libc6", 13 | "libcap2", 14 | "libgtk2.0-0", 15 | "libudev0 | libudev1", 16 | "libgcrypt11 | libgcrypt20", 17 | "libappindicator1", 18 | "libnotify4", 19 | "libnss3", 20 | "libxtst6", 21 | "python", 22 | "xdg-utils" 23 | ], 24 | "lintianOverrides": [ 25 | "changelog-file-missing-in-native-package" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-electron-app", 3 | "description": "An example app, built with Electron.", 4 | "version": "0.0.1", 5 | "license": "MIT", 6 | "author": { 7 | "name": "Daniel Perez Alvarez", 8 | "email": "unindented@gmail.com", 9 | "url": "http://unindented.org/" 10 | }, 11 | "private": true, 12 | "main": "src/index.js", 13 | "scripts": { 14 | "clean": "rimraf dist", 15 | "start": "electron .", 16 | "bundle:x64": "electron-packager . --platform linux --arch x64 --out dist/", 17 | "deb:x64": "electron-installer-debian --src dist/example-electron-app-linux-x64/ --arch amd64 --config config.json", 18 | "build": "npm run clean && npm run bundle:x64 && npm run deb:x64" 19 | }, 20 | "devDependencies": { 21 | "electron": "^9.1.0", 22 | "electron-installer-debian": "*", 23 | "electron-packager": "^13.0.0", 24 | "rimraf": "^2.6.2" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /example/resources/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/example/resources/Icon.icns -------------------------------------------------------------------------------- /example/resources/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/example/resources/Icon.ico -------------------------------------------------------------------------------- /example/resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/example/resources/Icon.png -------------------------------------------------------------------------------- /example/resources/IconBlackTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/example/resources/IconBlackTemplate.png -------------------------------------------------------------------------------- /example/resources/IconBlackTemplate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/example/resources/IconBlackTemplate@2x.png -------------------------------------------------------------------------------- /example/resources/IconWhiteTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/example/resources/IconWhiteTemplate.png -------------------------------------------------------------------------------- /example/resources/IconWhiteTemplate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/example/resources/IconWhiteTemplate@2x.png -------------------------------------------------------------------------------- /example/src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | require('./main') 4 | -------------------------------------------------------------------------------- /example/src/main/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const path = require('path') 4 | const electron = require('electron') 5 | const app = electron.app 6 | const Menu = electron.Menu 7 | const Tray = electron.Tray 8 | const BrowserWindow = electron.BrowserWindow 9 | 10 | let tray = null 11 | let win = null 12 | let quitting = false 13 | 14 | const createMenu = () => { 15 | const appMenu = Menu.buildFromTemplate([ 16 | { 17 | label: 'File', 18 | submenu: [ 19 | { 20 | label: 'Quit', 21 | accelerator: 'CmdOrCtrl+Q', 22 | click: () => { 23 | app.quit() 24 | } 25 | } 26 | ] 27 | } 28 | ]) 29 | Menu.setApplicationMenu(appMenu) 30 | } 31 | 32 | const createTray = () => { 33 | const variant = (process.platform === 'darwin' ? 'Black' : 'White') 34 | const iconPath = path.resolve(__dirname, `../../resources/Icon${variant}Template.png`) 35 | 36 | tray = new Tray(iconPath) 37 | 38 | const trayMenu = Menu.buildFromTemplate([ 39 | { 40 | label: 'Preferences...', 41 | click: () => { 42 | win.show() 43 | } 44 | }, 45 | { 46 | type: 'separator' 47 | }, 48 | { 49 | label: 'Quit', 50 | click: () => { 51 | app.quit() 52 | } 53 | } 54 | ]) 55 | tray.setContextMenu(trayMenu) 56 | } 57 | 58 | const createWindow = () => { 59 | const iconPath = path.resolve(__dirname, '../../resources/Icon.png') 60 | const winUrl = 'file://' + path.resolve(__dirname, '../renderer/index.html') 61 | 62 | win = new BrowserWindow({ 63 | width: 800, 64 | height: 600, 65 | show: false, 66 | icon: iconPath 67 | }) 68 | win.loadURL(winUrl) 69 | 70 | win.on('close', (evt) => { 71 | if (quitting) { 72 | return 73 | } 74 | 75 | evt.preventDefault() 76 | win.hide() 77 | }) 78 | 79 | win.on('closed', () => { 80 | tray = null 81 | win = null 82 | }) 83 | } 84 | 85 | app.on('before-quit', () => { 86 | quitting = true 87 | }) 88 | 89 | app.on('window-all-closed', () => { 90 | app.quit() 91 | }) 92 | 93 | app.on('ready', () => { 94 | createMenu() 95 | createTray() 96 | createWindow() 97 | }) 98 | -------------------------------------------------------------------------------- /example/src/renderer/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | display: flex; 3 | align-items: center; 4 | justify-content: center; 5 | } 6 | 7 | img { 8 | max-width: 50%; 9 | } 10 | -------------------------------------------------------------------------------- /example/src/renderer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Poopie 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/src/renderer/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const image = document.createElement('img') 4 | image.src = '../../resources/Icon.png' 5 | document.body.appendChild(image) 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-installer-debian", 3 | "description": "Create a Debian package for your Electron app.", 4 | "version": "3.2.0", 5 | "license": "MIT", 6 | "author": { 7 | "name": "Daniel Perez Alvarez", 8 | "email": "unindented@gmail.com", 9 | "url": "http://unindented.org/" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git://github.com/electron-userland/electron-installer-debian.git" 14 | }, 15 | "keywords": [ 16 | "electron", 17 | "debian" 18 | ], 19 | "os": [ 20 | "darwin", 21 | "linux" 22 | ], 23 | "main": "src/installer.js", 24 | "bin": { 25 | "electron-installer-debian": "src/cli.js" 26 | }, 27 | "files": [ 28 | "bin", 29 | "src", 30 | "resources" 31 | ], 32 | "scripts": { 33 | "lint": "eslint .", 34 | "spec": "nyc mocha", 35 | "test": "npm run lint && npm run spec" 36 | }, 37 | "engines": { 38 | "node": ">= 14.0.0" 39 | }, 40 | "dependencies": { 41 | "@malept/cross-spawn-promise": "^1.0.0", 42 | "debug": "^4.1.1", 43 | "electron-installer-common": "^0.10.2", 44 | "fs-extra": "^9.0.0", 45 | "get-folder-size": "^2.0.1", 46 | "lodash": "^4.17.4", 47 | "word-wrap": "^1.2.3", 48 | "yargs": "^16.0.2" 49 | }, 50 | "devDependencies": { 51 | "chai": "^4.1.2", 52 | "eslint": "^7.2.0", 53 | "eslint-config-standard": "^16.0.0", 54 | "eslint-plugin-import": "^2.17.3", 55 | "eslint-plugin-node": "^11.0.0", 56 | "eslint-plugin-promise": "^5.1.0", 57 | "eslint-plugin-standard": "^5.0.0", 58 | "mocha": "^8.0.1", 59 | "nyc": "^15.0.0", 60 | "promise-retry": "^2.0.1", 61 | "tmp-promise": "^3.0.2" 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /resources/control.ejs: -------------------------------------------------------------------------------- 1 | <% if (name) { %>Package: <%= name %> 2 | <% } %><% if (version) { %>Version: <%= version %><% if (revision) { %>-<%= revision %><% } %> 3 | <% } %><% if (section) { %>Section: <%= section %> 4 | <% } %><% if (priority) { %>Priority: <%= priority %> 5 | <% } %><% if (arch) { %>Architecture: <%= arch %> 6 | <% } %><% if (depends && depends.length) { %>Depends: <%= depends.join(', ') %> 7 | <% } %><% if (recommends && recommends.length) { %>Recommends: <%= recommends.join(', ') %> 8 | <% } %><% if (suggests && suggests.length) { %>Suggests: <%= suggests.join(', ') %> 9 | <% } %><% if (enhances && enhances.length) { %>Enhances: <%= enhances.join(', ') %> 10 | <% } %><% if (preDepends && preDepends.length) { %>Pre-Depends: <%= preDepends.join(', ') %> 11 | <% } %><% if (size) { %>Installed-Size: <%= size %> 12 | <% } %><% if (maintainer) { %>Maintainer: <%= maintainer %> 13 | <% } %><% if (homepage) { %>Homepage: <%= homepage %> 14 | <% } %><% if (description) { %>Description: <%= description %> 15 | <% } %><% if (productDescription) { %><%= productDescription %><% } %> 16 | -------------------------------------------------------------------------------- /resources/desktop.ejs: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | <% if (productName) { %>Name=<%= productName %> 3 | <% } %><% if (description) { %>Comment=<%= description %> 4 | <% } %><% if (genericName) { %>GenericName=<%= genericName %> 5 | <% } %><% if (name) { %>Exec=<%= name %> %U 6 | Icon=<%= name %> 7 | <% } %>Type=Application 8 | StartupNotify=true 9 | <% if (categories && categories.length) { %>Categories=<%= categories.join(';') %>; 10 | <% } %><% if (mimeType && mimeType.length) { %>MimeType=<%= mimeType.join(';') %>; 11 | <% } %> 12 | -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/resources/icon.png -------------------------------------------------------------------------------- /resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/resources/logo.png -------------------------------------------------------------------------------- /resources/overrides.ejs: -------------------------------------------------------------------------------- 1 | <% _.each(lintianOverrides, function (override) { %><%= name %>: <%= override %> 2 | <% }); %> 3 | -------------------------------------------------------------------------------- /src/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const _ = require('lodash') 4 | const yargs = require('yargs') 5 | 6 | const installer = require('./installer') 7 | const pkg = require('../package.json') 8 | 9 | const argv = yargs 10 | .version(pkg.version) 11 | .usage(`${pkg.description}\n\nUsage: $0 --src --dest --arch `) 12 | .option('src', { 13 | describe: 'Directory that contains your built Electron app (e.g. with `electron-packager`)', 14 | demand: true 15 | }) 16 | .option('dest', { 17 | describe: 'Directory that will contain the resulting Debian installer', 18 | demand: true 19 | }) 20 | .option('arch', { 21 | describe: 'Machine architecture the package is targeted to', 22 | demand: true 23 | }) 24 | .option('config', { 25 | describe: 'JSON file that contains the metadata for your application', 26 | config: true 27 | }) 28 | .options('options.depends', { array: true, hidden: true }) 29 | .options('options.recommends', { array: true, hidden: true }) 30 | .options('options.suggests', { array: true, hidden: true }) 31 | .options('options.enhances', { array: true, hidden: true }) 32 | .options('options.preDepends', { array: true, hidden: true }) 33 | .options('options.categories', { array: true, hidden: true }) 34 | .options('options.mimeType', { array: true, hidden: true }) 35 | .options('options.lintianOverrides', { array: true, hidden: true }) 36 | .example('$0 --src dist/app/ --dest dist/installer/ --arch i386', 'use metadata from `dist/app/`') 37 | .example('$0 --src dist/app/ --dest dist/installer/ --config config.json', 'use metadata from `config.json`') 38 | .wrap(null) 39 | .argv 40 | 41 | console.log('Creating package (this may take a while)') 42 | 43 | const options = _.omit(argv, ['$0', '_', 'version']) 44 | 45 | installer(options) 46 | .then(() => console.log(`Successfully created package at ${argv.dest}`)) 47 | .catch(/* istanbul ignore next */ err => { 48 | console.error(err, err.stack) 49 | process.exit(1) 50 | }) 51 | -------------------------------------------------------------------------------- /src/dependencies.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const common = require('electron-installer-common') 4 | 5 | const dependencyMap = { 6 | atspi: 'libatspi2.0-0', 7 | drm: 'libdrm2', 8 | gbm: 'libgbm1', 9 | gconf: 'libgconf-2-4 | libgconf2-4', 10 | glib2: 'libglib2.0-bin', 11 | gtk2: 'libgtk2.0-0', 12 | gtk3: 'libgtk-3-0', 13 | gvfs: 'gvfs-bin', 14 | kdeCliTools: 'kde-cli-tools', 15 | kdeRuntime: 'kde-runtime', 16 | notify: 'libnotify4', 17 | nss: 'libnss3', 18 | trashCli: 'trash-cli', 19 | uuid: 'libuuid1', 20 | xcbDri3: 'libxcb-dri3-0', 21 | xdgUtils: 'xdg-utils', 22 | xss: 'libxss1', 23 | xtst: 'libxtst6' 24 | } 25 | 26 | /** 27 | * Transforms the list of trash requires into an OR'd string. 28 | */ 29 | function trashRequiresAsBoolean (electronVersion, dependencyMap) { 30 | return [common.getTrashDepends(electronVersion, dependencyMap).join(' | ')] 31 | } 32 | 33 | module.exports = { 34 | /** 35 | * The dependencies for Electron itself, given an Electron version. 36 | */ 37 | forElectron: function dependenciesForElectron (electronVersion) { 38 | return { 39 | depends: common.getDepends(electronVersion, dependencyMap) 40 | .concat(trashRequiresAsBoolean(electronVersion, dependencyMap)), 41 | recommends: [ 42 | 'pulseaudio | libasound2' 43 | ], 44 | suggests: [ 45 | 'gir1.2-gnomekeyring-1.0', 46 | 'libgnome-keyring0', 47 | 'lsb-release' 48 | ], 49 | enhances: [ 50 | ], 51 | preDepends: [ 52 | ] 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/installer.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { promisify } = require('util') 4 | 5 | const _ = require('lodash') 6 | const common = require('electron-installer-common') 7 | const debug = require('debug') 8 | const fs = require('fs-extra') 9 | const fsize = promisify(require('get-folder-size')) 10 | const parseAuthor = require('parse-author') 11 | const path = require('path') 12 | const wrap = require('word-wrap') 13 | 14 | const debianDependencies = require('./dependencies') 15 | const spawn = require('./spawn') 16 | 17 | const defaultLogger = debug('electron-installer-debian') 18 | 19 | const defaultRename = (dest, src) => { 20 | return path.join(dest, '<%= name %>_<%= version %><% if (revision) { %>-<%= revision %><% } %>_<%= arch %>.deb') 21 | } 22 | 23 | /** 24 | * Transforms a SemVer version into a Debian-style version. 25 | * 26 | * Use '~' on pre-releases for proper Debian version ordering. 27 | * See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version 28 | */ 29 | function transformVersion (version) { 30 | return version.replace(/(\d)[_.+-]?((RC|rc|pre|dev|beta|alpha)[_.+-]?\d*)$/, '$1~$2') 31 | } 32 | 33 | class DebianInstaller extends common.ElectronInstaller { 34 | get contentFunctions () { 35 | return [ 36 | 'copyApplication', 37 | 'copyLinuxIcons', 38 | 'copyScripts', 39 | 'createBinarySymlink', 40 | 'createControl', 41 | 'createCopyright', 42 | 'createDesktopFile', 43 | 'createOverrides' 44 | ] 45 | } 46 | 47 | get defaultDesktopTemplatePath () { 48 | return path.resolve(__dirname, '../resources/desktop.ejs') 49 | } 50 | 51 | get packagePattern () { 52 | return path.join(this.stagingDir, '../*.deb') 53 | } 54 | 55 | /** 56 | * Copy the application into the package. 57 | */ 58 | async copyApplication () { 59 | await super.copyApplication(src => src !== path.join(this.options.src, 'LICENSE')) 60 | return this.updateSandboxHelperPermissions() 61 | } 62 | 63 | /** 64 | * Copy debian scripts. 65 | */ 66 | copyScripts () { 67 | const scriptNames = ['preinst', 'postinst', 'prerm', 'postrm'] 68 | 69 | return common.wrapError('creating script files', async () => 70 | Promise.all(_.map(this.options.scripts, async (item, key) => { 71 | if (scriptNames.includes(key)) { 72 | const scriptFile = path.join(this.stagingDir, 'DEBIAN', key) 73 | this.options.logger(`Creating script file at ${scriptFile}`) 74 | 75 | await fs.copy(item, scriptFile) 76 | return fs.chmod(scriptFile, 0o755) 77 | } else { 78 | throw new Error(`Wrong executable script name: ${key}`) 79 | } 80 | })) 81 | ) 82 | } 83 | 84 | /** 85 | * Creates the control file for the package. 86 | * 87 | * See: https://www.debian.org/doc/debian-policy/ch-controlfields.html 88 | */ 89 | createControl () { 90 | const src = path.resolve(__dirname, '../resources/control.ejs') 91 | const dest = path.join(this.stagingDir, 'DEBIAN', 'control') 92 | this.options.logger(`Creating control file at ${dest}`) 93 | 94 | return common.wrapError('creating control file', async () => this.createTemplatedFile(src, dest)) 95 | } 96 | 97 | /** 98 | * Create lintian overrides for the package. 99 | */ 100 | async createOverrides () { 101 | const src = path.resolve(__dirname, '../resources/overrides.ejs') 102 | const dest = path.join(this.stagingDir, this.baseAppDir, 'share/lintian/overrides', this.options.name) 103 | this.options.logger(`Creating lintian overrides at ${dest}`) 104 | 105 | return common.wrapError('creating lintian overrides file', async () => this.createTemplatedFile(src, dest, '0644')) 106 | } 107 | 108 | /** 109 | * Package everything using `dpkg` and `fakeroot`. 110 | */ 111 | async createPackage () { 112 | this.options.logger(`Creating package at ${this.stagingDir}`) 113 | 114 | const command = ['--build', this.stagingDir] 115 | if (process.platform === 'darwin') { 116 | command.unshift('--root-owner-group') 117 | } 118 | 119 | if (this.options.compression) { 120 | command.unshift(`-Z${this.options.compression}`) 121 | } 122 | 123 | command.unshift('dpkg-deb') 124 | 125 | const output = await spawn('fakeroot', command, this.options.logger) 126 | this.options.logger(`dpkg-deb output: ${output}`) 127 | } 128 | 129 | /** 130 | * Get the hash of default options for the installer. Some come from the info 131 | * read from `package.json`, and some are hardcoded. 132 | */ 133 | async generateDefaults () { 134 | const [pkg, size, electronVersion] = await Promise.all([ 135 | (async () => (await common.readMetadata(this.userSupplied)) || {})(), 136 | fsize(this.userSupplied.src), 137 | common.readElectronVersion(this.userSupplied.src) 138 | ]) 139 | 140 | this.defaults = Object.assign(common.getDefaultsFromPackageJSON(pkg), { 141 | version: transformVersion(pkg.version || '0.0.0'), 142 | 143 | section: 'utils', 144 | priority: 'optional', 145 | size: Math.ceil((size || 0) / 1024), 146 | 147 | maintainer: this.getMaintainer(pkg.author), 148 | 149 | icon: path.resolve(__dirname, '../resources/icon.png'), 150 | lintianOverrides: [] 151 | }, debianDependencies.forElectron(electronVersion)) 152 | 153 | return this.defaults 154 | } 155 | 156 | /** 157 | * Flattens and merges default values, CLI-supplied options, and API-supplied options. 158 | */ 159 | generateOptions () { 160 | super.generateOptions() 161 | 162 | this.options.name = this.sanitizeName(this.options.name) 163 | 164 | if (!this.options.description && !this.options.productDescription) { 165 | throw new Error("No Description or ProductDescription provided. Please set either a description in the app's package.json or provide it in the this.options.") 166 | } 167 | 168 | if (this.options.description) { 169 | this.options.description = this.normalizeDescription(this.options.description) 170 | } 171 | 172 | if (this.options.productDescription) { 173 | this.options.productDescription = this.normalizeExtendedDescription(this.options.productDescription) 174 | } 175 | 176 | const compressionTypes = ['xz', 'gzip', 'bzip2', 'lzma', 'zstd', 'none'] 177 | if (this.options.compression && !compressionTypes.includes(this.options.compression)) { 178 | throw new Error('Invalid compression type. xz, gzip, bzip2, lzma, zstd, or none are supported.') 179 | } 180 | 181 | // Create array with unique values from default & user-supplied dependencies 182 | for (const prop of ['depends', 'recommends', 'suggests', 'enhances', 'preDepends']) { 183 | this.options[prop] = common.mergeUserSpecified(this.userSupplied, prop, this.defaults) 184 | } 185 | 186 | return this.options 187 | } 188 | 189 | /** 190 | * Generates a Debian-compliant maintainer value from a package.json author field. 191 | */ 192 | getMaintainer (author) { 193 | if (author) { 194 | if (typeof author === 'string') { 195 | author = parseAuthor(author) 196 | } 197 | const maintainer = [author.name] 198 | if (author.email) { 199 | maintainer.push(`<${author.email}>`) 200 | } 201 | 202 | return maintainer.join(' ') 203 | } 204 | } 205 | 206 | /** 207 | * Normalize the description by replacing all newlines in the description with spaces, since it's 208 | * supposed to be one line. 209 | */ 210 | normalizeDescription (description) { 211 | return description.replace(/[\r\n]+/g, ' ') 212 | } 213 | 214 | /** 215 | * Ensure blank lines have the "." that denotes a blank line in the control file. Wrap any 216 | * extended description lines to avoid lintian warnings about 217 | * `extended-description-line-too-long`. 218 | */ 219 | normalizeExtendedDescription (extendedDescription) { 220 | return extendedDescription 221 | .replace(/\r\n/g, '\n') // Fixes errors when finding blank lines in Windows 222 | .replace(/^$/mg, '.') 223 | .split('\n') 224 | .map(line => wrap(line, { width: 80, indent: ' ' })) 225 | .join('\n') 226 | } 227 | 228 | /** 229 | * Sanitize package name per Debian docs: 230 | * https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source 231 | */ 232 | sanitizeName (name) { 233 | const sanitized = common.sanitizeName(name.toLowerCase(), '-+.a-z0-9') 234 | if (sanitized.length < 2) { 235 | throw new Error('Package name must be at least two characters') 236 | } 237 | if (/^[^a-z0-9]/.test(sanitized)) { 238 | throw new Error('Package name must start with an ASCII number or letter') 239 | } 240 | 241 | return sanitized 242 | } 243 | } 244 | 245 | /* ************************************************************************** */ 246 | 247 | module.exports = async data => { 248 | data.rename = data.rename || defaultRename 249 | data.logger = data.logger || defaultLogger 250 | 251 | if (process.umask() !== 0o0022 && process.umask() !== 0o0002) { 252 | console.warn(`The current umask, ${process.umask().toString(8)}, is not supported. You should use 0022 or 0002`) 253 | } 254 | 255 | const installer = new DebianInstaller(data) 256 | 257 | await installer.generateDefaults() 258 | await installer.generateOptions() 259 | data.logger(`Creating package with options\n${JSON.stringify(installer.options, null, 2)}`) 260 | await installer.createStagingDir() 261 | await installer.createContents() 262 | await installer.createPackage() 263 | await installer.movePackage() 264 | data.logger(`Successfully created package at ${installer.options.dest}`) 265 | return installer.options 266 | } 267 | 268 | module.exports.Installer = DebianInstaller 269 | module.exports.transformVersion = transformVersion 270 | -------------------------------------------------------------------------------- /src/spawn.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { spawn } = require('@malept/cross-spawn-promise') 4 | 5 | function updateExecutableMissingException (err, hasLogger) { 6 | if (hasLogger && err.code === 'ENOENT') { 7 | const isFakeroot = err.syscall === 'spawn fakeroot' 8 | const isDpkg = !isFakeroot && err.syscall === 'spawn dpkg' 9 | 10 | if (isFakeroot || isDpkg) { 11 | const installer = process.platform === 'darwin' ? 'brew' : 'apt-get' 12 | const pkg = isFakeroot ? 'fakeroot' : 'dpkg' 13 | 14 | err.message = `Your system is missing the ${pkg} package. Try, e.g. '${installer} install ${pkg}'` 15 | } 16 | } 17 | } 18 | 19 | module.exports = async function (cmd, args, logger) { 20 | return spawn(cmd, args, { 21 | logger, 22 | updateErrorCallback: updateExecutableMissingException 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/cli.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const access = require('./helpers/access') 4 | const { cleanupOutputDir, tempOutputDir } = require('./helpers/describe_installer') 5 | const path = require('path') 6 | const spawn = require('../src/spawn') 7 | 8 | function runCLI (options) { 9 | const args = [ 10 | '--src', options.src, 11 | '--dest', options.dest, 12 | '--arch', options.arch 13 | ] 14 | if (options.config) args.push('--config', options.config) 15 | 16 | before(() => spawn('./src/cli.js', args)) 17 | } 18 | 19 | describe('cli', function () { 20 | this.timeout(10000) 21 | 22 | describe('with an app with asar', test => { 23 | const outputDir = tempOutputDir() 24 | 25 | runCLI({ src: 'test/fixtures/app-with-asar/', dest: outputDir, arch: 'i386', config: 'test/fixtures/config.json' }) 26 | 27 | it('generates a `.deb` package', () => access(path.join(outputDir, 'footest_0.0.1-2_i386.deb'))) 28 | 29 | cleanupOutputDir(outputDir) 30 | }) 31 | 32 | describe('with an app without asar', test => { 33 | const outputDir = tempOutputDir() 34 | 35 | runCLI({ src: 'test/fixtures/app-without-asar/', dest: outputDir, arch: 'amd64' }) 36 | 37 | it('generates a `.deb` package', () => access(path.join(outputDir, 'bartest_0.0.1_amd64.deb'))) 38 | 39 | cleanupOutputDir(outputDir) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Daniel Perez Alvarez 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/chrome-sandbox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/chrome-sandbox -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/content_shell.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/content_shell.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/footest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT=$(readlink -f "$0") 4 | SCRIPT_PATH=$(dirname "$SCRIPT") 5 | 6 | echo "$SCRIPT_PATH/resources/app.asar $@" 7 | -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/icudtl.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/icudtl.dat -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/libffmpegsumo.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/libffmpegsumo.so -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/libgcrypt.so.11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/libgcrypt.so.11 -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/libnode.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/libnode.so -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/libnotify.so.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/libnotify.so.4 -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/am.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/am.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ar.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ar.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/bg.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/bg.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/bn.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/bn.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ca.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ca.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/cs.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/cs.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/da.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/da.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/de.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/de.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/el.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/el.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/en-GB.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/en-GB.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/en-US.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/en-US.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/es-419.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/es-419.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/es.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/es.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/et.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/et.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/fa.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/fa.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/fi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/fi.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/fil.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/fil.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/fr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/fr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/gu.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/gu.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/he.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/he.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/hi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/hi.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/hr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/hr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/hu.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/hu.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/id.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/id.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/it.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/it.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ja.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ja.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/kn.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/kn.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ko.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ko.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/lt.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/lt.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/lv.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/lv.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ml.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ml.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/mr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/mr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ms.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ms.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/nb.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/nb.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/nl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/nl.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/pl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/pl.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/pt-BR.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/pt-BR.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/pt-PT.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/pt-PT.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ro.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ro.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ru.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ru.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sk.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/sk.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/sl.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/sr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sv.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/sv.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sw.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/sw.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ta.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/ta.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/te.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/te.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/th.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/th.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/tr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/tr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/uk.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/uk.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/vi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/vi.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/zh-CN.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/zh-CN.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/zh-TW.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/locales/zh-TW.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/natives_blob.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/natives_blob.bin -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/resources/app.asar: -------------------------------------------------------------------------------- 1 |  2 | {"files":{"index.js":{"size":20,"offset":"0"},"node_modules":{"files":{"lodash":{"files":{"LICENSE":{"size":1233,"offset":"20"},"README.md":{"size":9919,"offset":"1253"},"package.json":{"size":2293,"offset":"11172"}}}}},"package.json":{"size":503,"offset":"13465"}}}console.log('FOO'); 3 | Copyright 2012-2015 The Dojo Foundation 4 | Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, 5 | DocumentCloud and Investigative Reporters & Editors 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | # lodash v3.10.0 26 | 27 | The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules. 28 | 29 | Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli): 30 | ```bash 31 | $ lodash modularize modern exports=node -o ./ 32 | $ lodash modern -d -o ./index.js 33 | ``` 34 | 35 | ## Installation 36 | 37 | Using npm: 38 | 39 | ```bash 40 | $ {sudo -H} npm i -g npm 41 | $ npm i --save lodash 42 | ``` 43 | 44 | In Node.js/io.js: 45 | 46 | ```js 47 | // load the modern build 48 | var _ = require('lodash'); 49 | // or a method category 50 | var array = require('lodash/array'); 51 | // or a method (great for smaller builds with browserify/webpack) 52 | var chunk = require('lodash/array/chunk'); 53 | ``` 54 | 55 | See the [package source](https://github.com/lodash/lodash/tree/3.10.0-npm) for more details. 56 | 57 | **Note:**
58 | Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
59 | Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default. 60 | 61 | ## Module formats 62 | 63 | lodash is also available in a variety of other builds & module formats. 64 | 65 | * npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds 66 | * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.10.0-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.10.0-amd) builds 67 | * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.10.0-es) build 68 | 69 | ## Further Reading 70 | 71 | * [API Documentation](https://lodash.com/docs) 72 | * [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences) 73 | * [Changelog](https://github.com/lodash/lodash/wiki/Changelog) 74 | * [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap) 75 | * [More Resources](https://github.com/lodash/lodash/wiki/Resources) 76 | 77 | ## Features 78 | 79 | * ~100% [code coverage](https://coveralls.io/r/lodash) 80 | * Follows [semantic versioning](http://semver.org/) for releases 81 | * [Lazily evaluated](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/) chaining 82 | * [_(…)](https://lodash.com/docs#_) supports implicit chaining 83 | * [_.ary](https://lodash.com/docs#ary) & [_.rearg](https://lodash.com/docs#rearg) to change function argument limits & order 84 | * [_.at](https://lodash.com/docs#at) for cherry-picking collection values 85 | * [_.attempt](https://lodash.com/docs#attempt) to execute functions which may error without a try-catch 86 | * [_.before](https://lodash.com/docs#before) to complement [_.after](https://lodash.com/docs#after) 87 | * [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods 88 | * [_.chunk](https://lodash.com/docs#chunk) for splitting an array into chunks of a given size 89 | * [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects 90 | * [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects 91 | * [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions 92 | * [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control 93 | * [_.defaultsDeep](https://lodash.com/docs#defaultsDeep) for recursively assigning default properties 94 | * [_.fill](https://lodash.com/docs#fill) to fill arrays with values 95 | * [_.findKey](https://lodash.com/docs#findKey) for finding keys 96 | * [_.flow](https://lodash.com/docs#flow) to complement [_.flowRight](https://lodash.com/docs#flowRight) (a.k.a `_.compose`) 97 | * [_.forEach](https://lodash.com/docs#forEach) supports exiting early 98 | * [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties 99 | * [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties 100 | * [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting 101 | * [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods 102 | * [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range 103 | * [_.isNative](https://lodash.com/docs#isNative) to check for native functions 104 | * [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects 105 | * [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays 106 | * [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object 107 | * [_.matches](https://lodash.com/docs#matches) supports deep object comparisons 108 | * [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property) 109 | * [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend) 110 | * [_.method](https://lodash.com/docs#method) & [_.methodOf](https://lodash.com/docs#methodOf) to create functions that invoke methods 111 | * [_.modArgs](https://lodash.com/docs#modArgs) for more advanced functional composition 112 | * [_.parseInt](https://lodash.com/docs#parseInt) for consistent cross-environment behavior 113 | * [_.pull](https://lodash.com/docs#pull), [_.pullAt](https://lodash.com/docs#pullAt), & [_.remove](https://lodash.com/docs#remove) for mutating arrays 114 | * [_.random](https://lodash.com/docs#random) supports returning floating-point numbers 115 | * [_.restParam](https://lodash.com/docs#restParam) & [_.spread](https://lodash.com/docs#spread) for applying rest parameters & spreading arguments to functions 116 | * [_.runInContext](https://lodash.com/docs#runInContext) for collisionless mixins & easier mocking 117 | * [_.slice](https://lodash.com/docs#slice) for creating subsets of array-like values 118 | * [_.sortByAll](https://lodash.com/docs#sortByAll) & [_.sortByOrder](https://lodash.com/docs#sortByOrder) for sorting by multiple properties & orders 119 | * [_.support](https://lodash.com/docs#support) for flagging environment features 120 | * [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings-imports) options & [ES template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components) 121 | * [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects 122 | * [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined 123 | * [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties 124 | * [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union) 125 | * [_.add](https://lodash.com/docs#add), [_.round](https://lodash.com/docs#round), [_.sum](https://lodash.com/docs#sum), & 126 | [more](https://lodash.com/docs "_.ceil & _.floor") math methods 127 | * [_.bind](https://lodash.com/docs#bind), [_.curry](https://lodash.com/docs#curry), [_.partial](https://lodash.com/docs#partial), & 128 | [more](https://lodash.com/docs "_.bindKey, _.curryRight, _.partialRight") support customizable argument placeholders 129 | * [_.capitalize](https://lodash.com/docs#capitalize), [_.trim](https://lodash.com/docs#trim), & 130 | [more](https://lodash.com/docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string methods 131 | * [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), & 132 | [more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks 133 | * [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), & 134 | [more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest) 135 | * [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), & 136 | [more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods 137 | * [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), & 138 | [more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings 139 | * [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences 140 | * [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence 141 | 142 | ## Support 143 | 144 | Tested in Chrome 42-43, Firefox 37-38, IE 6-11, MS Edge, Opera 28-29, Safari 5-8, ChakraNode 0.12.2, io.js 2.3.1, Node.js 0.8.28, 0.10.38, & 0.12.5, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6. 145 | Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing. 146 | { 147 | "name": "lodash", 148 | "version": "3.10.0", 149 | "description": "The modern build of lodash modular utilities.", 150 | "homepage": "https://lodash.com/", 151 | "icon": "https://lodash.com/icon.svg", 152 | "license": "MIT", 153 | "main": "index.js", 154 | "keywords": [ 155 | "modules", 156 | "stdlib", 157 | "util" 158 | ], 159 | "author": { 160 | "name": "John-David Dalton", 161 | "email": "john.david.dalton@gmail.com", 162 | "url": "http://allyoucanleet.com/" 163 | }, 164 | "contributors": [ 165 | { 166 | "name": "John-David Dalton", 167 | "email": "john.david.dalton@gmail.com", 168 | "url": "http://allyoucanleet.com/" 169 | }, 170 | { 171 | "name": "Benjamin Tan", 172 | "email": "demoneaux@gmail.com", 173 | "url": "https://d10.github.io/" 174 | }, 175 | { 176 | "name": "Blaine Bublitz", 177 | "email": "blaine@iceddev.com", 178 | "url": "http://www.iceddev.com/" 179 | }, 180 | { 181 | "name": "Kit Cambridge", 182 | "email": "github@kitcambridge.be", 183 | "url": "http://kitcambridge.be/" 184 | }, 185 | { 186 | "name": "Mathias Bynens", 187 | "email": "mathias@qiwi.be", 188 | "url": "https://mathiasbynens.be/" 189 | } 190 | ], 191 | "repository": { 192 | "type": "git", 193 | "url": "git+https://github.com/lodash/lodash.git" 194 | }, 195 | "scripts": { 196 | "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" 197 | }, 198 | "bugs": { 199 | "url": "https://github.com/lodash/lodash/issues" 200 | }, 201 | "_id": "lodash@3.10.0", 202 | "_shasum": "93d51c672828a4416a12af57220ba8a8737e2fbb", 203 | "_from": "lodash@>=3.10.0 <4.0.0", 204 | "_npmVersion": "2.12.0", 205 | "_nodeVersion": "0.12.5", 206 | "_npmUser": { 207 | "name": "jdalton", 208 | "email": "john.david.dalton@gmail.com" 209 | }, 210 | "maintainers": [ 211 | { 212 | "name": "jdalton", 213 | "email": "john.david.dalton@gmail.com" 214 | }, 215 | { 216 | "name": "mathias", 217 | "email": "mathias@qiwi.be" 218 | }, 219 | { 220 | "name": "phated", 221 | "email": "blaine@iceddev.com" 222 | }, 223 | { 224 | "name": "kitcambridge", 225 | "email": "github@kitcambridge.be" 226 | }, 227 | { 228 | "name": "d10", 229 | "email": "demoneaux@gmail.com" 230 | } 231 | ], 232 | "dist": { 233 | "shasum": "93d51c672828a4416a12af57220ba8a8737e2fbb", 234 | "tarball": "http://registry.npmjs.org/lodash/-/lodash-3.10.0.tgz" 235 | }, 236 | "directories": {}, 237 | "_resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.0.tgz", 238 | "readme": "ERROR: No README data found!" 239 | } 240 | { 241 | "name": "footest", 242 | "description": "Foo test (with asar).", 243 | "version": "0.0.1", 244 | "license": "MIT", 245 | 246 | "private": true, 247 | "main": "index.js", 248 | 249 | "copyright": "Copyright 2015 Daniel Perez Alvarez", 250 | "projectId": "org.unindented.Foo", 251 | "projectName": "Foo", 252 | "productName": "Foo", 253 | "productUrl": "https://unindented.org/", 254 | "companyName": "Daniel Perez Alvarez", 255 | "companyUrl": "https://unindented.org/", 256 | 257 | "author": "Daniel Perez Alvarez (https://unindented.org/)" 258 | } 259 | -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/resources/atom.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/resources/atom.asar -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/snapshot_blob.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-with-asar/snapshot_blob.bin -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/version: -------------------------------------------------------------------------------- 1 | v0.29.2 -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Daniel Perez Alvarez 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/bartest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT=$(readlink -f "$0") 4 | SCRIPT_PATH=$(dirname "$SCRIPT") 5 | 6 | echo "$SCRIPT_PATH/resources/app/index.js $@" 7 | -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/content_shell.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/content_shell.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/icudtl.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/icudtl.dat -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/libffmpegsumo.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/libffmpegsumo.so -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/libgcrypt.so.11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/libgcrypt.so.11 -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/libnode.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/libnode.so -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/libnotify.so.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/libnotify.so.4 -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/am.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/am.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ar.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ar.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/bg.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/bg.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/bn.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/bn.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ca.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ca.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/cs.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/cs.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/da.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/da.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/de.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/de.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/el.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/el.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/en-GB.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/en-GB.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/en-US.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/en-US.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/es-419.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/es-419.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/es.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/es.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/et.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/et.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/fa.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/fa.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/fi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/fi.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/fil.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/fil.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/fr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/fr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/gu.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/gu.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/he.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/he.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/hi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/hi.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/hr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/hr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/hu.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/hu.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/id.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/id.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/it.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/it.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ja.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ja.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/kn.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/kn.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ko.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ko.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/lt.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/lt.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/lv.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/lv.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ml.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ml.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/mr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/mr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ms.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ms.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/nb.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/nb.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/nl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/nl.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/pl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/pl.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/pt-BR.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/pt-BR.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/pt-PT.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/pt-PT.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ro.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ro.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ru.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ru.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sk.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/sk.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/sl.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/sr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sv.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/sv.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sw.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/sw.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ta.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/ta.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/te.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/te.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/th.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/th.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/tr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/tr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/uk.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/uk.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/vi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/vi.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/zh-CN.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/zh-CN.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/zh-TW.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/locales/zh-TW.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/natives_blob.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/natives_blob.bin -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/resources/app/index.js: -------------------------------------------------------------------------------- 1 | console.log('BAR'); 2 | -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/resources/app/node_modules/lodash/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012-2015 The Dojo Foundation 2 | Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, 3 | DocumentCloud and Investigative Reporters & Editors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/resources/app/node_modules/lodash/README.md: -------------------------------------------------------------------------------- 1 | # lodash v3.10.0 2 | 3 | The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules. 4 | 5 | Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli): 6 | ```bash 7 | $ lodash modularize modern exports=node -o ./ 8 | $ lodash modern -d -o ./index.js 9 | ``` 10 | 11 | ## Installation 12 | 13 | Using npm: 14 | 15 | ```bash 16 | $ {sudo -H} npm i -g npm 17 | $ npm i --save lodash 18 | ``` 19 | 20 | In Node.js/io.js: 21 | 22 | ```js 23 | // load the modern build 24 | var _ = require('lodash'); 25 | // or a method category 26 | var array = require('lodash/array'); 27 | // or a method (great for smaller builds with browserify/webpack) 28 | var chunk = require('lodash/array/chunk'); 29 | ``` 30 | 31 | See the [package source](https://github.com/lodash/lodash/tree/3.10.0-npm) for more details. 32 | 33 | **Note:**
34 | Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
35 | Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default. 36 | 37 | ## Module formats 38 | 39 | lodash is also available in a variety of other builds & module formats. 40 | 41 | * npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds 42 | * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.10.0-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.10.0-amd) builds 43 | * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.10.0-es) build 44 | 45 | ## Further Reading 46 | 47 | * [API Documentation](https://lodash.com/docs) 48 | * [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences) 49 | * [Changelog](https://github.com/lodash/lodash/wiki/Changelog) 50 | * [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap) 51 | * [More Resources](https://github.com/lodash/lodash/wiki/Resources) 52 | 53 | ## Features 54 | 55 | * ~100% [code coverage](https://coveralls.io/r/lodash) 56 | * Follows [semantic versioning](http://semver.org/) for releases 57 | * [Lazily evaluated](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/) chaining 58 | * [_(…)](https://lodash.com/docs#_) supports implicit chaining 59 | * [_.ary](https://lodash.com/docs#ary) & [_.rearg](https://lodash.com/docs#rearg) to change function argument limits & order 60 | * [_.at](https://lodash.com/docs#at) for cherry-picking collection values 61 | * [_.attempt](https://lodash.com/docs#attempt) to execute functions which may error without a try-catch 62 | * [_.before](https://lodash.com/docs#before) to complement [_.after](https://lodash.com/docs#after) 63 | * [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods 64 | * [_.chunk](https://lodash.com/docs#chunk) for splitting an array into chunks of a given size 65 | * [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects 66 | * [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects 67 | * [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions 68 | * [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control 69 | * [_.defaultsDeep](https://lodash.com/docs#defaultsDeep) for recursively assigning default properties 70 | * [_.fill](https://lodash.com/docs#fill) to fill arrays with values 71 | * [_.findKey](https://lodash.com/docs#findKey) for finding keys 72 | * [_.flow](https://lodash.com/docs#flow) to complement [_.flowRight](https://lodash.com/docs#flowRight) (a.k.a `_.compose`) 73 | * [_.forEach](https://lodash.com/docs#forEach) supports exiting early 74 | * [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties 75 | * [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties 76 | * [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting 77 | * [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods 78 | * [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range 79 | * [_.isNative](https://lodash.com/docs#isNative) to check for native functions 80 | * [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects 81 | * [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays 82 | * [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object 83 | * [_.matches](https://lodash.com/docs#matches) supports deep object comparisons 84 | * [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property) 85 | * [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend) 86 | * [_.method](https://lodash.com/docs#method) & [_.methodOf](https://lodash.com/docs#methodOf) to create functions that invoke methods 87 | * [_.modArgs](https://lodash.com/docs#modArgs) for more advanced functional composition 88 | * [_.parseInt](https://lodash.com/docs#parseInt) for consistent cross-environment behavior 89 | * [_.pull](https://lodash.com/docs#pull), [_.pullAt](https://lodash.com/docs#pullAt), & [_.remove](https://lodash.com/docs#remove) for mutating arrays 90 | * [_.random](https://lodash.com/docs#random) supports returning floating-point numbers 91 | * [_.restParam](https://lodash.com/docs#restParam) & [_.spread](https://lodash.com/docs#spread) for applying rest parameters & spreading arguments to functions 92 | * [_.runInContext](https://lodash.com/docs#runInContext) for collisionless mixins & easier mocking 93 | * [_.slice](https://lodash.com/docs#slice) for creating subsets of array-like values 94 | * [_.sortByAll](https://lodash.com/docs#sortByAll) & [_.sortByOrder](https://lodash.com/docs#sortByOrder) for sorting by multiple properties & orders 95 | * [_.support](https://lodash.com/docs#support) for flagging environment features 96 | * [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings-imports) options & [ES template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components) 97 | * [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects 98 | * [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined 99 | * [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties 100 | * [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union) 101 | * [_.add](https://lodash.com/docs#add), [_.round](https://lodash.com/docs#round), [_.sum](https://lodash.com/docs#sum), & 102 | [more](https://lodash.com/docs "_.ceil & _.floor") math methods 103 | * [_.bind](https://lodash.com/docs#bind), [_.curry](https://lodash.com/docs#curry), [_.partial](https://lodash.com/docs#partial), & 104 | [more](https://lodash.com/docs "_.bindKey, _.curryRight, _.partialRight") support customizable argument placeholders 105 | * [_.capitalize](https://lodash.com/docs#capitalize), [_.trim](https://lodash.com/docs#trim), & 106 | [more](https://lodash.com/docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string methods 107 | * [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), & 108 | [more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks 109 | * [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), & 110 | [more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest) 111 | * [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), & 112 | [more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods 113 | * [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), & 114 | [more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings 115 | * [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences 116 | * [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence 117 | 118 | ## Support 119 | 120 | Tested in Chrome 42-43, Firefox 37-38, IE 6-11, MS Edge, Opera 28-29, Safari 5-8, ChakraNode 0.12.2, io.js 2.3.1, Node.js 0.8.28, 0.10.38, & 0.12.5, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6. 121 | Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing. 122 | -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/resources/app/node_modules/lodash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lodash", 3 | "version": "3.10.0", 4 | "description": "The modern build of lodash modular utilities.", 5 | "homepage": "https://lodash.com/", 6 | "icon": "https://lodash.com/icon.svg", 7 | "license": "MIT", 8 | "main": "index.js", 9 | "keywords": [ 10 | "modules", 11 | "stdlib", 12 | "util" 13 | ], 14 | "author": { 15 | "name": "John-David Dalton", 16 | "email": "john.david.dalton@gmail.com", 17 | "url": "http://allyoucanleet.com/" 18 | }, 19 | "contributors": [ 20 | { 21 | "name": "John-David Dalton", 22 | "email": "john.david.dalton@gmail.com", 23 | "url": "http://allyoucanleet.com/" 24 | }, 25 | { 26 | "name": "Benjamin Tan", 27 | "email": "demoneaux@gmail.com", 28 | "url": "https://d10.github.io/" 29 | }, 30 | { 31 | "name": "Blaine Bublitz", 32 | "email": "blaine@iceddev.com", 33 | "url": "http://www.iceddev.com/" 34 | }, 35 | { 36 | "name": "Kit Cambridge", 37 | "email": "github@kitcambridge.be", 38 | "url": "http://kitcambridge.be/" 39 | }, 40 | { 41 | "name": "Mathias Bynens", 42 | "email": "mathias@qiwi.be", 43 | "url": "https://mathiasbynens.be/" 44 | } 45 | ], 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/lodash/lodash.git" 49 | }, 50 | "scripts": { 51 | "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" 52 | }, 53 | "bugs": { 54 | "url": "https://github.com/lodash/lodash/issues" 55 | }, 56 | "_id": "lodash@3.10.0", 57 | "_shasum": "93d51c672828a4416a12af57220ba8a8737e2fbb", 58 | "_from": "lodash@>=3.10.0 <4.0.0", 59 | "_npmVersion": "2.12.0", 60 | "_nodeVersion": "0.12.5", 61 | "_npmUser": { 62 | "name": "jdalton", 63 | "email": "john.david.dalton@gmail.com" 64 | }, 65 | "maintainers": [ 66 | { 67 | "name": "jdalton", 68 | "email": "john.david.dalton@gmail.com" 69 | }, 70 | { 71 | "name": "mathias", 72 | "email": "mathias@qiwi.be" 73 | }, 74 | { 75 | "name": "phated", 76 | "email": "blaine@iceddev.com" 77 | }, 78 | { 79 | "name": "kitcambridge", 80 | "email": "github@kitcambridge.be" 81 | }, 82 | { 83 | "name": "d10", 84 | "email": "demoneaux@gmail.com" 85 | } 86 | ], 87 | "dist": { 88 | "shasum": "93d51c672828a4416a12af57220ba8a8737e2fbb", 89 | "tarball": "http://registry.npmjs.org/lodash/-/lodash-3.10.0.tgz" 90 | }, 91 | "directories": {}, 92 | "_resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.0.tgz", 93 | "readme": "ERROR: No README data found!" 94 | } 95 | -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/resources/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bartest", 3 | "description": "Bar test (without asar).", 4 | "version": "0.0.1", 5 | "license": "MIT", 6 | 7 | "private": true, 8 | "main": "index.js", 9 | 10 | "copyright": "Copyright 2015 Daniel Perez Alvarez", 11 | "projectId": "org.electron-userland.Bar", 12 | "projectName": "Bar", 13 | "productName": "Bar", 14 | "productUrl": "https://github.com/electron-userland/", 15 | "companyName": "Daniel Perez Alvarez", 16 | "companyUrl": "https://github.com/electron-userland/", 17 | 18 | "author": "Daniel Perez Alvarez (https://unindented.org/)" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/resources/atom.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/resources/atom.asar -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/resources/cli/bar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT=$(readlink -f "$0") 4 | SCRIPT_PATH=$(dirname "$SCRIPT") 5 | 6 | BAR_APP_PATH=$(readlink -f "$SCRIPT_PATH/../..") 7 | 8 | "$BAR_APP_PATH/bartest" $@ 9 | -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/snapshot_blob.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/app-without-asar/snapshot_blob.bin -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/version: -------------------------------------------------------------------------------- 1 | v0.29.2 -------------------------------------------------------------------------------- /test/fixtures/app-without-description-or-product-description/resources/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bartest", 3 | "version": "0.0.1", 4 | "license": "MIT", 5 | 6 | "private": true, 7 | "main": "index.js", 8 | 9 | "copyright": "Copyright 2015 Daniel Perez Alvarez", 10 | "projectId": "org.electron-userland.Bar", 11 | "projectName": "Bar", 12 | "productName": "Bar", 13 | "productUrl": "https://github.com/electron-userland/", 14 | "companyName": "Daniel Perez Alvarez", 15 | "companyUrl": "https://github.com/electron-userland/", 16 | 17 | "author": "Daniel Perez Alvarez (https://unindented.org/)" 18 | } 19 | -------------------------------------------------------------------------------- /test/fixtures/app-without-description-or-product-description/version: -------------------------------------------------------------------------------- 1 | v0.29.2 -------------------------------------------------------------------------------- /test/fixtures/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "revision": "2" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/custom.desktop.ejs: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | <% if (productName) { %>Name=<%= productName %> 3 | <% } %>Type=Application 4 | Comment=Hardcoded comment 5 | -------------------------------------------------------------------------------- /test/fixtures/debian-scripts/postinst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | return 0 6 | -------------------------------------------------------------------------------- /test/fixtures/debian-scripts/postrm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | return 0 6 | -------------------------------------------------------------------------------- /test/fixtures/debian-scripts/preinst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | return 0 6 | -------------------------------------------------------------------------------- /test/fixtures/debian-scripts/prerm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | return 0 6 | -------------------------------------------------------------------------------- /test/fixtures/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-debian/677899952ab0242ac8cbfe1627e501051b942887/test/fixtures/icon.png -------------------------------------------------------------------------------- /test/fixtures/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 17 | 18 | 20 | image/svg+xml 21 | 23 | 24 | 25 | 26 | 27 | 30 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /test/helpers/access.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const fs = require('fs-extra') 4 | const retry = require('promise-retry') 5 | 6 | /** 7 | * `fs.access` which retries three times. 8 | */ 9 | module.exports = async function (path) { 10 | return retry((retry, number) => { 11 | return fs.access(path) 12 | .catch(retry) 13 | }, { 14 | retries: 3, 15 | minTimeout: 500 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /test/helpers/describe_installer.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const _ = require('lodash') 4 | const { expect } = require('chai') 5 | const fs = require('fs-extra') 6 | const os = require('os') 7 | const path = require('path') 8 | const tmp = require('tmp-promise') 9 | 10 | const installer = require('../..') 11 | 12 | module.exports = function describeInstaller (description, installerOptions, itDescription, itFunc) { 13 | describe(description, test => { 14 | const outputDir = module.exports.tempOutputDir(installerOptions.dest) 15 | const options = module.exports.testInstallerOptions(outputDir, installerOptions) 16 | 17 | before(() => installer(options)) 18 | 19 | it(itDescription, () => itFunc(outputDir)) 20 | 21 | module.exports.cleanupOutputDir(outputDir) 22 | }) 23 | } 24 | 25 | module.exports.describeInstallerWithException = function describeInstallerWithException (description, installerOptions, errorRegex) { 26 | describe(description, () => { 27 | const outputDir = module.exports.tempOutputDir() 28 | module.exports.cleanupOutputDir(outputDir) 29 | 30 | it('throws an error', () => { 31 | const options = module.exports.testInstallerOptions(outputDir, installerOptions) 32 | return installer(options) 33 | .catch(error => expect(error.message).to.match(errorRegex)) 34 | }) 35 | }) 36 | } 37 | 38 | module.exports.cleanupOutputDir = function cleanupOutputDir (outputDir) { 39 | after(() => fs.remove(outputDir)) 40 | } 41 | 42 | module.exports.tempOutputDir = function tempOutputDir (customDir) { 43 | return customDir ? path.join(os.tmpdir(), customDir) : tmp.tmpNameSync({ prefix: 'electron-installer-debian-' }) 44 | } 45 | 46 | module.exports.testInstallerOptions = function testInstallerOptions (outputDir, installerOptions) { 47 | return _.merge({ 48 | rename: debFile => { 49 | return path.join(debFile, '<%= name %>_<%= arch %>.deb') 50 | }, 51 | options: { 52 | arch: 'amd64' 53 | } 54 | }, installerOptions, { dest: outputDir }) 55 | } 56 | -------------------------------------------------------------------------------- /test/installer.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const chai = require('chai') 4 | const path = require('path') 5 | const { spawn } = require('@malept/cross-spawn-promise') 6 | 7 | const installer = require('..') 8 | 9 | const access = require('./helpers/access') 10 | const describeInstaller = require('./helpers/describe_installer') 11 | const { cleanupOutputDir, describeInstallerWithException, tempOutputDir, testInstallerOptions } = require('./helpers/describe_installer') 12 | 13 | const assertASARDebExists = outputDir => 14 | access(path.join(outputDir, 'footest_i386.deb')) 15 | 16 | const assertNonASARDebExists = outputDir => 17 | access(path.join(outputDir, 'bartest_amd64.deb')) 18 | 19 | describe('module', function () { 20 | this.timeout(30000) 21 | 22 | describeInstaller( 23 | 'with an app with asar', 24 | { 25 | src: 'test/fixtures/app-with-asar/', 26 | options: { 27 | productDescription: 'Just a test.', 28 | section: 'devel', 29 | priority: 'optional', 30 | arch: 'i386', 31 | recommends: [], 32 | suggests: [], 33 | categories: [] 34 | } 35 | }, 36 | 'generates a .deb package', 37 | assertASARDebExists 38 | ) 39 | 40 | describeInstaller( 41 | 'with an app without asar', 42 | { 43 | src: 'test/fixtures/app-without-asar/', 44 | options: { 45 | icon: { 46 | '1024x1024': 'test/fixtures/icon.png', 47 | scalable: 'test/fixtures/icon.svg' 48 | }, 49 | bin: 'resources/cli/bar.sh', 50 | productDescription: 'Just a test.', 51 | section: 'devel', 52 | priority: 'optional', 53 | depends: [], 54 | recommends: [], 55 | suggests: [], 56 | categories: [ 57 | 'Utility' 58 | ], 59 | mimeType: [ 60 | 'text/plain' 61 | ], 62 | lintianOverrides: [ 63 | 'changelog-file-missing-in-native-package', 64 | 'executable-not-elf-or-script' 65 | ] 66 | } 67 | }, 68 | 'generates a .deb package', 69 | assertNonASARDebExists 70 | ) 71 | 72 | describeInstallerWithException( 73 | 'with a too-short name', 74 | { 75 | name: 'a', 76 | src: 'test/fixtures/app-with-asar' 77 | }, 78 | /^Package name must be at least two characters$/ 79 | ) 80 | 81 | describeInstallerWithException( 82 | 'with a name that does not start with an alphanumeric character', 83 | { 84 | name: '-package', 85 | src: 'test/fixtures/app-with-asar' 86 | }, 87 | /^Package name must start with an ASCII number or letter$/ 88 | ) 89 | 90 | describeInstaller( 91 | 'with an app with a multi-line description', 92 | { 93 | src: 'test/fixtures/app-without-asar/', 94 | options: { 95 | description: 'Line one\nLine 2\rLine3\r\nLine 4' 96 | } 97 | }, 98 | 'generates a .deb package', 99 | assertNonASARDebExists 100 | ) 101 | 102 | describeInstaller( 103 | 'with an app with a multi-line productDescription', 104 | { 105 | src: 'test/fixtures/app-without-asar/', 106 | options: { 107 | productDescription: 'Line one:\r\n *Line 2\n\nLine3\nLine 4' 108 | } 109 | }, 110 | 'generates a .deb package', 111 | assertNonASARDebExists 112 | ) 113 | 114 | describeInstaller( 115 | 'with an app with a productDescription containing a blank line', 116 | { 117 | src: 'test/fixtures/app-without-asar/', 118 | options: { 119 | productDescription: 'Line one\n\nLine 2 after a blank line' 120 | } 121 | }, 122 | 'generates a .deb package', 123 | assertNonASARDebExists 124 | ) 125 | 126 | describeInstallerWithException( 127 | 'with no description or productDescription provided', 128 | { src: 'test/fixtures/app-without-description-or-product-description/' }, 129 | /^No Description or ProductDescription provided/ 130 | ) 131 | 132 | if (process.platform !== 'darwin') { 133 | describeInstaller( 134 | 'with debian scripts and lintian overrides', 135 | { 136 | src: 'test/fixtures/app-with-asar/', 137 | options: { 138 | productDescription: 'Just a test.', 139 | arch: 'i386', 140 | scripts: { 141 | preinst: 'test/fixtures/debian-scripts/preinst.sh', 142 | postinst: 'test/fixtures/debian-scripts/postinst.sh', 143 | prerm: 'test/fixtures/debian-scripts/prerm.sh', 144 | postrm: 'test/fixtures/debian-scripts/postrm.sh' 145 | }, 146 | lintianOverrides: [ 147 | 'binary-without-manpage', 148 | 'changelog-file-missing-in-native-package', 149 | 'executable-not-elf-or-script' 150 | ] 151 | } 152 | }, 153 | 'passes lintian checks', 154 | async outputDir => { 155 | await assertASARDebExists(outputDir) 156 | try { 157 | await spawn('lintian', [path.join(outputDir, 'footest_i386.deb')], { 158 | updateErrorCallback: (err) => { 159 | if (err.code === 'ENOENT' && err.syscall === 'spawn lintian') { 160 | err.message = 'Your system is missing the lintian package' 161 | } 162 | } 163 | }) 164 | } catch (err) { 165 | if (!err.stdout) { 166 | throw err 167 | } 168 | const stdout = err.stdout.toString() 169 | const lineCount = stdout.match(/\n/g).length 170 | if (lineCount > 1) { 171 | throw new Error(`Warnings not overriding:\n${stdout}`) 172 | } 173 | } 174 | } 175 | ) 176 | } 177 | 178 | describeInstaller( 179 | 'correct owner and permissions for chrome-sandbox', 180 | { 181 | src: 'test/fixtures/app-with-asar/', 182 | options: { 183 | arch: 'i386' 184 | } 185 | }, 186 | 'chrome-sandbox is owned by root and has the suid bit', 187 | async outputDir => { 188 | await assertASARDebExists(outputDir) 189 | 190 | const output = await spawn('dpkg-deb', ['--contents', path.join(outputDir, 'footest_i386.deb')]) 191 | const entries = output.split('\n').map(line => line.split(/\s+/)) 192 | 193 | const chromeSandbox = entries.find(entry => entry[5].endsWith('/chrome-sandbox')) 194 | if (chromeSandbox === undefined) { 195 | throw new Error('Could not find chrome-sandbox') 196 | } 197 | 198 | const permissions = chromeSandbox[0] 199 | chai.expect(permissions).to.equal('-rwsr-xr-x') 200 | 201 | const owner = chromeSandbox[1] 202 | chai.expect(owner).to.equal('root/root') 203 | } 204 | ) 205 | 206 | describeInstallerWithException( 207 | 'unknown script name', 208 | { 209 | src: 'test/fixtures/app-with-asar/', 210 | scripts: { 211 | invalid: 'test/fixtures/debian-scripts/preinst.sh' 212 | } 213 | }, 214 | /^Wrong executable script name: invalid$/ 215 | ) 216 | 217 | describe('with restrictive umask', test => { 218 | const outputDir = tempOutputDir() 219 | let defaultMask 220 | let consoleWarn 221 | let warning = '' 222 | 223 | before(() => { 224 | defaultMask = process.umask(0o777) 225 | consoleWarn = console.warn 226 | console.warn = msg => { 227 | warning += msg 228 | } 229 | }) 230 | 231 | it('warns the user about umasks', () => { 232 | const installerOptions = testInstallerOptions(outputDir, { 233 | src: 'test/fixtures/app-with-asar/', 234 | options: { arch: 'i386' } 235 | }) 236 | return installer(installerOptions) 237 | .catch(() => chai.expect(warning).to.contain(`The current umask, ${process.umask().toString(8)}, is not supported. You should use 0022 or 0002`)) 238 | }) 239 | 240 | cleanupOutputDir(outputDir) 241 | 242 | after(() => { 243 | console.warn = consoleWarn 244 | process.umask(defaultMask) 245 | }) 246 | }) 247 | 248 | describe('transformVersion', () => { 249 | it('uses tildes for pre-release versions', () => { 250 | chai.expect(installer.transformVersion('1.2.3')).to.equal('1.2.3') 251 | chai.expect(installer.transformVersion('1.2.3-beta.4')).to.equal('1.2.3~beta.4') 252 | }) 253 | }) 254 | 255 | describeInstaller( 256 | 'with different compression type', 257 | { 258 | src: 'test/fixtures/app-with-asar/', 259 | options: { 260 | arch: 'i386', 261 | compression: 'gzip' 262 | } 263 | }, 264 | 'generates a .deb package with gzip', 265 | async outputDir => { 266 | await assertASARDebExists(outputDir) 267 | 268 | const output = await spawn('file', [path.join(outputDir, 'footest_i386.deb')]) 269 | chai.expect(output).to.contain('compression gz') 270 | } 271 | ) 272 | 273 | describeInstallerWithException( 274 | 'with wrong compression type', 275 | { 276 | src: 'test/fixtures/app-with-asar/', 277 | options: { 278 | compression: 'invalid' 279 | } 280 | }, 281 | /^Invalid compression type. xz, gzip, bzip2, lzma, zstd, or none are supported.$/ 282 | ) 283 | }) 284 | -------------------------------------------------------------------------------- /test/spawn.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const chai = require('chai') 4 | const spawn = require('../src/spawn') 5 | 6 | describe('spawn', () => { 7 | let oldPath 8 | 9 | before(() => { 10 | oldPath = process.env.PATH 11 | process.env.PATH = '/non-existent-path' 12 | }) 13 | 14 | it('should throw a human-friendly error when it cannot find dpkg or fakeroot', async () => { 15 | try { 16 | await spawn('dpkg', ['--version'], msg => {}) 17 | throw new Error('dpkg should not have been executed') 18 | } catch (error) { 19 | chai.expect(error.message).to.match(/Error executing command \(dpkg --version\):\nYour system is missing the dpkg package/) 20 | } 21 | }) 22 | 23 | after(() => { 24 | process.env.PATH = oldPath 25 | }) 26 | }) 27 | --------------------------------------------------------------------------------