C-Command Software Forum

symlink/alias to Documents folder

Hi, I am trying to create a DMG installer that, in addition to the standard “drag .app to Applications” pair of icons, also has a second “drag sample files directory to Documents” set of icons.

My problem is that I cannot figure out how to create the link/alias to ~/Documents. Everything I have tried results in a hardcoded path in the DMG, so that when I open it on another account/machine the path is /Users/user_who_created_dmg/Documents, instead of ~/Documents

Is there a way to do this in the layout-creator UI?

If you can create the proper symlink, you can put it in your source folder and DropDMG will position it correctly in the layout. However, I’m not aware of any way to create a username agnostic symlink. Unix will expand the “~” before creating the filesystem entry.

what about an alias? I have a dmg-creation script (a “poor-man’s” DropDMG) that will properly create a DMG from a folder containing an alias to a ~/relative path. I tried this with DropDMG and it did not work, though. Is that unsupported, or was I doing it wrong? (I created a folder called ‘Documents’ in the DropDMG layout editor and then created an alias with the same name in the folder I passed to DropDMG).

I don’t think is’s possible to make an alias to ~/Documents. How did you do that?

If the alias works, that should work. DropDMG doesn’t modify the files in the source folder; it will just copy the alias as-is.