Add library to path




  • Avatar

    Currently, the action just works with system scope so it requires root privileges. If you are installing as a regular user you should see a message logged in the installation log saying:

    Warning: addLibraryToPath: unable to execute this action (you need to be root)
  • Avatar

    To add a library to the library path, you could set the LD_LIBRARY_PATH on Linux or DYLD_LIBRARY_PATH on OS X. You could use an <addTextToFile> action to modify the .bashrc:

        <text>export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${installdir}/libraries" </text>

    A better option would be to create a wrapper to your application that will first load the appropriate environment variables. For example, to call an application ${installdir}/bin/, you could rename it to ${installdir}/bin/ and create a shell script ${installdir}/bin/, with contents:

    export LD_LIBRARY_PATH
    exec $0.bin "$@"

    That will launch your application with the proper environment without altering the user configuration.

Please sign in to leave a comment.