Skip to content

Symlink the arduino binary #7593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 7, 2019
Merged

Conversation

2E0PGS
Copy link
Contributor

@2E0PGS 2E0PGS commented May 12, 2018

install.sh should symlink arduino into /usr/local/bin/arduino so arduino is accessible via users PATH.

Related issues:

#5780

#5366

@facchinm
Copy link
Member

@2E0PGS this would make the "installation" dependant on sudo, which I would avoid at all costs.
Maybe checking the UID and then symlinking the executable in /usr/local/bin/ if we have permissions to do it could be a good solution.
This way, launching ./install.sh as a user wouldn't install the symlink, while sudo ./install.sh would.

@2E0PGS
Copy link
Contributor Author

2E0PGS commented May 16, 2018 via email

@facchinm
Copy link
Member

Yes, but you are assuming that a system has sudo installed and that the user wants to launch arduino from the cli. Also, a per-user installation becomes impossible.

@2E0PGS
Copy link
Contributor Author

2E0PGS commented May 17, 2018

OK I suppose I assumed they are in the SUDOers group. Ref want to access it from CLI I think most who install software expect to find it in path. Thats the easy way to launch software besides using menu entries.

How about making the whole script require root level privileges and then I add code to move the folder into /opt/ and generate symlink to usr/bin. That to me seems like a more sensible trend of installers.

Could add flags for user level install and system wide installs. one requiring root and one not.

@bengtmartensson
Copy link

bengtmartensson commented May 17, 2018

Here is another suggestion: Just try to symlink; if it fails, handle it gracefully and tell the user. (More robust than "check if xxx and if so then zzz", and does not require root access.)

if ln -s xxxx /usr/local/bin/arduino ; then
else
    echo "Linking failed, hope that is OK. If not, redo as root/with sudo."
fi

@2E0PGS
Copy link
Contributor Author

2E0PGS commented May 17, 2018

Yea that's a good idea.

Copy link
Member

@facchinm facchinm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waiting for integration of #7593 (comment)

@2E0PGS
Copy link
Contributor Author

2E0PGS commented May 22, 2018

I will add the changes ASAP.

@2E0PGS
Copy link
Contributor Author

2E0PGS commented May 23, 2018

Added the suggested changes.

@2E0PGS
Copy link
Contributor Author

2E0PGS commented Dec 25, 2018

Did anything like this ever get implemented? I am about to install Arduino and this pull never got merged so wonder if I need to manually symlink still...

@2E0PGS
Copy link
Contributor Author

2E0PGS commented Dec 29, 2018

I did indeed have to symlink it manually still or use my branch.

I think this is fine for merge if the error message from rm or ln is ok in addition to the custom one. Otherwise I will need to modify this pull request so it only shows our custom error message if they don't run using sudo.

@facchinm facchinm added this to the Release 1.8.9 milestone Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants