Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8250950

Allow per-user and system wide configuration of a jpackaged app

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      All supported systems, but tested on java 14.0.2+12-46 macOS Catalina 10.15.6 (latest as of today).

      A DESCRIPTION OF THE PROBLEM :
      When jpackage creates a deployment image, that image contains an embedded configuration file (one of APP_NAME+".cfg", or "Info.plist", or "package.cfg"). Our application requires that each user be able to configure the memory requirements for their usage pattern. Currently, there appears to be no way to do this.

      Additionally, when the user upgrades the application to the next release, any changes they may have made to the predefined configuration file (as listed above) will disappear because the upgrade process will replace it.

      My proposed solution would be to prepend another location to the list of directories that are searched for the configuration file. Looking in Platform::GetConfigFileName(), it would appear that checking Platform::GetAppDataDirectory() first would solve this issue. (Although checking multiple directories means GetConfigFileName() should probably iterate over directory names, checking each of the possible configuration filenames for each directory.)

      I considered an environment variable for the solution, but macOS launches applications via Finder, which is started by launchd, which does have an easily user-configurable way of adding environment variable definitions (that I can tell).


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              herrick Andy Herrick
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: