LinusU / node-appdmg

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

Error: hdiutil: couldn't unmount - Resource busy #161

Closed flowt-au closed 5 years ago

flowt-au commented 6 years ago

Hi. I am using your great dmg maker for the first time and I am experiencing the following error.

I can make the dmg to a given folder successfully eg to dmg/myapp.dmg

I can open it and use it - all good. Now I close it and "eject it". Then move it to trash. Then make it again to the same path. Each time I do this I get the following error:

Error: Command failed: hdiutil detach /Volumes/Flowt 6
hdiutil: couldn't unmount "disk10" - Resource busy

where "disk10" is incrementing each time.

I am fairly new to OSX so I guess I am doing something wrong somewhere?

I am packaging an nw.js v0.28.3 app, OSX 10.10.5, Node 9.10.1.

    "title": "Flowt",
    "icon": "nw.icns",
    "window": {
        "size":{
            "width" : 512,
            "height": 320
        }
    },
    "background": "flowtDmgBackground.png",
    "contents": [
        {
            "x": 140,
            "y": 160,
            "type": "file",
            "path": "build/flowt/osx64/flowt.app"
        },
        {
            "x": 360,
            "y": 160,
            "type": "link",
            "path": "/Applications"
        }
    ]
}

Does anyone have any idea how to properly unmount or free up the resource?

Thanks, Murray

flowt-au commented 6 years ago

I tried Node v8.11.1

Same issue. :-(

LinusU commented 6 years ago

Hmm, it seems like there is something that is still accessing the old mounted volumes.

I think that the easiest thing would probably be to reboot your computer 😂

flowt-au commented 6 years ago

Thanks Linus. Yes... I have done that a few times. If I try changing the name of the input app file and vary the path of the output file occasionally it works. But then it doesn't again. I cant discern any pattern yet.

It is of course possible I have some kind of config issue with my Mac although I am not getting any indication of other issues. Very weird. I will try to find out if there are things that can cause the OS to not properly unmount volumes. I used Disk Utility to clean up, then powered off / on, but still the issue remains. Somehow it hangs on with no power! ;-)

As a fairly new Mac user I am not sure where to start looking. Hmmm....

Thanks for a great utility, though. I can see how useful it will be for me one day. ;-)

LinusU commented 6 years ago

Hmm, it should be possible to see which process is using the file 🤔

Could you try running hdiutil info, find the old mounted volumes, and then run hdiutil detach /dev/diskXsY?

LinusU commented 6 years ago

I'm going to try and get to it and fix and merge the refactor branch, I believe it has a backoff-strategy using p-retry...

flowt-au commented 6 years ago

That would be fantastic if you could, Linus. Much appreciation. Go well, Murray

LinusU commented 5 years ago

Closing this in favor of #142