3 ms·
There's something nice about the ergonomics of a single file compared to a single folder though. A single file is trivial to distribute as-is; you don't even ne
by ripley12 5y ago
There's something nice about the ergonomics of a single file compared to a single folder though. A single file is trivial to distribute as-is; you don't even need to put it in an archive. You can put multiple single-file apps in a directory on your PATH, no futzing with symlinks etc.
There are certainly tradeoffs involved and it's not always the right decision, but these days I usually try to publish software as a single file until I can't.
- ziml77 5y agoNeXTSTEP and (through its lineage) macOS got it right. You put your executable and data files into a directory with a specific structure and then to the user it operates as if it's a single file. You get the benefits of a single folder distribution with the ergonomics of a single file distribution.
- seba_dos1 5y agoWhat happens if you try to, say, send that executable as an e-mail attachment?
- derefr 5y agoWell, first of all, you don't do that, because what email server anywhere is going to accept mail with an executable attached, without thinking it's some kind of attack? But in general, you put it in an archive. (Yes, that's inconvenient; but when you're coming from an OS where you already had to do that — e.g. macOS 9, where you had to use StuffIt Expander to distribute executables in order to ensure they retain their resource forks — switching from StuffIt to zip was a wash.) These OSes (NeXTStep, macOS) usually integrate some support for mounting disk images, though, and so executables packaged for distribution are usually packaged by putting them in a disk-image. To further decrease the friction (i.e. avoid having to say "copy this thing out of this directory into your /Applications dir", they usually make it so that if you run the app from inside the image, it copies itself to your /Applications dir, and then relaunches from there. Sometimes it even unmounts the image when it does that. Given that most people get programs from websites, though, there are also special techniques built into web browsers to make downloading executables on these OSes more transparent and less requiring the abstraction of a disk-image. E.g. Apple's https://en.wikipedia.org/wiki/.XIP https://en.wikipedia.org/wiki/.XIP format, where any .XIP downloaded in Safari will be automatically+transparently integrity-verified and unpacked, with the result being that it seems like you just "downloaded a folder" somehow.
- bob1029 5y ago> There's something nice about the ergonomics of a single file compared to a single folder though Agreed. We are going to move to proper single file (or as close as we can get) as soon as any sort of meaningful AOT compilation is available: https://github.com/dotnet/runtimelab/tree/feature/NativeAOT https://github.com/dotnet/runtimelab/tree/feature/NativeAOT https://github.com/dotnet/runtimelab/issues/248 https://github.com/dotnet/runtimelab/issues/248 There is a "PublishSingleFile" option, but that is just a zip file in disguise.
- ripley12 5y ago> There is a "PublishSingleFile" option, but that is just a zip file in disguise. I don't quite agree. These days (as of .NET 5), if you publish a single-file app all .NET libraries live in the executable and do not need to be unpacked at runtime. Native libraries still need to get unpacked at runtime (if your application uses any; many don't) but I haven't found that to be a big deal in practice.
- bob1029 5y ago> and do not need to be unpacked at runtime Thanks for the correction/clarification. I had not realized this was a thing now. Will give this option another look.