3

I have a directory, with a small scructure:

script.sh
dist/
dist/program.jar
log/
log/error.log
conf/
conf/program.conf

The script.sh do some checks, and start program.jar with a lot of parameters.

There's a way to encapsulate all this structure in a single file (like the directory.app executables in OSX), and made this file a executable?

2
  • You mean an installer? Or something that contains everything in binary form and can be run directly? Both are possible but the second can't be answered here. It will involve you turning it into a program in your favorite language and including the data in the resulting binary.
    – terdon
    May 13, 2014 at 14:22
  • Thanks @terdon. What I want is the second option: a container to run directly (like the directory.app structure in OSX). Maybe I need to rewrite the app to accomplish the script.sh objective. Thank you. May 13, 2014 at 14:41

1 Answer 1

2

No, you can not run a single executable and have your program work without being unpacked. The reason is that your program would expect to be able to access its files using standard syscalls, and if you have those files packed inside an archive, they will not be visible to Linux.

What you can do is use makeself to make a single self-extractable executable archive. Then your user would run the executable, it would extract the files from the archive, and then the user can run the installed program.

Another alternative, since you are using Java, is to pack files inside the .jar archive, and restructure your code. Then you could distribute the single .jar file and the user run it with java -jar.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .