-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Replaced/improved Linux install and uninstall scripts. #3226
Conversation
Install script adds menu item, desktop icon, file association for the current user - even if the Arduino installation was placed outside of the user's home dir (such as in /opt or /usr/local). Added three more icon resolutions (64px, 72px, 96px) - by using the 256px file - maybe there is a better source available for this... Modified build.xml for copying the existing icons and mime.xml file, both scripts and adjusted file permissions (ugo+x) for *.sh files to be executable by others by default.
@ArduinoBot build this please |
Tested the 32bit and 64bit Linux builds in- and outside the users home dir. Works as expected. |
Is there any documenation on how to run those scripts? |
Basically install.sh will add entries and icons for the current user, uninstall.sh will remove them. There shouldn't be any way to break anything which can't be restored by the script itself. There is no need to uninstall first, because these these functions are called anyway when installing. |
I've downloaded the PR and only added those two .sh files to my current nightly built (from today). Before I added a .desktop entry into the application dir of ubuntu myself. It worked and I could pin it to the menu bar. It opened another instance which wasnt perfect but it worked. Not sure what I am doing wrong. |
To copy the scripts won't be enough. You also need the icon dir and the desktop.template file in the lib/ subdir. Both are in the pull request, too. |
Used the full PR now. The desktop icon is now working. I moved this to the menu bar as well. The menu item is opening another instance of the IDE once again. How do I fix this? |
The install script adds two independent links. One in the general apps menu (Unity Dash menu for Ubuntu) and an additional one onto the desktop. The script does not create a shortcut in the launcher. If the user wants it there, he/she has to start the app via the menu and then choose "lock to launcher" (or similar). This part is entirely distribution depended (in this case Ubuntu Unity). If you drop the desktop icon into the launcher, its like adding a second app with the same name. So the behavior you describe is no surprise. Personally I already thought of not adding the desktop icon at all, because it's kind of redundant anyway. |
There is no "lock to launcher" option. I can only drag an drop and this opens a second icon. |
Conflicts: build/linux/dist/install.sh
Sadly i cannot create a screenshot when the sebmenu is opened. |
Hmm... this is interesting. This seems to be a Java related issue, like it is described here:
"Unfortunately" my Arduino windows already get automatically grouped by Unity if I open more than one sketch. Maybe because I use the Sun JDK instead of the OpenJDK? I'm using Ubuntu 14.04. Using xprop on the Arduino window gives me:
You could try adding
to the arduino-arduinoide.desktop file in ~/.local/share/applications If this helps, I could add this to the .desktop file. |
I am using java 8 due to this bug (used the linked installation instructions) #3174
This helps! Edit: By the way: I think the new IDE nightly already has some new high res pictures somewhere. Because the icon in the menu bar is also better now. Not sure about that, just want to say it to not dupe the pics. |
This should group all open Arduino IDE windows together under one icon (i.e. Ubuntu Unity launcher)
.ino files now open with the IDE, it would be nice to add the icon to the file as well (if possible). |
AFAIK file icons can only be changed by writing to a dir outside the user's home dir - which I wanted to avoid, because everything else works fine without root access. Also I would need a scalable image file (SVG) of the used IDE icon for this. I guess most people put it in the home folder - which is absolutely fine. I like to put additional "external" software in /opt - but that's mostly a matter of taste. |
So I have to put the arduino folder there and run the script from this location again? So the script now works fine. I havent checked the script itself since I dont know enough about scripts. But it works and should be added to the IDE. |
Yes, that should do it. |
@ffissore can you please review this so we see it in the new 1.6.5 release? |
Cant anyone review this? |
I just reviewed the code, looks ok to me. I wonder if the "legacy" code really needs to be kept around in this script? I'd say that if you want to use XDG-style shortcuts, it is ok to just require xdg-utils to be installed. If you really don't want xdg-utils, you can still just create the .desktop manually. @cmaglie, any view on this? Regarding the startup wmclass thing, having that set to "processing" probably isn't ideal, since it might conflict with the actual processing. Any idea if we can change that? Or is that tied to the main class name perhaps? Finally, I think the script should support the I just tested the current build on Debian Jessie, which works as expected :-) |
I aggree with the -h option. The script works perfectly for me. Ive used it once and the shortcut just keeps working since then, even with newer builds. I used Elementary OS here, based on ubuntu, based on debian. |
Yeah, I agree, that bothered me a little bit, too - it's definitely not ideal. But it seems the only reliable ID a (Java) window/app can be identified by. I have no idea how much effort it would be to change this.
The main reason I put this in in the first place, is for removing existing links/symbols created by the existing install script. About the (First I thought about asking the user before doing anything - but then user interaction would be required - and I also don't wanted it to be too complicated.) |
Having an error message that says "please install xdg-utils" seems reasonable to me? The end result is actually better than falling back to a short-cut-only install. |
It's probably a good idea to also error out when any unknown options are given? |
I added a help option:
All other arguments will produce an error:
(and after this show the help above) If xdg-utils isn't found on the system the help will also show a note that they are recommended. |
Help option looks good to me! |
Please fix issue #4168, too! In your PR it still persists. |
Thanks! I will look into it! |
I changed the script so it will (basically) use the following method to find the correct Desktop directory: This change only affects the "simple install" mode, because the default install using the xdg-utils should already figure out the correct target directory by itself. It would be nice if someone could test this on a system where the desktop folder's name isn't "Desktop" (and/or isn't placed in $HOME). If you already have xdg-utils installed and also want to test the script without it, just edit the install.sh script file and replace |
The path is correct now. But the created desktop file on desktop is empty. Here is the output: https://gist.github.com/jonnius/1a4c75ba012b8baab090 |
Just to be sure: Can you shortly describe how you tested this? Did you just take the script files or rebuild the whole package including all changes? Because there are other files included which are needed. For example: The same is true for all the icon files and the mime xml file. |
I cloned this branch and just started the script.
|
Ok, that explains it. You need to build the dist package first! Go to Arduino/build in the cloned repo/branch and start the provided build-all-dist.bash script. This will create two archives in the Arduino dir (32 and 64bit) which are the archives you want to install/extract (like the official ones you can download on the website). You only need one of these - depending on your system. |
I ran the build-all script and as you mentioned, linux build was successful and windows build was not. But after that I still have the same issue as before. |
Where exactly did you extract the created archive? If it's really the exact same error as before, then it seems you are still starting the script from within the repository structure. |
Sorry, i was in the wrong directory. I can confirm that it works as expected! Thanks! |
@fiechr I've rebased your PR and pushed it to master. It will be available in next hourly build http://www.arduino.cc/en/Main/Software#hourly. Thank you very much for your time and patience |
Except that my raspberry pi (arm) IDE doesnt start at all the install script adds a few warnings:
Might be related to the LXDE desktop, idk. Just want to mention it here. Hope I can get #3549 running some day. |
This install script adds a menu item, desktop icon and file association (mime type) for the current user on Linux - even if the Arduino installation is placed outside of the user's home dir (such as in /opt or /usr/local) - which didn't worked before.
If the xdg-utils aren't available on the target system, a more basic approach is used (just generate and copy the file).
The uninstall script is a simple wrapper and calls the install script to undo the changes.
Also added three more icon resolutions (64px, 72px, 96px) - by using the 256px file - maybe there is a better (vector based) source available for exporting to these resolutions...
Modified build.xml for copying the existing/added icons and existing mime.xml file, both changed/added scripts and adjusted file permissions (ugo+x) for all *.sh files to be executable by others by default after archive extraction. A more conservative approach would be to set only install/uninstall.sh ugo+x.
I tested this on different machines and it works fine so far.