diff --git a/build/linux/dist/install.sh b/build/linux/dist/install.sh index e4bd8b6338e..78cf8772d10 100755 --- a/build/linux/dist/install.sh +++ b/build/linux/dist/install.sh @@ -66,6 +66,12 @@ xdg_install_f() { # Make Arduino IDE the default application for *.ino xdg-mime default ${RESOURCE_NAME}.desktop text/x-arduino + # Add symlink for arduino so it's in users path + echo "" # Ensure password request message is on new line + if ! ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino; then + echo "Adding symlink failed. Hope that's OK. If not then rerun as root with sudo." + fi + # Clean up rm "${TMP_DIR}/${RESOURCE_NAME}.desktop" rmdir "$TMP_DIR" @@ -98,6 +104,12 @@ simple_install_f() { chmod u+x "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop" fi + # Add symlink for arduino so it's in users path + echo "" # Ensure password request message is on new line + if ! ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino; then + echo "Adding symlink failed. Hope that's OK. If not then rerun as root with sudo." + fi + # Clean up temp dir rm "${TMP_DIR}/${RESOURCE_NAME}.desktop" rmdir "${TMP_DIR}" @@ -138,6 +150,12 @@ xdg_uninstall_f() { # Remove Arduino MIME type xdg-mime uninstall "${SCRIPT_PATH}/lib/${RESOURCE_NAME}.xml" + # Remove symlink for arduino + echo "" # Ensure password request message is on new line + if ! rm /usr/local/bin/arduino; then + echo "Removing symlink failed. Hope that's OK. If not then rerun as root with sudo." + fi + } # Uninstall by simply removing desktop files (fallback), incl. old one @@ -169,6 +187,12 @@ simple_uninstall_f() { rm "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop" fi + # Remove symlink for arduino + echo "" # Ensure password request message is on new line + if ! rm /usr/local/bin/arduino; then + echo "Removing symlink failed. Hope that's OK. If not then rerun as root with sudo." + fi + } # Update desktop file and mime databases (if possible)