Add the ability to generate an installer for linux distribution

Issue #541 resolved
Robert Leach created an issue

USE CASE: WHAT DO YOU WANT TO DO?

Make the app installation a polished & professional experience by following established conventions for linux installations

STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)

  1. Download an installer file
  2. Run the installer
  3. Double-click the installed app icon

CURRENT BEHAVIOR

Currently, users are downloading a zipped jar file.

EXPECTED BEHAVIOR

Installation via installer

DEVELOPERS ONLY SECTION

SUGGESTED CHANGE (Pseudocode optional)

Add installer code to the gradle build file & set up a bitbucket pipeline to produce the installer automatically.

FILES AFFECTED (where the changes will be implemented) - developers only

build.gradle

LEVEL OF EFFORT - developers only

medium

COMMENTS

Similar to issue #500.

Comments (12)

  1. Robert Leach reporter

    I was able to get gradle to create an executable that runs on linux. Still trying to finagle a .deb or .rpm out of it...

  2. Robert Leach reporter

    I'm not getting anywhere with this and at this point, I'm just banging my head against the wall. I posted on stackoverflow. I'll see if I get a response, but other than that, I'm going to move on to the windows distro creation. The mac gradle stuff was so easy. I don't know why the linux gradle stuff seems so complex & buggy.

  3. Robert Leach reporter

    Ah! I got it to work. 1 issue was that the gradle version is important. You have to use version 3.0. And the version of setupbuilder must be 1.8.0. I also discovered that I was unzipping versions on top of one another that was causing the NoSuchMethod errors I was getting. A clean install of gradle, then a gradle clean helped. I was getting null pointer exceptions until I added:

    from( 'build' ) {
        include 'libs/*.jar'
    }
    

    Then, when I ran gradle, then gradle deb (not with --stacktrace), I started getting meaningful errors from lintian. I addressed those (notably: 'application' and 'description' values appear to get swapped) and then I was able to generate a .deb file without error.

    Now I just have to make sure the .deb file works...

  4. Robert Leach reporter

    I managed to get something to work. It's a little messy unfortunately, but I'm very new to gradle, especially on linux. I even got the java executable to appear in the "dock" with the app icon.

    @lance_parsons & @TreeView3Dev - Could you guys try out the debian gradle packaging for debian on my branch named "issue541-linux_build"? Just checkout the branch, cd into the directory, and run:

    gradle clean buildDeb
    cd build/distributions
    sudo apt install ./treeview3*.deb
    treeview3
    

    It's working on my ubuntu virtual box, but you never know...

    All it does for now is create a shell script and put stuff in /usr/local. The '/usr/local/bin/treeview3' executable script should be in your path.

  5. Lance Parsons

    @hepcat72 Seems to work for me, on Ubuntu 16.04, yay! Sorry, I don't have Debian installed anywhere, so I can test there. The icon appears when it's running, but no desktop file was installed, so it has to be launched from the command line. Not sure of the your expectation there.

    One small comment, it's probably better to be using the Gradle wrapper (gradelw) that is checked into the project. That ensures we are all using a consistent version of Gradle. Also, that wrapper should have execute permissions (maybe include that in this branch?).

  6. Robert Leach reporter

    I decided the desktop file should be resolved in a separate ticket. It was hard enough just getting gradle to create the script and put things in the system. Chris and I were talking on slack - we can definitely improve it later.

    I didn't think about the implications of using the wrapper. That's a good point. The wrapper does exist in the gradle directory, but I thought of it as there to be used by someone who doesn't have gradle installed. Try it out and let me know.

    Incidentally, I don't know if clean needed to be included in the gradle command, but I know that I was having issues with it not doing anything when I didn't include it.

    The icon was implemented in the java source code. I just check to see if I'm not running on a mac and then apply a PNG to the java executable. I think it should work for both windows and linux. While it would be nice to also apply an icon to the script (and optionally the jar file), I figured if people are running linux, they're not going to care that much about that. So I thought that that could be also teased out into a separate issue.

  7. Lance Parsons

    Makes sense to keep the desktop file as a separate task, just wasn't sure of the intent here.

    I did use the wrapper, and it worked fine for me. This should be part of the pipeline, where the wrapper would presumably be used, that's a good test.

  8. Robert Leach reporter

    I submitted the PR. Note, there is a separate issue for incorporating this build into a bitbucket pipeline.

  9. Log in to comment