Way to disable dragging (drag-n-drop) in a read-write dmg file

automatordmgfinderinstallterminal

I´m creating a dmg image that should be able to use drag-n-drop of a folder onto an application.

The user installs my app by dragging a folder onto an application (.app) that is made by Automator and installs the folder by copying it to the correct location. It does not install into the Applications folder, it´s in the User´s own directories. So not something one can use an Alias or symlink for.

The only problem is that the DMG converted to read-only (compressed, in Disk Utility) does not allow one to drop anything into anything, not even onto my little install app. (! :/)

One solution is to use a read-write DMG file. Not a good alternative. The user will mess up the order or positioning of the folders and files before installing and come back to a messed up installer app later on, for next time around. Also, it does not auto-open on double-clicking on the .dmg. That´s why you make them read-only.

So, can I disable dragging and essentially "lock" the file´s location in the read-write enabled DMG file format?

For solutions, any way is interesting, by terminal or any app.

Best Answer

It is not possible to disable drag-n-dropping of icons in Finder for a specific read-write DMG from within the DMG.

You should consider creating your installer in a different manner. For example consider using a read-only DMG with an app inside that the user needs to double click. When double clicked it will present a window allowing the user to drag-n-drop onto that area and doing whatever you wanted doing initially.