News for hackers. Stuff that matters.
Re:Open Question: How Can We Fix Files? by sitharus on Friday August 06, 2021 @02:00AM (#28083801)
This is mostly a historical thing. There’s no real reason to use .dmg these days - historically it was the only Apple-supported way of compressing macOS files and keeping their resource forks intact. These days .zip is fine.

That said there isn’t an ‘install’ as such on macOS. Applications isn’t a special folder, it’s a regular folder like anything else. Putting an application bundle on your local disk anywhere is sufficient to get file type mappings to work.

The downside of course is there’s no corresponding uninstall that removes anything extra the app dropped in to ~/Library.

Re:Open Question: How Can We Fix Files? by pjc50 on Friday August 06, 2021 @04:34AM (#28084604)
At work we make a .pkg inside a .dmg, and I'm told this is because that's the only way to have an icon?

> Putting an application bundle on your local disk anywhere is sufficient to get file type mappings to work.

How does this work "under the hood"?

"Bundles" and "packages" as a general concept are interesting. Lots of games from DOOM upwards use "packfiles", which are effectively lots of files in a never-unpacked container. You can't see them in the filesystem, because the intent was to avoid incurring filesystem overhead for them. MacOS bundles appear to have gone in the opposite direction: the structure is brittle (if you move anything it breaks signing), but it's unpacked into the filesystem.

Re:Open Question: How Can We Fix Files? by sitharus on Friday August 06, 2021 @06:39PM (#28093597)
A .app inside a zip is fine.

Under the hood, Apple used to have a tech note on it but I can’t find it right now. Essentially the OS uses file system event notifications to watch for bundles being added or removed. It maintains a database of the mappings declared in the plist for fast lookups.

Re:Open Question: How Can We Fix Files? by aasasd on Friday August 06, 2021 @06:21AM (#28085267)
> that's the only way to have an icon

Icon for what? .apps inside dmgs have icons just fine, like anywhere else (locally). Moreover, people add background images via some special metadata files, to have those arrows telling you to drop the .app onto the symlink to the Applications folder.

Re:Open Question: How Can We Fix Files? by unnah on Friday August 06, 2021 @02:24AM (#28083912)
So if installation means simply moving an application to your local disk, or specifically to the Applications folder... then how does stuff end up in ~/Library instead?
Re:Open Question: How Can We Fix Files? by IshKebab on Friday August 06, 2021 @02:43AM (#28084012)
The app puts it there when it runs.
Re:Open Question: How Can We Fix Files? by einherjae on Friday August 06, 2021 @02:39AM (#28083989)
Preferences, caches, etc. general by-products.
Re:Open Question: How Can We Fix Files? by IshKebab on Friday August 06, 2021 @02:41AM (#28083998)
There totally is an install. Tons of apps use a Windows-style install process.
Re:Open Question: How Can We Fix Files? by sitharus on Friday August 06, 2021 @03:41AM (#28084312)
For applications there is no Windows style install process where things like the registry have to be updated, the os manages these associations itself.

For things like kernel extensions yes there’s an installer, and some more invasive apps do that as well. But for a plain app there’s no _need_ for an installer. That doesn’t prohibit them of course.