megastep / makeself

A self-extracting archiving tool for Unix systems, in 100% shell script.
https://makeself.io
GNU General Public License v2.0
2.32k stars 372 forks source link

RFE: Options like «--target» for makeself to specify default unpack directory #306

Closed belonesox closed 1 year ago

belonesox commented 1 year ago

Currently, users can specify the installation directory for a self-extracting archive using the '--target' option. However, there is no way to specify the default unpack directory, only the option to unpack to a temporary directory or not (see also the discussion on https://github.com/megastep/makeself/issues/302).

It would be great if we could specify the directory to which the archive should be unpacked. Many use cases involve unpacking the content from the .sh file to '/opt/mysoft' or '~/apps/mysoft' and running a post-install script without copying from a temporary or proxy directory, thus saving time and space (and solving lot of problems with loosing extra attributes or correct rights because of incorrect umask, etc).

For me it will be good workaround for https://github.com/megastep/makeself/issues/302 :)

belonesox commented 1 year ago

There is some workaround — it possible to pass to makeself something like

--notemp  --untar-extra "-C /opt/mysoft "

but makeself "did not know" about unpacking to /opt/mysoft and trying to create subdirectory (and it will be empty) in current dir (that lead to fail then running self extracting script on read-only file systems, like CDROMs).

belonesox commented 1 year ago

Oww.

Looking at code of makeself I discovered that this option already exists!

But missed in section "Usage" of https://makeself.io/ . Looks like the documentation should be fixed.