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:
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?
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:
cd
to the path where you app residesmacdeployqt <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:
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:
Then:
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