sindresorhus / create-dmg

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

Support for APFS and LZMA compression #79

Closed zorgiepoo closed 10 months ago

zorgiepoo commented 1 year ago

I'm creating this to discuss support for creating APFS disk images (which requires 10.13+) and disk images using "ULMO" (or lzma compressed) format (which requires 10.15+). Both of these are 'relatively' modern features/enhancements to dmgs.

Given that this tool is "opinionated", if the app minimum system requirement is >= 10.13, I think it always makes sense to just opt into creating APFS disk images over HFS+ ones.

For the ULMO format it's not always really clear cut if the developer wants fast decompression (lzfse) or significantly reduced file compression (lzma). (In some cases for my relatively-small apps I find the decompression speed difference to be less noticeable while the compression file size savings to be more significant for example; lzma is much better than bzip2). In this case, I'd perhaps suggest an "extra-compression" or "heavy-compression" option which uses ULMO if the minimum system requirement is >= 10.15, otherwise use UDBZ (bzip2) (or perhaps don't support UDBZ at all).

Either way, it's not possible to integrate these modern-parity enhancements right now. I've added pull requests to the upstream node-appdmg project for adding them there first (including more motivational details). I created this to open a discussion as I'm not sure whether these are wanted here.

https://github.com/LinusU/node-appdmg/pull/220 https://github.com/LinusU/node-appdmg/pull/221

sindresorhus commented 1 year ago

I agree with defaulting to APFS and ULMO when possible. I don't see the need to have options for either.

zorgiepoo commented 1 year ago

APFS is a given default (and I've never seen HFS+ perform better, only the same or significantly worse).

But in my opinion ULMO (lzma) is not always the objectively better tradeoff compared to ULFO (lzfse). I think ULFO (lzfse) would still be a "safer" default. It depends on the app workload. For example, for one of my relatively small apps I may be willing to pay a ~30% reduction (to 13 MB from 18 MB) with a ~500ms slower decompression. But for like say Garageband.app where it happens to not compress that well here, I may not want to pay a ~3% reduction (to 777 MB from 805 MB) with a ~20 sec slower decompression (to 30 sec from 10 sec).

sindresorhus commented 1 year ago

Sounds like ULFO is indeed the best default then. I'm not sure I want to introduce any more flags. I specifically made this package as minimal as possible so users don't have to make difficult technical decisions.

From a users perspective it's also not clear what to prioritise. Should I prioritise users with a fast internet connection or a fast computer.

zorgiepoo commented 1 year ago

Yeah I'm fine with this and only providing ULFO can make sense for now. Just wanted to bring it up to discussion here but we can close this issue out once APFS support is resolved. Maybe in the far future there may be more feedback if people really want or need to use ULMO.