Skip to content

[bug] AppImage .DirIcon and .desktop symlinks use absolute paths, break when mounted #15110

Closed

Description

@VirenMohindra

Describe the bug

The AppImage bundler creates .DirIcon and the root .desktop symlinks using absolute paths that point to the build machine's filesystem. When the AppImage is packed into SquashFS and mounted at runtime (e.g. /tmp/.mount_AppXXXXXX/), these symlinks are dangling because the original build path doesn't exist on the user's machine.

In crates/tauri-bundler/src/bundle/linux/appimage/linuxdeploy.rs lines 174-180:

// .DirIcon — absolute symlink (broken)
std::os::unix::fs::symlink(
    app_dir_path.join(format!("{product_name}.png")),
    app_dir_path.join(".DirIcon"),
)?;

// .desktop — absolute symlink (broken)
std::os::unix::fs::symlink(
    app_dir_path.join(format!("usr/share/applications/{product_name}.desktop")),
    app_dir_path.join(format!("{product_name}.desktop")),
)?;

app_dir_path.join(...) produces an absolute path like /home/runner/work/.../bundle/appimage/App.AppDir/App.png. This gets baked into the symlink target, which doesn't resolve when mounted.

Reproduction

  1. Build any Tauri 2.x app as AppImage on Linux
  2. Extract the AppImage: ./App.AppImage --appimage-extract
  3. Inspect the symlinks:
    ls -la squashfs-root/.DirIcon
    ls -la squashfs-root/App.desktop
  4. Both point to absolute build-machine paths that don't exist

Expected behavior

Symlinks should use relative paths:

// .DirIcon — relative symlink (correct)
std::os::unix::fs::symlink(
    format!("{product_name}.png"),
    app_dir_path.join(".DirIcon"),
)?;

// .desktop — relative symlink (correct)
std::os::unix::fs::symlink(
    format!("usr/share/applications/{product_name}.desktop"),
    app_dir_path.join(format!("{product_name}.desktop")),
)?;

This matches the AppDir specification which expects .DirIcon to resolve within the mounted AppDir.

Full tauri info output

[✔] Environment
    - OS: Mac OS 26.2.0 arm64 (X64)
    ✔ rustc: 1.92.0 (ded5c06cf 2025-12-08)
    ✔ cargo: 1.92.0 (344c4567c 2025-10-21)

[-] Packages
    - tauri 🦀: 2.10.2
    - tauri-build 🦀: 2.5.5
    - wry 🦀: 0.54.2
    - tao 🦀: 0.34.5

Note: bug is in the bundler source, reproducible on any version. Confirmed present on latest main branch.

Additional context

  • Reported downstream: [BUG] AppImage .DirIcon broken cjpais/Handy#895
  • Affects all Tauri 2.x AppImage builds on Linux
  • The icon files themselves are valid — only the symlink targets are wrong
  • The fix is a 2-line change in linuxdeploy.rs — happy to open a PR if desired

Activity

  1. yangtzech commented on Jun 28, 2026

    @yangtzech

    Hi, we're hitting this same issue — AppImage built on CI has broken .DirIcon and .desktop symlinks pointing to absolute build-machine paths (/home/runner/work/...). This causes installation failures on user machines (e.g. via AppManager).

    A few questions on the current status:

    1. Is a fix for this already in progress, or is the PR from the original reporter still pending?
    2. If no PR exists yet, would a contribution be welcome? The fix in linuxdeploy.rs looks straightforward (switching app_dir_path.join(...) to relative paths).
    3. Are there any known workarounds beyond post-build extraction and relinking?

    Appreciate the maintainers' time on this — thanks!

  2. FabianLars commented on Jun 28, 2026

    @FabianLars
    Member

    I'll fix it myself today or so. I don't think i can deal with a single more AI generated PR for this one line fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions