├── .eslintignore ├── .eslintrc ├── .github ├── ISSUE_TEMPLATE.md ├── dependabot.yml └── workflows │ └── ci.yml ├── .gitignore ├── .husky ├── .gitignore └── pre-commit ├── .npmignore ├── LICENSE ├── NEWS.md ├── README.md ├── 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 ├── desktop.ejs ├── icon.png ├── logo.png └── spec.ejs ├── src ├── cli.js ├── dependencies.js ├── installer.js ├── spawn.js └── util.js └── test ├── .eslintrc ├── cli.js ├── dependencies.js ├── fixtures ├── app-with-asar │ ├── LICENSE │ ├── 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 ├── custom.desktop.ejs ├── custom.spec.ejs ├── icon.png ├── scaled-icon.svg └── script ├── helpers ├── access.js └── describe_installer.js ├── installer.js ├── spawn.js └── util.js /.eslintignore: -------------------------------------------------------------------------------- 1 | test/fixtures 2 | node_modules 3 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "standard" 3 | } 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **What version of `electron-installer-redhat` 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-redhat/tree/main/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-redhat.git 13 | $ cd electron-installer-redhat/example 14 | $ DEBUG='electron-installer-redhat' npm run build 15 | ``` 16 | 17 | **What did you do? Please include the configuration you are using for `electron-installer-redhat`.** 18 | 19 | **What did you expect to happen?** 20 | 21 | **What actually happened?** 22 | 23 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | permissions: 12 | contents: read 13 | 14 | jobs: 15 | build: 16 | runs-on: ${{ matrix.os }} 17 | strategy: 18 | matrix: 19 | os: [ubuntu-latest] 20 | node-version: [10.x, 12.x, 14.x, 16.x, 18.x] 21 | 22 | steps: 23 | - name: Install macOS dependencies 24 | if: matrix.os == 'macos-13' 25 | run: brew install rpm 26 | - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 27 | - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 28 | with: 29 | node-version: ${{ matrix.node-version }} 30 | - name: Get npm cache directory 31 | id: npm-cache-dir 32 | run: | 33 | echo "::set-output name=dir::$(npm config get cache)" 34 | - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 35 | id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' 36 | with: 37 | path: ${{ steps.npm-cache-dir.outputs.dir }} 38 | key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} 39 | restore-keys: | 40 | ${{ runner.os }}-node- 41 | - name: Install 42 | run: | 43 | npm install --engine-strict 44 | npm update 45 | - name: Test 46 | run: npm test 47 | env: 48 | DEBUG: 'electron-installer-redhat' 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /example/dist/ 2 | /example/node_modules/ 3 | /node_modules/ 4 | package-lock.json 5 | yarn.lock 6 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | "$(npm bin)"/lint-staged 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /example/ 2 | /test/ 3 | /.* 4 | -------------------------------------------------------------------------------- /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-redhat` - Changes by Version 2 | 3 | ## [Unreleased] 4 | 5 | [Unreleased]: https://github.com/electron-userland/electron-installer-redhat/compare/v3.4.0...main 6 | 7 | ## [3.4.0] - 2023-02-28 8 | 9 | [3.4.0]: https://github.com/electron-userland/electron-installer-redhat/compare/v3.3.0...v3.4.0 10 | 11 | ### Added 12 | 13 | * Add options.platform to set %_target_os (#175, #196) 14 | 15 | ### Fixed 16 | 17 | * Skip stripping when making RPM for different architecture (#325) 18 | 19 | ## [3.3.0] - 2021-02-05 20 | 21 | [3.3.0]: https://github.com/electron-userland/electron-installer-redhat/compare/v3.2.0...v3.3.0 22 | 23 | ### Added 24 | 25 | * Support for OpenSuse Leap dependencies (#182) 26 | 27 | ## [3.2.0] - 2020-07-23 28 | 29 | [3.2.0]: https://github.com/electron-userland/electron-installer-redhat/compare/v3.1.0...v3.2.0 30 | 31 | ### Added 32 | 33 | * Support for scalable and symbolic icons (#169) 34 | 35 | ### Fixed 36 | 37 | * Conformance to [RPM spec formatting guidelines](https://fedoraproject.org/wiki/PeterGordon/SpecFormattingGuidelines) (#171) 38 | 39 | ## [3.1.0] - 2020-06-28 40 | 41 | [3.1.0]: https://github.com/electron-userland/electron-installer-redhat/compare/v3.0.0...v3.1.0 42 | 43 | ### Added 44 | 45 | * Dependencies for Electron >= 9 (#156) 46 | 47 | ### Fixed 48 | 49 | * Stop overwriting `~/.rpmmacros` (#160) 50 | * Handle parsing versions from RPM >= 4.15 (#162) 51 | * Define array options for CLI (#166) 52 | 53 | ## [3.0.0] - 2020-01-22 54 | 55 | [3.0.0]: https://github.com/electron-userland/electron-installer-redhat/compare/v2.0.0...v3.0.0 56 | 57 | ### Added 58 | 59 | * Electron 8 dependency compatibility (electron-userland/electron-installer-common#45) 60 | 61 | ### Removed 62 | 63 | * Node < 10 support (#151) 64 | 65 | ## [2.0.0] - 2019-06-11 66 | 67 | [2.0.0]: https://github.com/electron-userland/electron-installer-redhat/compare/v1.1.0...v2.0.0 68 | 69 | ### Added 70 | 71 | * ATSPI dependency for Electron >= 5 (#126) 72 | 73 | ### Fixed 74 | 75 | * Always add revision/release to the RPM filename (#114) 76 | * Include SVG files into the spec file (#125) 77 | 78 | ### Removed 79 | 80 | * Node-style callback support (use [`util.callbackify`](https://nodejs.org/api/util.html#util_util_callbackify_original) 81 | if you need that functionality) 82 | * Node < 8 support (#121) 83 | 84 | ## [1.1.0] - 2019-05-01 85 | 86 | [1.1.0]: https://github.com/electron-userland/electron-installer-redhat/compare/v1.0.1...v1.1.0 87 | 88 | ### Added 89 | 90 | * Support for SUID sandbox helper in Electron >= 5 (#112) 91 | 92 | ## [1.0.1] - 2019-02-20 93 | 94 | [1.0.1]: https://github.com/electron-userland/electron-installer-redhat/compare/v1.0.0...v1.0.1 95 | 96 | ### Changed 97 | 98 | * Upgrade to `electron-installer-common@^0.6.1` (#104) 99 | 100 | ## [1.0.0] - 2019-01-07 101 | 102 | [1.0.0]: https://github.com/electron-userland/electron-installer-redhat/compare/v0.5.0...v1.0.0 103 | 104 | ### Added 105 | 106 | * Promises support (#86) 107 | * Custom installation scripts (#90) 108 | * The ability to specify a custom `.desktop` file template (#91) 109 | * Sanitize summary and description values (#97) 110 | * Merge user dependencies with Electron dependencies (#98, #99) 111 | * Sanitize package names to conform to Fedora policy (#101) 112 | 113 | ### Changed 114 | 115 | * Install apps to `/usr/lib` instead of `/usr/share` (#77) 116 | * RPMs no longer run `update-desktop-database` by default (#90) 117 | 118 | 119 | ### Removed 120 | 121 | * Node < 6 support (#94) 122 | * Deprecated `group` option (#97) 123 | 124 | ---- 125 | 126 | For versions prior to 1.0.0, please see `git log`. 127 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Electron Installer for Red Hat](resources/logo.png) 2 | 3 | # electron-installer-redhat [![Version](https://img.shields.io/npm/v/electron-installer-redhat.svg)](https://www.npmjs.com/package/electron-installer-redhat) [![Build Status](https://img.shields.io/travis/electron-userland/electron-installer-redhat.svg)](http://travis-ci.org/electron-userland/electron-installer-redhat) 4 | 5 | > Create a Red Hat package for your Electron app. 6 | 7 | 8 | ## Requirements 9 | 10 | This tool requires Node 10 or greater and `rpmbuild` 4.13 or greater to build the `.rpm` package. 11 | 12 | **Note**: RPM 4.13.0 or greater is required due to the [boolean dependency feature](http://rpm.org/user_doc/boolean_dependencies.html). 13 | 14 | On Fedora you can do something like this: 15 | 16 | ``` 17 | $ sudo dnf install rpm-build 18 | ``` 19 | 20 | While on Debian/Ubuntu you'll need to do this instead: 21 | 22 | ``` 23 | $ sudo apt-get install rpm 24 | ``` 25 | 26 | ## Installation 27 | 28 | For use from command-line: 29 | 30 | ``` 31 | $ npm install -g electron-installer-redhat 32 | ``` 33 | 34 | For use in npm scripts or programmatically: 35 | 36 | ``` 37 | $ npm install --save-dev electron-installer-redhat 38 | ``` 39 | 40 | 41 | ## Usage 42 | 43 | Say your Electron app lives in `path/to/app`, and has a structure like this: 44 | 45 | ``` 46 | . 47 | ├── LICENSE 48 | ├── README.md 49 | ├── node_modules 50 | │   ├── electron-packager 51 | │   └── electron 52 | ├── package.json 53 | ├── resources 54 | │   ├── Icon.png 55 | │   ├── IconTemplate.png 56 | │   └── IconTemplate@2x.png 57 | └── src 58 | ├── index.js 59 | ├── main 60 | │   └── index.js 61 | └── renderer 62 | ├── index.html 63 | └── index.js 64 | ``` 65 | 66 | You now run `electron-packager` to build the app for Red Hat: 67 | 68 | ``` 69 | $ electron-packager . app --platform linux --arch x64 --out dist/ 70 | ``` 71 | 72 | And you end up with something like this in your `dist` folder: 73 | 74 | ``` 75 | . 76 | └── dist 77 |    └── app-linux-x64 78 |    ├── LICENSE 79 |    ├── LICENSES.chromium.html 80 |    ├── content_shell.pak 81 |    ├── app 82 |    ├── icudtl.dat 83 |    ├── libgcrypt.so.11 84 |    ├── libnode.so 85 |    ├── locales 86 |    ├── natives_blob.bin 87 |    ├── resources 88 |    ├── snapshot_blob.bin 89 |    └── version 90 | ``` 91 | 92 | How do you turn that into a Red Hat package that your users can install? 93 | 94 | ### Command-Line 95 | 96 | If you want to run `electron-installer-redhat` straight from the command-line, install the package globally: 97 | 98 | ``` 99 | $ npm install -g electron-installer-redhat 100 | ``` 101 | 102 | And point it to your built app: 103 | 104 | ``` 105 | $ electron-installer-redhat --src dist/app-linux-x64/ --dest dist/installers/ --arch x86_64 106 | ``` 107 | 108 | You'll end up with the package at `dist/installers/app-0.0.1-1.x86_64.rpm`. 109 | 110 | ### Scripts 111 | 112 | If you want to run `electron-installer-redhat` through npm, install the package locally: 113 | 114 | ``` 115 | $ npm install --save-dev electron-installer-redhat 116 | ``` 117 | 118 | Edit the `scripts` section of your `package.json`: 119 | 120 | ```json 121 | { 122 | "name": "app", 123 | "description": "An awesome app!", 124 | "version": "0.0.1", 125 | "scripts": { 126 | "start": "electron .", 127 | "build": "electron-packager . app --platform linux --arch x64 --out dist/", 128 | "rpm64": "electron-installer-redhat --src dist/app-linux-x64/ --dest dist/installers/ --arch x86_64" 129 | }, 130 | "devDependencies": { 131 | "electron-installer-redhat": "*", 132 | "electron-packager": "*", 133 | "electron-prebuilt": "*" 134 | } 135 | } 136 | ``` 137 | 138 | And run the script: 139 | 140 | ``` 141 | $ npm run rpm64 142 | ``` 143 | 144 | You'll end up with the package at `dist/installers/app-0.0.1-1.x86_64.rpm`. 145 | 146 | ### Programmatically 147 | 148 | Install the package locally: 149 | 150 | ```shell 151 | $ npm install --save-dev electron-installer-redhat 152 | ``` 153 | 154 | And write something like this: 155 | 156 | ```javascript 157 | const installer = require('electron-installer-redhat') 158 | 159 | const options = { 160 | src: 'dist/app-linux-x64/', 161 | dest: 'dist/installers/', 162 | arch: 'x86_64' 163 | } 164 | 165 | async function main (options) { 166 | console.log('Creating package (this may take a while)') 167 | 168 | try { 169 | await installer(options) 170 | console.log(`Successfully created package at ${options.dest}`) 171 | } catch (err) { 172 | console.error(err, err.stack) 173 | process.exit(1) 174 | } 175 | } 176 | main(options) 177 | ``` 178 | 179 | You'll end up with the package at `dist/installers/app-0.0.1-1.x86_64.rpm`. 180 | 181 | _Note: As of 2.0.0, the Node-style callback pattern is no longer available. You can use [`util.callbackify`](https://nodejs.org/api/util.html#util_util_callbackify_original) if this is required for your use case._ 182 | 183 | ### Options 184 | 185 | Even though you can pass most of these options through the command-line interface, it may be easier to create a configuration file: 186 | 187 | ```javascript 188 | { 189 | "dest": "dist/installers/", 190 | "icon": "resources/Icon.png", 191 | "categories": [ 192 | "Utility" 193 | ] 194 | } 195 | ``` 196 | 197 | And pass that instead with the `config` option: 198 | 199 | ```shell 200 | $ electron-installer-redhat --src dist/app-linux-x64/ --arch x86_64 --config config.json 201 | ``` 202 | 203 | Anyways, here's the full list of options: 204 | 205 | #### src 206 | Type: `String` 207 | Default: `undefined` 208 | 209 | Path to the folder that contains your built Electron application. 210 | 211 | #### dest 212 | Type: `String` 213 | Default: `undefined` 214 | 215 | Path to the folder that will contain your Red Hat installer. 216 | 217 | #### rename 218 | Type: `Function` 219 | Default: `function (dest, src) { return path.join(dest, src); }` 220 | 221 | Function that renames all files generated by the task just before putting them in your `dest` folder. 222 | 223 | #### options.name 224 | Type: `String` 225 | Default: `package.name` 226 | 227 | Name of the package (e.g. `atom`), used in the [`Name` field of the `spec` file](https://fedoraproject.org/wiki/Packaging:NamingGuidelines). 228 | 229 | #### options.productName 230 | Type: `String` 231 | Default: `package.productName || package.name` 232 | 233 | 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). 234 | 235 | #### options.genericName 236 | Type: `String` 237 | Default: `package.genericName || package.productName || package.name` 238 | 239 | 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). 240 | 241 | #### options.description 242 | Type: `String` 243 | Default: `package.description` 244 | 245 | Short, one-line description of the application; do not end with a period. 246 | Used in the [`Summary` field of the `spec` file](https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/index.html#con_rpm-spec-file-overview). 247 | 248 | #### options.productDescription 249 | Type: `String` 250 | Default: `package.productDescription || package.description` 251 | 252 | Long description of the application, used in the [`%description` tag of the `spec` file](https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/index.html#con_rpm-spec-file-overview). 253 | 254 | #### options.version 255 | Type: `String` 256 | Default: `package.version` 257 | 258 | Version number of the package, used in the [`Version` field of the `spec` file](https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/index.html#con_rpm-spec-file-overview). 259 | 260 | #### options.revision 261 | Type: `String` 262 | Default: `package.revision || 1` 263 | 264 | Revision number of the package, used in the [`Release` field of the `spec` file](https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/index.html#con_rpm-spec-file-overview). 265 | 266 | #### options.license 267 | Type: `String` 268 | Default: `package.license` 269 | 270 | License of the package, used in the [`License` field of the `spec` file](https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/index.html#con_rpm-spec-file-overview). 271 | 272 | #### options.arch 273 | Type: `String` 274 | Default: `undefined` 275 | 276 | Machine architecture the package is targeted to, used to set the `--target` option. 277 | 278 | #### options.platform 279 | Type: `String` 280 | Default: Operating system platform of the host machine. For possible values see Node.js [process.platform](https://nodejs.org/api/process.html#process_process_platform) 281 | 282 | Operating system platform the package is targeted to, used to set the [`--target`](https://linux.die.net/man/8/rpmbuild) option. 283 | 284 | #### options.requires 285 | Type: `Array[String]` 286 | Default: The minimum list of packages needed for Electron to run 287 | 288 | Packages that are required when the program starts, used in the [`Requires` field of the `spec` file](https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/index.html#con_rpm-spec-file-overview). 289 | 290 | All user requirements will be appended to the default array of requirements, and any duplicates will be removed. 291 | 292 | #### options.homepage 293 | Type: `String` 294 | Default: `package.homepage || package.author.url` 295 | 296 | URL of the homepage for the package, used in the [`URL` field of the `spec` specification](https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/index.html#con_rpm-spec-file-overview). 297 | 298 | #### options.compressionLevel 299 | Type: `Number` 300 | Default: `2` 301 | 302 | Package compression level, from `0` to `9`. 303 | 304 | #### options.bin 305 | Type: `String` 306 | Default: `package.name` 307 | 308 | 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). 309 | 310 | The generated package will contain a symlink `/usr/bin/<%= options.name %>` pointing to the path provided here. 311 | 312 | For example, providing this configuration: 313 | 314 | ```js 315 | { 316 | src: '...', 317 | dest: '...', 318 | name: 'foo', 319 | bin: 'resources/cli/launcher.sh' 320 | } 321 | ``` 322 | 323 | Will create a package with the following symlink: 324 | 325 | ``` 326 | usr/bin/foo@ -> ../share/foo/resources/cli/launcher/sh 327 | ``` 328 | 329 | And a desktop specification with the following `Exec` key: 330 | 331 | ``` 332 | Exec=foo %U 333 | ``` 334 | 335 | #### options.execArguments 336 | Type: `Array[String]` 337 | Default: `[]` 338 | 339 | Command-line arguments to pass to the executable. Will be added to the [`Exec` field of the `desktop` specification](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). 340 | 341 | #### options.icon 342 | Type: `String` or `Object[String:String]` 343 | Default: `undefined` 344 | 345 | Path to a single image that will act as icon for the application: 346 | 347 | ```js 348 | { 349 | icon: 'resources/Icon.png' 350 | } 351 | ``` 352 | 353 | Or multiple images with their corresponding resolutions: 354 | 355 | ```js 356 | { 357 | icon: { 358 | '48x48': 'resources/Icon48.png', 359 | '64x64': 'resources/Icon64.png', 360 | '128x128': 'resources/Icon128.png', 361 | '256x256': 'resources/Icon256.png', 362 | 'scalable': 'resources/Icon.svg', 363 | 'symbolic': 'resources/Icon-symbolic.svg', 364 | } 365 | } 366 | ``` 367 | Per the [icon theme specification](https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-0.11.html), image files must either PNGs or SVGs. The SVG format can only be used for the `scalable` or `symbolic` resolutions. 368 | 369 | 370 | #### options.categories 371 | Type: `Array[String]` 372 | Default: `[]` 373 | 374 | 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). 375 | 376 | For possible values check out the [Desktop Menu Specification](http://standards.freedesktop.org/menu-spec/latest/apa.html). 377 | 378 | #### options.mimeType 379 | Type: `Array[String]` 380 | Default: `[]` 381 | 382 | 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). 383 | 384 | If this option is specified, make sure to run `update-desktop-database &> /dev/null` as part of the `post` and `postun` scripts to refresh the [cached database of MIME types](https://fedoraproject.org/wiki/NewMIMESystem). 385 | 386 | 387 | #### options.scripts 388 | Type: `Object[String:String]` 389 | Default: `undefined` 390 | 391 | Path to [installation scripts](https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/) with their corresponding name. The files contents will be added to the spec file. 392 | 393 | ```javascript 394 | { 395 | scripts: { 396 | 'pre': 'resources/pre_script', 397 | 'post': 'resources/post_script', 398 | 'preun': 'resources/preun_script', 399 | 'postun': 'resources/postun_script' 400 | } 401 | } 402 | ``` 403 | 404 | #### options.desktopTemplate 405 | Type: `String` 406 | Default: [`resources/desktop.ejs`](https://github.com/electron-userland/electron-installer-redhat/blob/main/resources/desktop.ejs) 407 | 408 | The absolute path to a custom template for the generated [FreeDesktop.org desktop entry](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html) file. 409 | 410 | #### options.specTemplate 411 | Type: `String` 412 | Default: [`resources/spec.ejs`](https://github.com/electron-userland/electron-installer-redhat/blob/main/resources/spec.ejs) 413 | 414 | The absolute path to a custom template for the generated [SPEC file](https://rpm-packaging-guide.github.io/#what-is-a-spec-file). 415 | 416 | ## Meta 417 | 418 | * Code: `git clone git://github.com/electron-userland/electron-installer-redhat.git` 419 | * Home: 420 | 421 | 422 | ## Contributors 423 | 424 | * Daniel Perez Alvarez ([unindented@gmail.com](mailto:unindented@gmail.com)) 425 | 426 | 427 | ## License 428 | 429 | 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. 430 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Example App 2 | 3 | From this directory, run the following commands to build the Red Hat packages for the app: 4 | 5 | ``` 6 | $ npm install 7 | $ npm run build 8 | ``` 9 | 10 | Take the `.rpm` 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 | } 8 | -------------------------------------------------------------------------------- /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 | "rpm:x64": "electron-installer-redhat --src dist/example-electron-app-linux-x64/ --arch x86_64 --config config.json", 18 | "build": "npm run clean && npm run bundle:x64 && npm run rpm:x64" 19 | }, 20 | "devDependencies": { 21 | "electron": "^9.1.0", 22 | "electron-installer-redhat": "*", 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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/example/resources/Icon.icns -------------------------------------------------------------------------------- /example/resources/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/example/resources/Icon.ico -------------------------------------------------------------------------------- /example/resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/example/resources/Icon.png -------------------------------------------------------------------------------- /example/resources/IconBlackTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/example/resources/IconBlackTemplate.png -------------------------------------------------------------------------------- /example/resources/IconBlackTemplate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/example/resources/IconBlackTemplate@2x.png -------------------------------------------------------------------------------- /example/resources/IconWhiteTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/example/resources/IconWhiteTemplate.png -------------------------------------------------------------------------------- /example/resources/IconWhiteTemplate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat", 3 | "description": "Create a Red Hat package for your Electron app.", 4 | "version": "3.4.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-redhat.git" 14 | }, 15 | "keywords": [ 16 | "electron", 17 | "redhat" 18 | ], 19 | "os": [ 20 | "darwin", 21 | "linux" 22 | ], 23 | "engines": { 24 | "node": ">= 10.0.0" 25 | }, 26 | "main": "src/installer.js", 27 | "bin": { 28 | "electron-installer-redhat": "src/cli.js" 29 | }, 30 | "scripts": { 31 | "lint": "eslint .", 32 | "spec": "mocha", 33 | "test": "npm run lint && npm run spec", 34 | "prepare": "husky install" 35 | }, 36 | "dependencies": { 37 | "@malept/cross-spawn-promise": "^1.0.0", 38 | "debug": "^4.1.1", 39 | "electron-installer-common": "^0.10.2", 40 | "fs-extra": "^9.0.0", 41 | "lodash": "^4.17.15", 42 | "word-wrap": "^1.2.3", 43 | "yargs": "^16.0.2" 44 | }, 45 | "devDependencies": { 46 | "chai": "^4.2.0", 47 | "chai-as-promised": "^7.1.1", 48 | "eslint": "^7.2.0", 49 | "eslint-config-standard": "^16.0.0", 50 | "eslint-plugin-import": "^2.20.0", 51 | "eslint-plugin-node": "^11.0.0", 52 | "eslint-plugin-promise": "^5.1.0", 53 | "eslint-plugin-standard": "^5.0.0", 54 | "husky": "^6.0.0", 55 | "lint-staged": "^10.2.7", 56 | "mocha": "^8.0.1", 57 | "promise-retry": "^2.0.1", 58 | "proxyquire": "^2.1.3", 59 | "sinon": "^11.1.0", 60 | "tmp-promise": "^3.0.2" 61 | }, 62 | "lint-staged": { 63 | "*.js": "eslint --fix" 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /resources/desktop.ejs: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=<%= productName %> 3 | <% if (description) { print(`Comment=${description}\n`) } 4 | %>GenericName=<%= genericName %> 5 | Exec=<%= name %> %U<% if (execArguments && execArguments.length) { %> <%= execArguments.join(' ') %><% } %> 6 | Icon=<%= name %> 7 | Type=Application 8 | StartupNotify=true 9 | Categories=<%= categories.join(';') %>; 10 | <% if (mimeType.length) { %>MimeType=<%= mimeType.join(';') %>;<% } %> 11 | -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/resources/icon.png -------------------------------------------------------------------------------- /resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/resources/logo.png -------------------------------------------------------------------------------- /resources/spec.ejs: -------------------------------------------------------------------------------- 1 | %define _binary_payload w<%= compressionLevel %>.xzdio 2 | 3 | %if "%{_host_cpu}" != "%{_target_cpu}" 4 | %global __strip /bin/true 5 | %endif 6 | 7 | Name: <%= name %> 8 | Version: <%= version %> 9 | Release: <%= revision %>%{?dist} 10 | <% if (description) { print(`Summary: ${description}\n`) } 11 | %> 12 | <% if (license) { print(`License: ${license}\n`) } 13 | if (homepage) { print(`URL: ${homepage}\n`) } 14 | if (license || homepage) { print('\n') } 15 | 16 | %>Requires: <%= requires.join(', ') %> 17 | AutoReqProv: no 18 | 19 | <% if (productDescription) { 20 | %>%description 21 | <% print(productDescription) 22 | print('\n\n\n') } 23 | 24 | 25 | %>%install 26 | mkdir -p %{buildroot}/usr/ 27 | cp <%= process.platform === 'darwin' ? '-R' : '-r' %> usr/* %{buildroot}/usr/ 28 | 29 | 30 | %files 31 | /usr/bin/<%= name %> 32 | /usr/lib/<%= name %>/ 33 | /usr/share/applications/<%= name %>.desktop 34 | /usr/share/doc/<%= name %>/ 35 | <% if (_.isObject(icon)) { 36 | _.forEach(icon, function (path, resolution) { 37 | %>/usr/share/icons/hicolor/<%= resolution %>/apps/<%= name %><%= resolution === 'symbolic' ? '-symbolic' : '' %>.<%= ['scalable', 'symbolic'].includes(resolution) ? 'svg' : 'png' %> 38 | <% }) } else { 39 | %>/usr/share/pixmaps/<%= name %>.png 40 | <% } %> 41 | 42 | <% if (pre) { 43 | %>%pre 44 | <% print(pre) 45 | if (preun || post || postun) print('\n\n\n') } 46 | 47 | 48 | %><% if (preun) { 49 | %>%preun 50 | <% print(preun) 51 | if (post || postun) print('\n\n\n') } 52 | 53 | 54 | %><% if (post) { 55 | %>%post 56 | <% print(post) 57 | if (postun) print('\n\n\n') } 58 | 59 | 60 | %><% if (postun) { 61 | %>%postun 62 | <% print(postun) } %> 63 | -------------------------------------------------------------------------------- /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 Red Hat 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.requires', { array: true, hidden: true }) 29 | .options('options.execArguments', { array: true, hidden: true }) 30 | .options('options.categories', { array: true, hidden: true }) 31 | .options('options.mimeType', { array: true, hidden: true }) 32 | .example('$0 --src dist/app/ --dest dist/installer/ --arch i386', 'use metadata from `dist/app/`') 33 | .example('$0 --src dist/app/ --dest dist/installer/ --config config.json', 'use metadata from `config.json`') 34 | .wrap(null) 35 | .argv 36 | 37 | console.log('Creating package (this may take a while)') 38 | 39 | const options = _.omit(argv, ['$0', '_', 'version']) 40 | installer(options) 41 | .then(() => console.log(`Successfully created package at ${argv.dest}`)) 42 | .catch(err => { 43 | console.error(err, err.stack) 44 | process.exit(1) 45 | }) 46 | -------------------------------------------------------------------------------- /src/dependencies.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const common = require('electron-installer-common') 4 | const _ = require('lodash') 5 | const spawn = require('./spawn') 6 | 7 | const dependencyMap = { 8 | atspi: 'at-spi2-core', 9 | drm: '(libdrm or libdrm2)', 10 | gbm: '(mesa-libgbm or libgbm1)', 11 | gconf: 'GConf2', 12 | glib2: 'glib2', 13 | gtk2: 'gtk2', 14 | gtk3: 'gtk3', 15 | gvfs: 'gvfs-client', 16 | kdeCliTools: ['kde-cli-tools', 'kde-cli-tools5'], 17 | kdeRuntime: 'kde-runtime', 18 | notify: '(libnotify or libnotify4)', 19 | nss: '(nss or mozilla-nss)', 20 | trashCli: 'trash-cli', 21 | uuid: '(libuuid or libuuid1)', 22 | xcbDri3: '(libxcb or libxcb1)', 23 | xdgUtils: 'xdg-utils', 24 | xss: 'libXScrnSaver', 25 | xtst: '(libXtst or libXtst6)' 26 | } 27 | 28 | /** 29 | * Retrieves the RPM version number and determines whether it has support for boolean 30 | * dependencies (>= 4.13.0). 31 | */ 32 | async function rpmSupportsBooleanDependencies (logger) { 33 | return rpmVersionSupportsBooleanDependencies(await getRpmVersion(logger)) 34 | } 35 | 36 | async function getRpmVersion (logger) { 37 | const versionOutput = await spawn('rpmbuild', ['--version'], logger) 38 | return _.last(versionOutput.trim().split(' ')) 39 | } 40 | 41 | /** 42 | * Determine whether the RPM version string has support for boolean dependencies (>= 4.13.0). 43 | * 44 | * RPM does not follow semantic versioning, so `semver` cannot be used. 45 | */ 46 | function rpmVersionSupportsBooleanDependencies (rpmVersionString) { 47 | const rpmVersion = rpmVersionString.split('.').slice(0, 3).map(n => parseInt(n)) 48 | return rpmVersion >= [4, 13, 0] 49 | } 50 | 51 | /** 52 | * Transforms the list of trash requires into an RPM boolean dependency list. 53 | */ 54 | function trashRequiresAsBoolean (electronVersion, dependencyMap) { 55 | const trashDepends = common.getTrashDepends(electronVersion, dependencyMap) 56 | if (trashDepends.length === 1) { 57 | return [trashDepends[0]] 58 | } else { 59 | return [`(${trashDepends.join(' or ')})`] 60 | } 61 | } 62 | 63 | module.exports = { 64 | dependencyMap, 65 | /** 66 | * The dependencies for Electron itself, given an Electron version. 67 | */ 68 | forElectron: async function dependenciesForElectron (electronVersion, logger) { 69 | const requires = common.getDepends(electronVersion, dependencyMap) 70 | if (await module.exports.rpmSupportsBooleanDependencies(logger)) { 71 | const trashRequires = trashRequiresAsBoolean(electronVersion, dependencyMap) 72 | return { requires: requires.concat(trashRequires) } 73 | } else { 74 | throw new Error('Please upgrade to RPM 4.13 or above, which supports boolean dependencies.\nThis is used to express Electron dependencies for a wide variety of RPM-using distributions.') 75 | } 76 | }, 77 | getRpmVersion, 78 | rpmSupportsBooleanDependencies, 79 | rpmVersionSupportsBooleanDependencies, 80 | trashRequiresAsBoolean 81 | } 82 | -------------------------------------------------------------------------------- /src/installer.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const _ = require('lodash') 4 | const common = require('electron-installer-common') 5 | const debug = require('debug') 6 | const fs = require('fs-extra') 7 | const path = require('path') 8 | const wrap = require('word-wrap') 9 | 10 | const redhatDependencies = require('./dependencies') 11 | const spawn = require('./spawn') 12 | const util = require('./util') 13 | 14 | const defaultLogger = debug('electron-installer-redhat') 15 | 16 | const defaultRename = function (dest, src) { 17 | return path.join(dest, '<%= name %>-<%= version %>-<%= revision %>.<%= arch %>.rpm') 18 | } 19 | 20 | class RedhatInstaller extends common.ElectronInstaller { 21 | get baseAppDir () { 22 | return path.join('BUILD', 'usr') 23 | } 24 | 25 | get contentFunctions () { 26 | return [ 27 | 'copyApplication', 28 | 'copyLinuxIcons', 29 | 'createBinarySymlink', 30 | 'createCopyright', 31 | 'createDesktopFile', 32 | 'createSpec' 33 | ] 34 | } 35 | 36 | get defaultDesktopTemplatePath () { 37 | return path.resolve(__dirname, '../resources/desktop.ejs') 38 | } 39 | 40 | get defaultSpecTemplatePath () { 41 | return path.resolve(__dirname, '../resources/spec.ejs') 42 | } 43 | 44 | get packagePattern () { 45 | return path.join(this.stagingDir, 'RPMS', this.options.arch, '*.rpm') 46 | } 47 | 48 | get specPath () { 49 | return path.join(this.stagingDir, 'SPECS', `${this.options.name}.spec`) 50 | } 51 | 52 | /** 53 | * Copy the application into the package. 54 | */ 55 | async copyApplication () { 56 | await super.copyApplication() 57 | return this.updateSandboxHelperPermissions() 58 | } 59 | 60 | /** 61 | * Package everything using `rpmbuild`. 62 | */ 63 | async createPackage () { 64 | this.options.logger(`Creating package at ${this.stagingDir}`) 65 | 66 | const output = await spawn('rpmbuild', ['-bb', this.specPath, '--target', `${this.options.arch}-${this.options.vendor}-${this.options.platform}`, '--define', `_topdir ${this.stagingDir}`], this.options.logger) 67 | this.options.logger(`rpmbuild output: ${output}`) 68 | } 69 | 70 | /** 71 | * Creates the spec file for the package. 72 | * 73 | * See: https://fedoraproject.org/wiki/How_to_create_an_RPM_package 74 | */ 75 | async createSpec () { 76 | const src = this.options.specTemplate || this.defaultSpecTemplatePath 77 | this.options.logger(`Creating spec file at ${this.specPath}`) 78 | 79 | return common.wrapError('creating spec file', async () => this.createTemplatedFile(src, this.specPath)) 80 | } 81 | 82 | /** 83 | * Get the hash of default options for the installer. Some come from the info 84 | * read from `package.json`, and some are hardcoded. 85 | */ 86 | async generateDefaults () { 87 | const electronVersion = await common.readElectronVersion(this.userSupplied.src) 88 | const [pkg, requires] = await Promise.all([ 89 | (async () => (await common.readMetadata(this.userSupplied)) || {})(), 90 | redhatDependencies.forElectron(electronVersion, this.userSupplied.logger) 91 | ]) 92 | this.defaults = { 93 | ...common.getDefaultsFromPackageJSON(pkg, { revision: 1 }), 94 | version: pkg.version || '0.0.0', 95 | license: pkg.license, 96 | compressionLevel: 2, 97 | icon: path.resolve(__dirname, '../resources/icon.png'), 98 | pre: undefined, 99 | post: undefined, 100 | preun: undefined, 101 | postun: undefined, 102 | ...requires 103 | } 104 | 105 | return this.defaults 106 | } 107 | 108 | /** 109 | * Get the hash of options for the installer. 110 | */ 111 | generateOptions () { 112 | super.generateOptions() 113 | 114 | this.options.name = common.sanitizeName(this.options.name, '-._+a-zA-Z0-9') 115 | 116 | if (!this.options.description && !this.options.productDescription) { 117 | throw new Error("No Description or ProductDescription provided. Please set either a description in the app's package.json or provide it in the options.") 118 | } 119 | 120 | if (this.options.description) { 121 | // Do not end with a period 122 | this.options.description = this.options.description.replace(/\.*$/, '') 123 | } 124 | 125 | // Wrap the extended description to avoid rpmlint warning about 126 | // `description-line-too-long`. 127 | this.options.productDescription = wrap(this.options.productDescription, { width: 80, indent: '' }) 128 | 129 | // Merges user and default dependencies 130 | this.options.requires = common.mergeUserSpecified(this.userSupplied, 'requires', this.defaults) 131 | 132 | this.normalizeVersion() 133 | 134 | this.options.vendor = 'none' 135 | this.options.platform = this.options.platform || process.platform 136 | } 137 | 138 | /** 139 | * Read scripts from provided filename and add them to the options 140 | */ 141 | async generateScripts () { 142 | const scriptNames = ['pre', 'post', 'preun', 'postun'] 143 | 144 | return Promise.all(_.map(this.options.scripts, async (item, key) => { 145 | if (scriptNames.includes(key)) { 146 | this.options.logger(`Creating installation script ${key}`) 147 | this.options[key] = (await fs.readFile(item)).toString() 148 | } 149 | })) 150 | } 151 | 152 | normalizeVersion () { 153 | const adjustedVersion = util.replaceInvalidVersionCharacters(this.options.version) 154 | if (adjustedVersion !== this.options.version) { 155 | this.options.logger('Warning: replacing disallowed characters in version to comply with SPEC format.' + 156 | `Changing ${this.options.version} to ${adjustedVersion}`) 157 | this.options.version = adjustedVersion 158 | } 159 | } 160 | } 161 | 162 | /* ************************************************************************** */ 163 | 164 | module.exports = async data => { 165 | data.rename = data.rename || defaultRename 166 | data.logger = data.logger || defaultLogger 167 | 168 | const installer = new RedhatInstaller(data) 169 | 170 | await installer.generateDefaults() 171 | await installer.generateOptions() 172 | await installer.generateScripts() 173 | await data.logger(`Creating package with options\n${JSON.stringify(installer.options, null, 2)}`) 174 | await installer.createStagingDir() 175 | await installer.createContents() 176 | await installer.createPackage() 177 | await installer.movePackage() 178 | data.logger(`Successfully created package at ${installer.options.dest}`) 179 | return installer.options 180 | } 181 | 182 | module.exports.Installer = RedhatInstaller 183 | -------------------------------------------------------------------------------- /src/spawn.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { spawn } = require('@malept/cross-spawn-promise') 4 | const which = require('which') 5 | 6 | function updateExecutableMissingException (err, updateError) { 7 | if (updateError && err.code === 'ENOENT' && err.syscall === 'spawn rpmbuild') { 8 | let installer 9 | let pkg = 'rpm' 10 | 11 | if (process.platform === 'darwin') { 12 | installer = 'brew' 13 | } else if (which.sync('dnf', { nothrow: true })) { 14 | installer = 'dnf' 15 | pkg = 'rpm-build' 16 | } else { // assume apt-based Linux distro 17 | installer = 'apt' 18 | } 19 | 20 | err.message = `Your system is missing the ${pkg} package. Try, e.g. '${installer} install ${pkg}'` 21 | } 22 | } 23 | 24 | module.exports = function (cmd, args, logger) { 25 | return spawn(cmd, args, { 26 | logger, 27 | updateErrorCallback: updateExecutableMissingException 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /src/util.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /** 4 | * Returns a string containing only characters that are allowed in the version field of RPM spec files 5 | */ 6 | function replaceInvalidVersionCharacters (version) { 7 | version = version || '' 8 | return version.replace(/[-]/g, '.') 9 | } 10 | 11 | module.exports = { 12 | replaceInvalidVersionCharacters: replaceInvalidVersionCharacters 13 | } 14 | -------------------------------------------------------------------------------- /test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/cli.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const fs = require('fs-extra') 4 | const path = require('path') 5 | 6 | const access = require('./helpers/access') 7 | const describeInstaller = require('./helpers/describe_installer') 8 | const spawn = require('../src/spawn') 9 | 10 | const tempOutputDir = describeInstaller.tempOutputDir 11 | const cleanupOutputDir = describeInstaller.cleanupOutputDir 12 | 13 | function runCLI (options) { 14 | const args = [ 15 | '--src', options.src, 16 | '--dest', options.dest, 17 | '--arch', options.arch 18 | ] 19 | if (options.config) args.push('--config', options.config) 20 | 21 | before(() => spawn('./src/cli.js', args)) 22 | } 23 | 24 | describe('cli', function () { 25 | this.timeout(10000) 26 | 27 | describe('with an app with asar', test => { 28 | const outputDir = tempOutputDir() 29 | 30 | runCLI({ src: 'test/fixtures/app-with-asar/', dest: outputDir, arch: 'x86' }) 31 | 32 | it('generates a `.rpm` package', () => access(path.join(outputDir, 'footest-0.0.1-1.x86.rpm'))) 33 | 34 | cleanupOutputDir(outputDir) 35 | }) 36 | 37 | describe('with an app without asar', test => { 38 | const outputDir = tempOutputDir() 39 | 40 | runCLI({ src: 'test/fixtures/app-without-asar/', dest: outputDir, arch: 'x86_64' }) 41 | 42 | it('generates a `.rpm` package', () => access(path.join(outputDir, 'bartest-0.0.1-1.x86_64.rpm'))) 43 | 44 | after(() => fs.remove(outputDir)) 45 | }) 46 | }) 47 | -------------------------------------------------------------------------------- /test/dependencies.js: -------------------------------------------------------------------------------- 1 | const chaiAsPromised = require('chai-as-promised') 2 | const dependencies = require('../src/dependencies') 3 | const { expect, use } = require('chai') 4 | const proxyquire = require('proxyquire').noPreserveCache() 5 | const sinon = require('sinon') 6 | 7 | use(chaiAsPromised) 8 | 9 | describe('dependencies', () => { 10 | describe('forElectron', () => { 11 | afterEach(() => { 12 | sinon.restore() 13 | }) 14 | 15 | it('uses an RPM that does not support boolean dependencies', async () => { 16 | sinon.stub(dependencies, 'rpmSupportsBooleanDependencies').resolves(false) 17 | await expect(dependencies.forElectron('v1.0.0')).to.eventually.be.rejectedWith(/^Please upgrade to RPM 4\.13/) 18 | }) 19 | 20 | it('uses an RPM that supports boolean dependencies', async () => { 21 | sinon.stub(dependencies, 'rpmSupportsBooleanDependencies').resolves(true) 22 | await expect(dependencies.forElectron('v1.0.0')).to.be.fulfilled // eslint-disable-line no-unused-expressions 23 | }) 24 | }) 25 | 26 | describe('getRpmVersion', () => { 27 | function stubGetRpmVersion (versionOutput) { 28 | const { getRpmVersion } = proxyquire('../src/dependencies', { 29 | './spawn': async () => Promise.resolve(versionOutput) 30 | }) 31 | 32 | return getRpmVersion 33 | } 34 | 35 | it('parses version output from RPM < 4.15', async () => { 36 | const getRpmVersion = stubGetRpmVersion('RPM version 4.14.2.1\n') 37 | await expect(getRpmVersion(null)).to.eventually.equal('4.14.2.1') 38 | }) 39 | 40 | it('parses version output from RPM >= 4.15', async () => { 41 | const getRpmVersion = stubGetRpmVersion('RPM-Version 4.15.1\n') 42 | await expect(getRpmVersion(null)).to.eventually.equal('4.15.1') 43 | }) 44 | }) 45 | 46 | describe('rpmVersionSupportsBooleanDependencies', () => { 47 | it('works with release candidates', () => { 48 | expect(dependencies.rpmVersionSupportsBooleanDependencies('4.13.0-rc1')).to.equal(true) 49 | }) 50 | 51 | it('works with git snapshots', () => { 52 | expect(dependencies.rpmVersionSupportsBooleanDependencies('4.11.90-git12844')).to.equal(false) 53 | }) 54 | 55 | it('works with 4 part versions (1.2.3.4)', () => { 56 | expect(dependencies.rpmVersionSupportsBooleanDependencies('4.1.12.2')).to.equal(false) 57 | }) 58 | }) 59 | 60 | describe('trashRequiresAsBoolean', () => { 61 | it('does not use parentheses for one item', () => { 62 | const trashDeps = dependencies.trashRequiresAsBoolean('1.0.0', dependencies.dependencyMap)[0] 63 | expect(trashDeps[0]).to.not.match(/^\(/) 64 | }) 65 | 66 | it('ORs more than one item', () => { 67 | const trashDeps = dependencies.trashRequiresAsBoolean('1.5.0', dependencies.dependencyMap)[0] 68 | expect(trashDeps).to.match(/^\(.* or .*\)$/) 69 | }) 70 | }) 71 | }) 72 | -------------------------------------------------------------------------------- /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/content_shell.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/icudtl.dat -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/libffmpegsumo.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/libffmpegsumo.so -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/libgcrypt.so.11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/libgcrypt.so.11 -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/libnode.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/libnode.so -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/libnotify.so.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/libnotify.so.4 -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/am.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/am.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ar.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ar.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/bg.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/bg.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/bn.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/bn.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ca.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ca.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/cs.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/cs.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/da.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/da.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/de.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/de.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/el.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/es.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/et.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/et.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/fa.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/fa.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/fi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/fi.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/fil.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/fil.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/fr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/fr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/gu.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/gu.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/he.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/he.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/hi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/hi.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/hr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/hr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/hu.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/hu.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/id.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/id.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/it.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/it.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ja.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ja.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/kn.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/kn.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ko.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ko.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/lt.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/lt.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/lv.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/lv.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ml.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ml.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/mr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/mr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ms.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ms.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/nb.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/nb.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/nl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/nl.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/pl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ro.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ru.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ru.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sk.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/sk.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/sl.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/sr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sv.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/sv.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/sw.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/sw.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/ta.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/ta.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/te.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/te.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/th.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/th.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/tr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/tr.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/uk.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/locales/uk.pak -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/locales/vi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-with-asar/resources/atom.asar -------------------------------------------------------------------------------- /test/fixtures/app-with-asar/snapshot_blob.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/content_shell.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/icudtl.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/icudtl.dat -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/libffmpegsumo.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/libffmpegsumo.so -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/libgcrypt.so.11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/libgcrypt.so.11 -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/libnode.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/libnode.so -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/libnotify.so.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/libnotify.so.4 -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/am.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/am.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ar.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ar.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/bg.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/bg.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/bn.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/bn.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ca.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ca.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/cs.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/cs.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/da.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/da.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/de.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/de.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/el.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/es.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/et.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/et.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/fa.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/fa.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/fi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/fi.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/fil.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/fil.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/fr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/fr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/gu.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/gu.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/he.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/he.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/hi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/hi.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/hr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/hr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/hu.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/hu.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/id.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/id.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/it.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/it.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ja.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ja.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/kn.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/kn.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ko.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ko.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/lt.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/lt.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/lv.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/lv.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ml.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ml.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/mr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/mr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ms.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ms.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/nb.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/nb.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/nl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/nl.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/pl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ro.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ru.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ru.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sk.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/sk.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sl.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/sl.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/sr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sv.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/sv.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/sw.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/sw.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/ta.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/ta.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/te.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/te.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/th.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/th.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/tr.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/tr.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/uk.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/locales/uk.pak -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/locales/vi.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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.unindented.Bar", 12 | "projectName": "Bar", 13 | "productName": "Bar", 14 | "productUrl": "https://unindented.org/", 15 | "companyName": "Daniel Perez Alvarez", 16 | "companyUrl": "https://unindented.org/", 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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/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-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/app-without-asar/snapshot_blob.bin -------------------------------------------------------------------------------- /test/fixtures/app-without-asar/version: -------------------------------------------------------------------------------- 1 | v1.8.5 -------------------------------------------------------------------------------- /test/fixtures/custom.desktop.ejs: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | <% if (productName) { %>Name=<%= productName %> 3 | <% } %>Type=Application 4 | Comment=Hardcoded comment 5 | -------------------------------------------------------------------------------- /test/fixtures/custom.spec.ejs: -------------------------------------------------------------------------------- 1 | %define _binary_payload w<%= compressionLevel %>.xzdio 2 | 3 | Name: <%= name %> 4 | Version: <%= version %> 5 | Release: <%= revision %>%{?dist} 6 | <% if (description) { print(`Summary: ${description}\n`) } 7 | %> 8 | <% if (license) { print(`License: ${license}\n`) } 9 | if (homepage) { print(`URL: ${homepage}\n`) } 10 | if (license || homepage) { print('\n') } 11 | 12 | %>Requires: <%= requires.join(', ') %> 13 | AutoReqProv: no 14 | 15 | <% if (productDescription) { 16 | %>%description 17 | <% print(productDescription) 18 | print('\n\n\n') } 19 | 20 | 21 | %>%install 22 | mkdir -p %{buildroot}/usr/ 23 | cp <%= process.platform === 'darwin' ? '-R' : '-r' %> usr/* %{buildroot}/usr/ 24 | 25 | 26 | %files 27 | /usr/bin/<%= name %> 28 | /usr/lib/<%= name %>/ 29 | /usr/share/applications/<%= name %>.desktop 30 | /usr/share/doc/<%= name %>/ 31 | <% if (_.isObject(icon)) { 32 | _.forEach(icon, function (path, resolution) { 33 | %>/usr/share/icons/hicolor/<%= resolution %>/apps/<%= name %><%= resolution === 'symbolic' ? '-symbolic' : '' %>.<%= ['scalable', 'symbolic'].includes(resolution) ? 'svg' : 'png' %> 34 | <% }) } else { 35 | %>/usr/share/pixmaps/<%= name %>.png 36 | <% } %> 37 | 38 | %changelog 39 | * Wed Feb 02 2022 John Doe - 0.1 40 | - First release 41 | -------------------------------------------------------------------------------- /test/fixtures/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/icon.png -------------------------------------------------------------------------------- /test/fixtures/scaled-icon.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electron-userland/electron-installer-redhat/ab6694f1aa9f19f44dd07a4aae11918b7cfbc59c/test/fixtures/scaled-icon.svg -------------------------------------------------------------------------------- /test/fixtures/script: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Script representing either of the pre, post, preun or postun scripts 3 | -------------------------------------------------------------------------------- /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 = 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 fs = require('fs-extra') 5 | const os = require('os') 6 | const path = require('path') 7 | const tmp = require('tmp-promise') 8 | 9 | const installer = require('../..') 10 | 11 | module.exports = { 12 | describeInstaller: 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(async () => installer(options)) 18 | 19 | it(itDescription, () => itFunc(outputDir)) 20 | 21 | module.exports.cleanupOutputDir(outputDir) 22 | }) 23 | }, 24 | 25 | cleanupOutputDir: function cleanupOutputDir (outputDir) { 26 | after(async () => fs.remove(outputDir)) 27 | }, 28 | 29 | tempOutputDir: function tempOutputDir (customDir) { 30 | return customDir ? path.join(os.tmpdir(), customDir) : tmp.tmpNameSync({ prefix: 'electron-installer-redhat-' }) 31 | }, 32 | 33 | testInstallerOptions: function testInstallerOptions (outputDir, installerOptions) { 34 | return _.merge({ 35 | rename: rpmFile => { 36 | return path.join(rpmFile, '<%= name %>.<%= arch %>.rpm') 37 | }, 38 | options: { 39 | arch: 'x86_64' 40 | } 41 | }, installerOptions, { dest: outputDir }) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /test/installer.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const access = require('./helpers/access') 4 | const { describeInstaller, tempOutputDir, testInstallerOptions } = require('./helpers/describe_installer') 5 | const fs = require('fs-extra') 6 | const installer = require('..') 7 | const path = require('path') 8 | const { spawn } = require('@malept/cross-spawn-promise') 9 | 10 | const assertASARRpmExists = outputDir => 11 | access(path.join(outputDir, 'footest.x86.rpm')) 12 | 13 | const assertNonASARRpmExists = outputDir => 14 | access(path.join(outputDir, 'bartest.x86_64.rpm')) 15 | 16 | const updateJSON = async (filename, updateFunc) => { 17 | const packageJSON = await fs.readJson(filename) 18 | updateFunc(packageJSON) 19 | await fs.writeJson(filename, packageJSON) 20 | } 21 | 22 | describe('module', function () { 23 | this.timeout(10000) 24 | 25 | describeInstaller( 26 | 'with an app with asar', 27 | { 28 | src: 'test/fixtures/app-with-asar/', 29 | options: { 30 | productDescription: 'Just a test.', 31 | arch: 'x86' 32 | } 33 | }, 34 | 'generates a `.rpm` package', 35 | assertASARRpmExists 36 | ) 37 | 38 | describeInstaller( 39 | 'with an app without asar', 40 | { 41 | src: 'test/fixtures/app-without-asar/', 42 | icon: { 43 | '1024x1024': 'test/fixtures/icon.png' 44 | }, 45 | bin: 'resources/cli/bar.sh', 46 | productDescription: 'Just a test.', 47 | categories: [ 48 | 'Utility' 49 | ], 50 | mimeType: [ 51 | 'text/plain' 52 | ] 53 | }, 54 | 'generates a `.rpm` package', 55 | assertNonASARRpmExists 56 | ) 57 | 58 | describe('with an app without a homepage or author URL', test => { 59 | const baseDir = tempOutputDir('app-without-homepage') 60 | let outputDir 61 | 62 | after(async () => fs.remove(baseDir)) 63 | after(async () => fs.remove(outputDir)) 64 | 65 | before(async () => { 66 | await fs.emptyDir(baseDir) 67 | await fs.copy('test/fixtures/app-without-asar', baseDir) 68 | await updateJSON(path.join(baseDir, 'resources', 'app', 'package.json'), packageJSON => { 69 | packageJSON.author = 'Test Author' 70 | }) 71 | outputDir = tempOutputDir() 72 | await installer(testInstallerOptions(outputDir, { src: baseDir })) 73 | }) 74 | 75 | it('generates a `.rpm` package', () => assertNonASARRpmExists(outputDir)) 76 | }) 77 | 78 | describe('with an app having hyphens in its version string', test => { 79 | const baseDir = tempOutputDir('app-with-hyphen') 80 | let outputDir 81 | 82 | after(async () => fs.remove(baseDir)) 83 | after(async () => fs.remove(outputDir)) 84 | 85 | before(async () => { 86 | await fs.emptyDir(baseDir) 87 | await fs.copy('test/fixtures/app-without-asar', baseDir) 88 | await updateJSON(path.join(baseDir, 'resources', 'app', 'package.json'), packageJSON => { 89 | packageJSON.version = '1.0.0-beta+internal-only.0' 90 | }) 91 | outputDir = tempOutputDir() 92 | await installer(testInstallerOptions(outputDir, { src: baseDir })) 93 | }) 94 | 95 | it('generates a `.rpm` package', () => assertNonASARRpmExists(outputDir)) 96 | }) 97 | 98 | describeInstaller( 99 | 'with an app that needs its name sanitized', 100 | { 101 | src: 'test/fixtures/app-with-asar/', 102 | options: { name: 'Foo/Bar/Baz' } 103 | }, 104 | 'generates a .rpm package', 105 | outputDir => access(path.join(outputDir, 'Foo-Bar-Baz.x86_64.rpm')) 106 | ) 107 | 108 | describeInstaller( 109 | 'with an app with an SVG icon', 110 | { 111 | src: 'test/fixtures/app-with-asar/', 112 | options: { 113 | arch: 'x86', 114 | icon: { 115 | scalable: 'test/fixtures/scaled-icon.svg', 116 | symbolic: 'test/fixtures/scaled-icon.svg' 117 | } 118 | } 119 | }, 120 | 'generates a .rpm package', 121 | assertASARRpmExists 122 | ) 123 | 124 | describeInstaller( 125 | 'with an app with installation scripts as paths', 126 | { 127 | src: 'test/fixtures/app-without-asar/', 128 | options: { 129 | scripts: { 130 | pre: 'test/fixtures/script', 131 | preun: 'test/fixtures/script', 132 | post: 'test/fixtures/script', 133 | postun: 'test/fixtures/script' 134 | } 135 | } 136 | }, 137 | 'generates a `.rpm` package with scripts', 138 | async outputDir => { 139 | await assertNonASARRpmExists(outputDir) 140 | const stdout = await spawn('rpm', ['-qp', '--scripts', 'bartest.x86_64.rpm'], { cwd: outputDir }) 141 | const scripts = ['preinstall', 'postinstall', 'preuninstall', 'postuninstall'] 142 | if (!scripts.every(element => stdout.includes(element))) { 143 | throw new Error(`Some installation scripts are missing:\n ${stdout}`) 144 | } 145 | } 146 | ) 147 | 148 | describeInstaller( 149 | 'with an app with default %_target_os', 150 | { 151 | src: 'test/fixtures/app-with-asar/', 152 | options: { 153 | arch: 'x86' 154 | } 155 | }, 156 | 'generates a `.rpm` package with default %_target_os', 157 | async outputDir => { 158 | await assertASARRpmExists(outputDir) 159 | const stdout = await spawn('rpm', ['-qp', '--qf', '%{OS}', 'footest.x86.rpm'], { cwd: outputDir }) 160 | if (stdout !== process.platform) { 161 | throw new Error(`RPM built with wrong platform: ${stdout}`) 162 | } 163 | } 164 | ) 165 | 166 | describeInstaller( 167 | 'with an app with a custom SPEC file', 168 | { 169 | src: 'test/fixtures/app-with-asar/', 170 | options: { 171 | arch: 'x86', 172 | specTemplate: 'test/fixtures/custom.spec.ejs' 173 | } 174 | }, 175 | 'generates a `.rpm` package with custom spec', 176 | async outputDir => { 177 | await assertASARRpmExists(outputDir) 178 | const stdout = await spawn('rpm', ['-qp', '--changelog', 'footest.x86.rpm'], { cwd: outputDir }) 179 | if (!stdout.includes('* Wed Feb 02 2022 John Doe - 0.1\n- First release')) { 180 | throw new Error(`RPM missing changelog:\n ${stdout}`) 181 | } 182 | } 183 | ) 184 | 185 | if (process.platform === 'darwin') { 186 | describeInstaller( 187 | 'with an app with %_target_os linux', 188 | { 189 | src: 'test/fixtures/app-with-asar/', 190 | options: { 191 | arch: 'x86', 192 | platform: 'linux' 193 | } 194 | }, 195 | 'generates a `.rpm` package with linux %_target_os', 196 | async outputDir => { 197 | await assertASARRpmExists(outputDir) 198 | const stdout = await spawn('rpm', ['-qp', '--qf', '%{OS}', 'footest.x86.rpm'], { cwd: outputDir }) 199 | if (stdout !== 'linux') { 200 | throw new Error(`RPM was not built for linux: ${stdout}`) 201 | } 202 | } 203 | ) 204 | } 205 | }) 206 | -------------------------------------------------------------------------------- /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 rpmbuild', async () => { 15 | try { 16 | await spawn('rpmbuild', ['--version'], msg => { }) 17 | throw new Error('rpmbuild should not have been executed') 18 | } catch (error) { 19 | chai.expect(error.message).to.match(/Error executing command \(rpmbuild --version\):\nYour system is missing the rpm/) 20 | } 21 | }) 22 | 23 | after(() => { 24 | process.env.PATH = oldPath 25 | }) 26 | }) 27 | -------------------------------------------------------------------------------- /test/util.js: -------------------------------------------------------------------------------- 1 | const { expect } = require('chai') 2 | const { replaceInvalidVersionCharacters } = require('../src/util') 3 | 4 | describe('private utility functions', function () { 5 | describe('replaceInvalidVersionCharacters', function (test) { 6 | [{ 7 | input: '1.2.3', 8 | expectedOutput: '1.2.3' 9 | }, { 10 | input: '1.0.0-beta', 11 | expectedOutput: '1.0.0.beta' 12 | }, { 13 | input: '1.0.0-multiple-hyphens', 14 | expectedOutput: '1.0.0.multiple.hyphens' 15 | }, { 16 | input: '1.0.0-beta+exp.sha.5114f85', 17 | expectedOutput: '1.0.0.beta+exp.sha.5114f85' 18 | }, { 19 | input: undefined, 20 | expectedOutput: '' 21 | }].forEach(scenario => { 22 | it(`${JSON.stringify(scenario.input)} -> ${JSON.stringify(scenario.expectedOutput)}`, () => { 23 | expect(replaceInvalidVersionCharacters(scenario.input)).to.equal(scenario.expectedOutput) 24 | }) 25 | }) 26 | }) 27 | }) 28 | --------------------------------------------------------------------------------