jpackage on MacOs: app from pkg cannot write files and create directories inside itself
swpalmer at gmail.com
Mon Sep 9 19:36:33 UTC 2019
You should never write inside an application bundle. (Thank the malware writers for these restrictions.)
On macOS your writable files should go somewhere under /Library/Application Support/ or ~/Library/Application Support/
On Windows you should write to somewhere under %ProgramData%, %APPDATA%, or %LOCALAPPDATA%
> On Sep 6, 2019, at 8:49 AM, Andrey Volkov <andvolkov at gmail.com> wrote:
> I use jpackage (Build 14-jpackage+1-35) to bundle my Swing-based app for
> MacOS. Whereas DMG format works pretty well, PGK bundle has a serious
> issue. When I install the app from PKG, it cannot write files or create
> directories inside itself.
> I have /resource directory for my app that has a few settings and temp
> directory for file processing. For the app from PKG I get "File not Found
> (Permission Denied)" when the app tries to create a directory like
> "/Application/MyApp.app/Contents/Java/resources/temp" or any write/create
> any file inside "/Application/MyApp.app/Contents/Java/resources/"
> Do you have any clue how to fix it for PKG bundle? I would prefer to use it
> because it has a more user-friendly installation.
> BTW, Windows has a similar issue when per-user installation works fine, but
> a system-wide installation in "Program Files" lack permissions to write
> files inside "Program File/MyApp".
> Best regards,
> Andrey Volkov
More information about the core-libs-dev