sindresorhus / create-dmg

Create a good-looking DMG for your macOS app in seconds

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG: appName seems to be undefined

bjesuiter opened this issue · comments

My Steps:

  • create-dmg DisableSynergy.app

Error:

/usr/local/lib/node_modules/create-dmg/cli.js:46
const dmgPath = `${appName.replace(/ /g, '-')}-${appInfo.CFBundleShortVersionString}.dmg`;
                                                   ^

TypeError: Cannot read property 'replace' of undefined
    at Object.<anonymous> (/usr/local/lib/node_modules/create-dmg/cli.js:46:28)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:618:3

I tried lots of combinations, paths as app name, masking directory changes with pushd and popd, but even this simplest version does not work. Where does this appName come from?
I've written my PList file myself, so it could be that I miss a plist key.

This is my plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <array>
    <dict>
      <key>CFBundleIdentifier</key>
      <string>de.bjesuiter.disable-synergy</string>
      <key>CFBundleVersion</key>
      <string>1.0.0</string>
      <key>CFBundleShortVersionString</key>
      <string>1.0.0</string>
      <key>CFBundleName</key>
      <string>Disable Synergy</string>
      <key>CFBundleDisplayName</key>
      <string>Disable Synergy</string>
      <key>CFBundlePackageType</key>
      <string>APPL</string>
      <key>CFBundleIconFile</key>
      <string>AppIcon</string>
      <key>CFBundleIconName</key>
      <string>AppIcon</string>
    </dict>
  </array>
</plist>

My plist file was generated by qmake, it missed CFBundleName so I have this problem too, which can be fix manually. May this help.

By the way, my plist file doesn't have <array> node, it comes <dict> directly.