From 18fe4375d4a55ac3ef90b88adc06b44aab530d4e Mon Sep 17 00:00:00 2001 From: xarkes Date: Mon, 23 Oct 2017 23:54:35 +0200 Subject: [PATCH] Fix AppImage share path --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a86e6d4d..981679a5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,15 +16,16 @@ void set_appimage_symlink(char* argv0) { - char* path = strdup(argv0); + char* path = realpath("/proc/self/exe", NULL); char* i = strrchr(path, '/'); *(i+1) = '\0'; - char* dest = strcat(path, "usr/"); + char* dest = strcat(path, "../"); struct stat buf; if (lstat(PREFIX, &buf) == 0 && S_ISLNK(buf.st_mode)) { remove(PREFIX); } symlink(dest, PREFIX); + printf("'%s' '%s' '%s'\n", path, i, dest); free(path); } #endif