electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.73k stars 1.74k forks source link

How to add license files to dmg #6968

Open JaberAlsalamah opened 2 years ago

JaberAlsalamah commented 2 years ago

"dependencies": {
    "@babel/node": "^7.16.8",
    "@babel/preset-env": "^7.16.11",
    "@babel/preset-react": "^7.16.7",
    "babel-jest": "26.6.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.35",
    "@fortawesome/free-brands-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.3",
    "@fortawesome/react-fontawesome": "^0.1.14",
    "@react-google-maps/api": "^2.2.0",
    "@typescript-eslint/parser": "^4.33.0",
    "antd": "^4.16.13",
    "axios": "^0.24.0",
    "bootstrap": "^5.0.1",
    "concurrently": "^7.2.2",
    "core-js": "^3.15.0",
    "cross-env": "^7.0.3",
    "dotenv": "^16.0.1",
    "electron-debug": "^3.2.0",
    "electron-localshortcut": "^3.2.1",
    "eslint-config-react-app": "^6.0.0",
    "eslint-plugin-import": "^2.25.3",
    "eslint-plugin-jest": "^24.7.0",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-react": "^7.27.1",
    "eslint-plugin-testing-library": "^3.10.2",
    "firebase": "^9.6.1",
    "flatlist-react": "^1.5.0",
    "fontisto": "^3.0.4",
    "globby": "^13.1.1",
    "html-react-parser": "^1.3.0",
    "i18next": "^19.4.5",
    "i18next-browser-languagedetector": "^4.3.1",
    "js-sha256": "^0.9.0",
    "moment": "^2.29.1",
    "react": "^17.0.2",
    "react-bootstrap": "^2.0.3",
    "react-datepicker": "^4.2.1",
    "react-dom": "^17.0.2",
    "react-error-overlay": "^6.0.9",
    "react-google-recaptcha-v3": "^1.9.7",
    "react-gtm-module": "^2.0.11",
    "react-helmet": "^6.1.0",
    "react-i18next": "^9.0.10",
    "react-ionicons": "^4.2.0",
    "react-jsx-parser": "^1.28.4",
    "react-linkify": "^1.0.0-alpha",
    "react-notifications-component": "^3.1.0",
    "react-outside-click-handler": "^1.3.0",
    "react-qr-code": "^2.0.2",
    "react-router": "^5.2.0",
    "react-scripts": "^4.0.3",
    "react-simple-captcha": "^8.2.0",
    "react-top-loading-bar": "^2.0.1",
    "react-window": "^1.8.6",
    "reactstrap": "^9.0.1",
    "regenerator-runtime": "^0.13.9",
    "sass": "^1.45.0",
    "styled-components": "^5.3.0",
    "sweetalert2": "^11.0.18",
    "tournament-organizer": "^1.8.7",
    "wait-on": "^6.0.1",
    "xml2js": "^0.4.23"
  },

"devDependencies": {
    "@iconify/react": "^3.0.1",
    "electron": "^19.0.4",
    "electron-builder": "^23.0.3",
    "electron-notarize": "^1.2.1",
    "foreman": "^3.0.1",
    "react-router-dom": "^5.2.0"
  }

Greetings,

I would like to add license files and license buttons to the dmg file I'm building.

This guide on Electron-Builder's website is not clear enough.

I tried the steps below, but when I click on the dmg file and extract the app, the license window does not show up:

1- I created a license folder on the root of the project:

Screen Shot 1443-11-30 at 9 37 56 AM

2- I included the files in the license folder in the build configuration

Screen Shot 1443-11-30 at 9 48 00 AM

3- I built the project, then clicked on the dmg file and dragged the app to the applications folder.

4- I clicked on the app.

Any idea what I am doing wrong? any help is appreciated.

fluke777 commented 2 years ago

Hey @JaberAlsalamah .

I am working on something similar. I agree the docs are nor super clear. I got it working like this.

For DMG no configuration seems to be needed. You just need to create a file called license_LANG_CODE.txt and put it into your buildResources directory (this is most likely called build). It should pop up when you double click your DMG.

What I cannot figure out is if you can specify one license for all languages.

github-actions[bot] commented 2 days ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.