quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.96k stars 327 forks source link

Macos pkg default installation location should be `~/Applications/quarto` instead of `/Applications/quarto` #4900

Open kdheepak opened 1 year ago

kdheepak commented 1 year ago

Bug description

When installing the quarto pkg file for MacOS, the current default installation requires root. Is there a reason this was chosen as the default?

I'd like to propose changing it such that it installs just for one user by default. Users can opt-in to choosing to install it for all users (i.e. with root) if they'd like.

Checklist

dragonstyle commented 1 year ago

Thanks for raising this - we'll take a look at it for the 1.4 release. When we originally made the installer, installation into /Applications appeared to be the most common user experience on MacOS, but this is something we'll revisit to make sure we still feel good about.

kdheepak commented 1 year ago

There's a few reasons I think changing the default would be good.

1) In corporate environments work machines are typically heavily locked down and do not allow installing with root. 2) For personal machines or work machines with root access granted to the users, it is easy to accidentally install into /Applications/quarto because that is the default. On my personal computer, it asked me for my finger print and I absent minded-ly gave it permissions, and it installed it using root. I have also accidentally installed version 1.2 before and only realized it when my project wasn't compiling. 3) This is not entirely related but Quarto isn't an app, it's just a folder with bin and share and there's no uninstaller at the moment afaict. Also, uninstalling is not clean at the moment. Even though I removed /Applications/quarto, this /Applications/quarto/bin is still in my $PATH and I don't know where it is coming from and don't know how to remove it. Until this is sorted out, it would be better to not install using root by default. 4) I've been using the quarto prerelease for about a month now and it seems to be working fine without root. Until root is really required, it would be nice to request minimal permissions by default.

dragonstyle commented 1 year ago

Thanks for the additional comments- I think these are all pretty compelling arguments. We definitely do not require root access and in fact we have the option to install without root privileges right in the installer UI itself, so it is really a matter of what is the correct default!

kdheepak commented 1 year ago

Another reason I'd like the default to not be root is that when installing using brew install --cask quarto it asks me for admin permissions / my password.

image

This makes it hard to automate upgrades.

multimeric commented 1 year ago

I don't mind the default being /Applications, but I believe there's a simple config setting you can change that allows users to install the pkg into arbitrary user directories if they want.

Currently when I try to do so it fails because the installer isn't configured to allow it:

$ installer -pkg ~/Downloads/quarto-1.3.353-macos.pkg -target ~/Applications
installer: Must be run as root to install this package.

I think the config setting in question might be domains.enable_currentUserHome. You should be able to set that in the plist file.

dragonstyle commented 1 year ago

Thanks for sharing - we have that setting configured for the UI via the distribution.xml but I didn't know that it was allowed / warranted in the plist file. I will check it out.

multimeric commented 1 year ago

Oh, you're probably right about it going into the distribution.xml, I'm no expert here. But in that case I have little idea why it won't install!

dragonstyle commented 1 year ago

OK, the issue is that the target actually isn't a path but a target domain. In our case, you can choose the current user directory like so: installer -pkg quarto-1.3.353-macos.pkg -target CurrentUserHomeDirectory (query available domains using installer -verbose -dominfo -pkg quarto-1.3.353-macos.pkg).

multimeric commented 1 year ago

Nice! That works without root. It installs the quarto tree into ~/Applications:

/Users/milton.m/Applications/quarto/
├── bin
└── share

And it seems to work via GUI too, not sure why I didn't try that first!

dragonstyle commented 1 year ago

Great! Thx for confirming!