0

I am trying to create native package in JavaFX8. The main build, installation and execution is working, however I have problem with permissions. Application is installed to /opt (as should always do according to documentation) but with root ownership and permissions set on all files and folders. So if I want to create or download some file within the application, it's not possible due to missing permissions.

I cannot find any solution how to avoid this. Obviously i don't want to force user to change permissions manually. Is there some way how to allow application change files within this folder? Or for such situations installation must be in a different way?

Thanks for any hints

user3886894
  • 41
  • 1
  • 5
  • I had the same problem with Windows ("C:\Program Files\..."). I think in general applications are not supposed to write in these directories (after installation). You can use the home directory for your purposes (`System.getProperty("user.home")`). – gfkri Feb 09 '15 at 13:52
  • As I know it is possible to define for windows package if users folder or program files should be used. Unfortunately it's not possible for linux. So far I find out it should be possible to set permissions directly for rpm package so I am wondering how to do it. Either by e(fx)clipse or manually. – user3886894 Feb 09 '15 at 14:44
  • Yes, thats right, it is possible. However, I meant I would rather write your created/downloaded data into a separate corresponding directory within the user directory as e.g. eclipse itself does it (`~/.eclipse`). – gfkri Feb 09 '15 at 16:46

1 Answers1

0

I think I found solution although it still needs some tweaks. When eclipse generated rpm is installed, we can use rpm build tools. Just download and use rpmrebuild -e packagename command in terminal. It is possible to change %attr for each file/folder. After edit, new rpm file is created (somehow smaller, maybe better compression?) and can be distributed further.

Still don't know how to change root ownership to the user who installs, but for now it's definitely progress.

user3886894
  • 41
  • 1
  • 5