diff --git a/xdgurl.AppDir/desktopintegration b/xdgurl.AppDir/desktopintegration
index 020c8e6e1c53ed40320304521dff3a39f02bc7f9..0f9ba87ceffb72249cb17898feb7d1382fe2bcb8 100644
--- a/xdgurl.AppDir/desktopintegration
+++ b/xdgurl.AppDir/desktopintegration
@@ -104,7 +104,7 @@ check_dep()
   fi
 }
 
-DIRNAME=$(dirname $FILENAME)
+DIRNAME="$APPDIR"
 
 # Check whether dependencies are present in base system (we do not bundle these)
 # http://cgit.freedesktop.org/xdg/desktop-file-utils/