Firmware suggestion: "Java is not installed" dialog


hmc

Active Member
Joined
Dec 19, 2011
Messages
787
Location
Bavaria, Germany
If the Java PND has not been executed yet to install Java, how about if there was a script /usr/bin/java preinstalled in Pandora OS, that triggers a zenity infobox, stating that Java is not installed and asking the user to install it via the Java PND (giving the repo URL or even starting PNDManager with the Java PND page directly using a dedicated dialog button)?

Installing the Java PND would replace the /usrbin/java script with the real java executable.

Uninstalling Java should bring back the script in some way.

 

So, if any application tries to call java, currently it simply fails, but with such a script, the user would be informed why it fails, and would be presented a solution.

 

Comments?

Possible issues?
 
Last edited by a moderator:
Does anything currently already check for the existence of this file to test whether or not Java is installed?  if so it may present a false positive to that software.I don't know if any existing software does this.

Given the nature of what you are suggesting, I'm not sure it would actually matter if any did. 

That said I think it sounds like a very good idea.

- Neelix
 
Good suggestion.

Is there a way to launch PNDManager with a specific application displayed on startup?
I don't think so, but it would be nice to have that functionality, e.g. to integrate PNDManager in the Tournament Hub.
 
I think this a very good idea which solves a usibility issue. The suggested solution is simple. :)

Here is my version of the script:


#!/usr/bin/env sh
#
# A simple placeholder script for a missing java installation.

# Copyright (c) 2013, Florian R. A. Angermeier
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of the OpenPandora Project nor the
#       names of its contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL FLORIAN R. A. ANGERMEIER BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

if [[ -z "${DISPLAY-}" ]]; then
    fmt_std="\e[0m"
    fmt_bold="\e[1m"
    
    printf "You have currently not installed the ${fmt_bold}Java™ runtime environment${fmt_std}.\n"
    printf "Please install it via the appropriate PND.\n\n"
    printf "The PND can be found here:\n"
    printf "${fmt_bold}http://repo.openpandora.org/?page=detail&app=java${fmt_std}\n\n"
    printf "Please follow the installation instructions there.\n"
else
    text="You have currently not installed the <i>Java™ runtime environment</i>.\n"
    text+="Please install it via the appropriate PND.\n\n"
    text+="The PND can be found here:\n"
    text+="<i>http://repo.openpandora.org/?page=detail&amp;app=java</i>\n\n"
    text+="Please follow the installation instructions there."

    zenity --title "Java™ runtime environment" \
           --info --text "${text}" --no-wrap
fi

Screenshots:

Terminal (only if no display is available; for demonstration I have passed by the check)

ntez5.png


GUI

33w78gk.png

The link can be selected and copied to the clipboard.

I have added a license header (New BSD License). If it is not necessary for shell/bash scripts just drop it.

EDIT 1: What should be the <organization>?

EDIT 2: I have used "OpenPandora Project" for the <organization> placeholder. If another name is wished let me know.
 
Last edited by a moderator:
That would do the trick..

Also you can simply your line variables to use only one with concatenation.. Pet peeve of mine excessive variables.

Code:
line="First Line\n"
line+="Hey another Line\n"
line+="Got some more lines!!\n"

Some_Command "${line}" ...etc
could also do this if you don't mind poor indenting:
Code:
line="First Line\n
Hey another Line\n
Got some more lines!!\n"

Some_Command "${line}" ...etc
 
Last edited by a moderator:
I have updated my post above. Thx for the tip TrashyMG. I went for the first solution. ^_^
 
A nice addition could be to have a button (GUI) or key (terminal) that launches the system's default browser with the PND URL (as a compromise, because PNDManager cannot be launched with a spedific PND page).

However, I don't know if URL opening with default browser currently works on Pandora OS.
I remember some issues with this from another application that tries to do so for opening the Add-On download page (NoteCase Pro).
 
SuperZaxxon also comes with wget included, so if a link could be provided on the repo to the latest version of the latest PND directly, it could pull it down (assuming a network connection) and save it somewhere, perhaps in /pandora/apps on the first SD card.
 
Great idea. 

This, or the "open web page" button, both require an Internet connection. So why not directly offer to download the PND (provided there is a static link to the latest PND version).

For those users, who do not have an Internet connection at that time, I suggest to add simple instructions, that do not require link copying/pasting, such as:
"To install the Java PND later, search for 'Java' in the repo / PNDmanager"

That info could also be shown, if the script recognizes that there is no Internet connection, after the user pressed the "Download" or "Show page" button.

Well, now it slowly becomes complicated. ;-)
 
Back
Top