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

[macos] jpackage produces confusing post- and pre- installation PKG scripts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • 17, 21, 24, 25
    • tools
    • generic
    • os_x

      I inspected the "postinstall" and the "preinstall" scripts that jpackage adds to PKG bundles. They look strange.

      postinstall:
      ---
      #!/usr/bin/env sh

      chown root:wheel "/Applications"
      chmod a+rX "/Applications"
      chmod +r "/Applications/SimplePackageTest.app/Contents/app/"*.jar

      exit 0
      ---

      preinstall:
      ---
      #!/usr/bin/env sh

      if [ ! -d "/Applications" ]
      then
          mkdir -p "/Applications"
      fi

      exit 0
      ---

      For SimplaPackageTest test app, shouldn't they be respectively:

      postinstall:
      ---
      #!/usr/bin/env sh

      chown root:wheel "/Applications/SimplePackageTest.app"
      chmod a+rX "/Applications/SimplePackageTest.app"
      chmod +r "/Applications/SimplePackageTest.app/Contents/app/"*.jar

      exit 0
      ---

      preinstall:
      ---
      #!/usr/bin/env sh

      if [ ! -d "/Applications/SimplePackageTest.app" ]
      then
          mkdir -p "/Applications/SimplePackageTest.app"
      fi

      exit 0
      ---
      ?

      Are they even necessary?
      Why are read permissions required for jar files?
      Why does the script alter the owner and the permissions of "/Applications" directory? I believe the code below
      ---
      chown root:wheel "/Applications"
      chmod a+rX "/Applications"
      ---
      is doing nothing; otherwise, people would have complained already.

      Should we remove this code, or fix it?

            almatvee Alexander Matveev
            asemenyuk Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: