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?
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?