macos – Why does using the same name for -volname and -srcfolder result in ‘operation not permitted’ error?


I have a file called installer.app. I am using the script below to create a DMG:

appName=installer
installerFile=installer.app
dmgFile=installer.dmg

hdiutil create -volname "${appName}" -srcfolder "${installerFile}" -ov -format UDZO "${dmgFile}"

I receive an error message stating:

could not access Volumes/installer/installer.app: operation not permitted

However, if I change the command to the following, I do not receive an error:

hdiutil create -volname "${appName}-volume" -srcfolder "${installerFile}" -ov -format UDZO "${dmgFile}"

My question is, since -volname is just a label, why does it not allow it to be the same as -srcfolder?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img