Earlier quoted context omitted.
The same way any linux distro does? Define a separate directory for program installations, that user processes cannot write to. Only program that can do so is the package manager, which other programs can call to install packages. Uninstall removes everything related to a program from this directory. > In the age of shared runtimes, auto-updaters, extension marketplaces, and JIT compilers, managing installed applicat…
That was the first option, "provides a framework for installers/uninstallers". But what would you do with the millions of existing programs, most unmaintained? And what about programs with strong opinions on update schedules, or built-in extension marketplaces? It's easy to solve this problem if your first step is "replace every program".
By the way that's what we have on Linux, some programs come as a shell script that you run to install them. Most Java IDEs for instance.
(which can't be arsed to provide proper packages -- darn, what did I just write? :-))