Search code examples
linuxsh

makeself running startup script as sourced script


I was making a self-extractable archive using makeself and I'm able to generate and run it, but I need to run the install script as a sourced script.

I see an option to pass script arguments in the makeself documentation:

makeself.sh [args] archive_dir file_name label startup_script [script_args]

But none of my arguments are being picked up with the following command:

makeself.sh ./test ./test.run "sample installer" ./install.sh

How can I tell makeself to run install.sh as a sourced script?


Solution

  • I have found an alternate solution for the issue.

    Instead of calling makeself with install.sh as the startup_script, I have added another script, launcher.sh, which will do it instead:

    makeself.sh ./test ./test.run "sample installer" ./launcher.sh
    

    Launcher.sh contents:

    source ./install.sh