sindresorhus / create-dmg

Create a good-looking DMG for your macOS app in seconds
MIT License
4.72k stars 196 forks source link

Create APFS disk images for apps targeting macOS 10.13+ #81

Closed zorgiepoo closed 1 year ago

zorgiepoo commented 1 year ago

As part of #79, create APFS disk images for macOS 10.13+ apps.

This also fixes a bug where create-dmg may previously prefer to use UDZO if the app's minimum system requirement was >= 11.0 because it didn't compare the major version component.

This requires nodeapp-dmg 0.6.6 which I added support for APFS disk images there.

sindresorhus commented 1 year ago

I just realized that we could simplify this a lot. The oldest macOS version Xcode can target now is macOS 10.13, so it makes sense for this package to also target that. That means we can remove both of the checks.

zorgiepoo commented 1 year ago

I can do that if you want but.. we may want to keep the checks for a few reasons so I'd personally keep it:

  1. Some developers can (and do) build an app using an older Xcode / OS to target older OS releases.
  2. It could still be useful to (re-)create dmgs or archives for a developer's older versions of apps even if their latest app supports macOS 10.13+ (for example if I want to change an older release from zip -> dmg or if I wanted to change a dmg after switching to create-dmg, etc)
  3. If we want to provide an option to apply extra compression in the future to finish #79, these checks (or the basis of them) would be useful to determine if lzma (or possibly bzip2) should be used. With this current pull request, I think create-dmg has the right defaults.
sindresorhus commented 1 year ago
  1. They can do what they do with Xcode, use the older version of this package.
  2. ^
  3. The checks can always be added back later. They are not gone. They are still in the history here.
zorgiepoo commented 1 year ago

IMO, create-dmg should at least warn the user (or fail) if they're trying to build a dmg now with an app with a deployment target < 10.13. Xcode issues a build warning if you do this for comparison. (But also: if you can warn, then why not go through the small amount of extra effort to fallback on older formats?)

The other potential argument is: Xcode 14 doesn't support building binaries < 10.13, but hdiutil still supports building HFS+ and zlib disk images.. as a tool that creates disk images, hdiutil or disk utility is the more appropriate comparison.

I removed the minimum system version code like you asked however. Feel free to merge if that's what you want, or let me know if you'd like more refinement here.

sindresorhus commented 1 year ago

Thanks :)