diff --git a/src/core/appdir_root_setup.cpp b/src/core/appdir_root_setup.cpp index c0e8cee..6ababee 100644 --- a/src/core/appdir_root_setup.cpp +++ b/src/core/appdir_root_setup.cpp @@ -178,18 +178,18 @@ namespace linuxdeploy { << std::endl << "# autogenerated by linuxdeploy" << std::endl << std::endl - << "export APPDIR=${APPDIR:-$(readlink -f $(dirname \"$0\"))}" << std::endl + << "this_dir=$(readlink -f $(dirname \"$0\"))" << std::endl << std::endl; std::for_each(bf::directory_iterator(appRunHooksPath), bf::directory_iterator{}, [&oss](const bf::path& p) { if (!bf::is_regular_file(p)) return; - oss << "source \"$APPDIR\"/" << APPRUN_HOOKS_DIRNAME << "/" << p.filename(); + oss << "source \"$this_dir\"/" << APPRUN_HOOKS_DIRNAME << "/" << p.filename(); }); oss << std::endl - << "exec \"$APPDIR\"/AppRun.wrapped" << std::endl; + << "exec \"$this_dir\"/AppRun.wrapped" << std::endl; // first we need to make sure we're not running this more than once // this might cause more harm than good