izissise
izissise

Reputation: 943

Create a flatpak for a self updating java application

I want to isolate a java application in a flatpak environment it mostly works when installing the application in the /app directory.

Problem is, the application is using install4j and it is trying to self-update, but /app is read-only at runtime (when executing flatpak run ...).

Is there a way to make /app read-write, or is there another directory where I could install the application?

I think a --filesystem=xdg-something in finish-args is the start of the answer but the directory isn't available at build time (when running flatpak-builder).

Upvotes: 0

Views: 109

Answers (1)

izissise
izissise

Reputation: 943

As a workaround this I ended up creating a wrapper script that first copy the application in cache before running it.

#!/bin/bash

if [ ! -d "$XDG_CACHE_HOME"/workdir ]; then
    cp -r /app/data/ "$XDG_CACHE_HOME"/workdir
fi

exec "$XDG_CACHE_HOME"/workdir/app "$@"

This works for my use case

Upvotes: 0

Related Questions