I'm building a linux installer for a Java application, and I end up with an install.jar and a setup.sh that I put in a zip file using ant.
The idea is the user unzips the zip file and then runs setup.sh but the trouble is that they always need to chmod setup.sh first to give themselves execute permissions.
I want to remove this step and Im not sure if the problem part is:
The zip file format stores the permissions of the files and folders as they were set on the system where the zip file was created.
zip is used to compress the files to reduce file size and also used as file package utility. zip is available in many operating systems like unix, linux, windows etc. If you have a limited bandwidth between two servers and want to transfer the files faster, then zip the files and transfer.
gzip normally preserves the mode and modification timestamp of a file when compressing or decompressing. If you have appropriate privileges, it also preserves the file's owner and group. The gzip file format is specified in P.
You don't have to switch to tar files. I don't know why people who don't know Ant are offering advice on this topic.
Use zipfileset's filemode parameter. Documented at http://ant.apache.org/manual/Types/zipfileset.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With