What is the purpose of the path at the top of the window of a mounted .dmg file, and how can I remove it?

143 Views Asked by At

I recently created a .dmg for my application using macdeployqt. The application works fine on other Macs, but I noticed that the original location of the built .app is at the top of the window after double clicking on the .dmg:

dmg screenshot

This is visible even on other Macs, and I'd rather it not be, since it seems like irrelevant information for an end user. I tried looking at the .dmg with these commands:

cd /Volumes
hdiutil info

I got a bunch of output, where the relevant part seems to be at the end:

framework       : 444.50.16
driver          : 10.12v444.50.16
================================================
image-path      : /Users/mitch/dev/slate-releases/slate-v0.0.5-mac.dmg
image-alias     : /Users/mitch/dev/slate-releases/slate-v0.0.5-mac.dmg
shadow-path     : <none>
icon-path       : /System/Library/PrivateFrameworks/DiskImages.framework/Resources/CDiskImage.icns
image-type      : UDIF read-only compressed (zlib)
system-image    : false
blockcount      : 97676
blocksize       : 512
writeable       : false
autodiskmount   : TRUE
removable       : TRUE
image-encrypted : false
mounting user   : mitch
mounting mode   : <unknown>
process ID      : 31262
/dev/disk2  GUID_partition_scheme   
/dev/disk2s1    [...]   /Volumes/:Users:mitch:dev:slate-qt5_10_isle_fw-Release:app:slate

Why is the original filename part of the .dmg, and how can I remove it?

1

There are 1 best solutions below

1
On BEST ANSWER

Volume Name

What appears as the window title in your screenshot is the volume name of the .dmg.

Create Short Volumen Name

Easiest way to handle it would be the following:

  • in Terminal cd to the path where you app resides
  • call from there macdeployqt <appname> -dmg

Then a .dmg is then created, which has the name of the app as volume name.

Example

cd examples/basic/widgets/cd/darwin
macdeployqt widgets.app -dmg

gives:

dmg name

So actually the relative path when calling macdeployqt is used as volume name for the .dmg.

You can't remove or change the volume name of an existing readonly .dmg.

If you would create your .dmg with Disk Utility (located under /Applications/Utilities) by <File/New Image/Blank Image...> you would enter a 'Name'. This name is the same as the volume name of the .dmg.

Manual Conversion

If you want to use a GUI application to create a new .dmg with a custom volume name from your existing read-only.dmg, you can do this as follows:

  • create a new .dmg with correct name (this name is then shown as window title, we could use here e.g. 'SomeFancyName')
  • choose as format 'Mac OS Extended (Journaled)'
  • Encryption: 'none'
  • Partitions: 'Single partition - GUID Partition Map'
  • Image Format: 'read/write disk image'

Then:

  • copy over the content of the original .dmg
  • finally eject the image from finder
  • use Disk Utility <Images/Convert...>
  • choose your read/write image there
  • save with 'Image Format': compressed

custom name

Image Conversion using the Command Line

If you need to do this regularly, it should be mentioned that hdiutil also offers image conversion via the command line, see:

man hdiutil