Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing disk image size option to user #197

Open
kakyoism opened this issue Jan 20, 2021 · 0 comments
Open

Exposing disk image size option to user #197

kakyoism opened this issue Jan 20, 2021 · 0 comments

Comments

@kakyoism
Copy link

kakyoism commented Jan 20, 2021

I'm forwarding a problem I had when I build DMG with electron-forge, which is said to be an appdmg limitation.

TL;DR: Can node-appdmg expose an option similar to --disk-img-size of create-dmg ??

Please see below.

Issue Details

  • Electron Forge Version:
    • 6.0.0-beta.53
  • Electron Version:
  • Operating System:
    • macOS 10.15.7
  • Last Known Working Electron Forge version::
    • N/A

Expected Behavior

I'd love to insert custom data into the app folder and have them included into the DMG and show up in the mounted folder.

Actual Behavior

Trying to insert additional data into the output app folder and include it into the DMG, but after firing up a maker process, I saw a size calculation error that breaks the build

Making for the following targets: dmg
✖ Making for target: dmg - On platform: darwin - For arch: x64

An unhandled error has occurred inside Forge:
An error occured while making for target: dmg
Command failed: hdiutil create /var/folders/5j/ybqw096s7c162l_lgby0plw00000gn/T/N8YZNXR.dmg -ov -fs HFS+ -size 7313m -volname MAM-Hub
hdiutil: create failed - No space left on device

the size argument is incorrect and after digging into the source code of electron-forge, I found that this size is calculated internally and the hdiutil -size argument is not exposed.

To Reproduce

  • Create an Electron app and build it with electron-forge;
  • Add a folder of data, in my case, another dependency PKG installer and its own supporting data, into the output folder;
  • Build the app with yarn or npm;

You should see the similar error above.

Additional Information

Here is my package.json

{
  "name": "myapp",
  "productName": "myapp",
  "version": "0.10.1",
  "description": "my app",
  "main": "src/main.js",
  "scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "publish": "electron-forge publish",
    "lint": "echo \"No linting configured\""
  },
  "keywords": [],
  "author": {
    "name": "me",
    "email": "me@me.com"
  },
  "license": "MIT",
  "config": {
    "forge": {
      "packagerConfig": {
        "icon": "src/images/myicon",
        "ignore": [
          "/.gitignore",
          "/.vscode",
          "/yarn.lock",
          "/node_modules/xyz/10.1.2/",
          "/node_modules/xyz/build/",
          "/node_modules/xyz/prebuilds/linux*"
        ]
      },
      "osxSign": {
        "entitlements": "entitlements.plist",
        "entitlements-inherit": "entitlements.plist",
        "gatekeeper-assess": false,
        "hardened-runtime": true,
        "identity": "my id",
        "signature-flags": "library"
      },
      "osxNotarize": "require:./notarize.js",
      "hooks": "require:./hooks.js",
      "makers": [
                {
          "name": "@electron-forge/maker-dmg",
          "platforms": [
            "darwin"
          ],
          "config": {
            "AdditionalDMGOptions": {
              "code-sign": {
                "identifier": "my certificate",
                "signing-identity": "my cert id"
              },
              "contents": [
                {
                  "name": "MAM-hub",
                  "path": "src/myapp/out/myapp-darwin-x64/myapp.app",
                  "type": "file",
                  "x": 370,
                  "y": 260
                },
                {
                  "name": "Applications",
                  "path": "/Applications",
                  "type": "link",
                  "x": 670,
                  "y": 260
                },
                {
                  "name": "My Dependency",
                  "path": "src/mam-hub/out/mam-hub-darwin-x64/mydep",
                  "type": "file",
                  "x": 240,
                  "y": 260
                },
                {
                  "name": "INSTALL.html",
                  "path": "../../temp/INSTALL_en.html",
                  "x": 240,
                  "y": 400
                },
                {
                  "name": "安装指南.html",
                  "path": "../../temp/INSTALL_zhs.html",
                  "x": 370,
                  "y": 400
                }
              ],
              "window": {
                "position": {
                  "x": 200,
                  "y": 120
                },
                "size": {
                  "height": 660,
                  "width": 1020
                }
              }
            },
            "background": "../../res/installer/macos/background-orange.png",
            "format": "UDZO",
            "icon": "src/images/myapp.icns",
            "iconSize": 90,
            "name": "myapp",
            "overwrite": true
          }
        },
        {
          "name": "@electron-forge/maker-wix",
          "platforms": [
            "win32"
          ],
          "config": {
            "arch": "x64",
            "appUserModelId": "com.me.myapp",
            "description": "description of myapp",
            "exe": "myapp",
            "iconPath": "src\\images\\me.ico",
            "language": 1033,
            "manufacturer": "me",
            "name": "my app",
            "programFilesFolderName": "myapp",
            "shortName": "myapp",
            "shortcutFolderName": "myapp",
            "ui": {
              "chooseDirectory": true,
              "images": {
                "background": "C:\\Temp\\background-orange.png",
                "banner": "C:\\Temp\\banner-orange.png"
              }
            },
            "version": "1.0.0"
          }
        }
      ]
    }
  },
  "dependencies": {
    "buffer-from": "^1.1.1",
    "zeromq": "^6.0.0-beta.6"
  },
  "devDependencies": {
    "@electron-forge/cli": "6.0.0-beta.53",
    "@electron-forge/maker-dmg": "6.0.0-beta.53",
    "@electron-forge/maker-wix": "6.0.0-beta.53",
    "electron": "10.1.2"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant