LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.68k stars 152 forks source link

How can I move .background from user view #158

Closed vaidyaanand closed 5 years ago

vaidyaanand commented 6 years ago

I am creating dmg file having following JSON structure:

{
    "title": "my-app",
    "icon": "icon.icns",
    "background": "icons.png",
    "contents": [
      { "x": 448, "y": 344, "type": "link", "path": "/Applications" },
      { "x": 192, "y": 344, "type": "file", "path": "my-app.app" }
    ]
  }

As you have mentioned in your documentation I do have to use "type": "position" to fix it. But where I have to use I am not able to get this. Please help me in solving the error.

cstruct commented 6 years ago

I'm not sure I understand your issue, are you unsure where to use "type": "position"? If that's the case you use it like this:

{
  "title": "my-app",
  "icon": "icon.icns",
  "background": "icons.png",
  "contents": [
    { "x": 448, "y": 344, "type": "link", "path": "/Applications" },
    { "x": 192, "y": 344, "type": "file", "path": "my-app.app" },
    { "x": 512, "y": 900, "type": "position", "path": ".hidden-file-i-want-to-hide" }
  ]
}

For every item you want to hide you add an entry to the contents array where you specify that you want to position that item.