Use correct path for the anbox binary when running from within a snap
This commit is contained in:
parent
7ce6b0d765
commit
4863d25e2c
1 changed files with 11 additions and 1 deletions
|
|
@ -25,6 +25,12 @@
|
||||||
|
|
||||||
namespace fs = boost::filesystem;
|
namespace fs = boost::filesystem;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
// This will always point us to the right executable when we're running within
|
||||||
|
// a snap environment.
|
||||||
|
constexpr const char *snap_exe_path{"/snap/bin/anbox"};
|
||||||
|
}
|
||||||
|
|
||||||
namespace anbox {
|
namespace anbox {
|
||||||
namespace application {
|
namespace application {
|
||||||
LauncherStorage::LauncherStorage(const fs::path &path,
|
LauncherStorage::LauncherStorage(const fs::path &path,
|
||||||
|
|
@ -62,7 +68,11 @@ void LauncherStorage::add_or_update(const Item &item) {
|
||||||
auto package_name = item.package;
|
auto package_name = item.package;
|
||||||
std::replace(package_name.begin(), package_name.end(), '.', '-');
|
std::replace(package_name.begin(), package_name.end(), '.', '-');
|
||||||
|
|
||||||
std::string exec = utils::string_format("%s launch ", utils::process_get_exe_path(getpid()));
|
auto exe_path = utils::process_get_exe_path(getpid());
|
||||||
|
if (utils::get_env_value("SNAP").length() > 0)
|
||||||
|
exe_path = snap_exe_path;
|
||||||
|
|
||||||
|
std::string exec = utils::string_format("%s launch ", exe_path);
|
||||||
|
|
||||||
if (!item.launch_intent.action.empty())
|
if (!item.launch_intent.action.empty())
|
||||||
exec += utils::string_format("--action=%s ", item.launch_intent.action);
|
exec += utils::string_format("--action=%s ", item.launch_intent.action);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue