Skip to content

Commit b9e11a8

Browse files
fix(bundler): AppImage startup crash (#10036)
* Update appimage * Update appimage.rs * changefile --------- Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
1 parent f44a2ec commit b9e11a8

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": "patch:bug"
3+
---
4+
5+
Fixed an issue that caused the AppImage to segfault on start due to an incorrect .desktop file.

tooling/bundler/src/bundle/linux/appimage.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,10 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
5252
let appimage_path = output_path.join(&appimage_filename);
5353
path_utils::create(app_dir_path, true)?;
5454

55-
let upcase_app_name = settings.product_name().to_uppercase();
56-
5755
// setup data to insert into shell script
5856
let mut sh_map = BTreeMap::new();
5957
sh_map.insert("arch", settings.target().split('-').next().unwrap());
60-
sh_map.insert("app_name", settings.product_name());
61-
sh_map.insert("app_name_uppercase", &upcase_app_name);
58+
sh_map.insert("crate_name", settings.main_binary_name());
6259
sh_map.insert("appimage_filename", &appimage_filename);
6360
let tauri_tools_path = dirs::cache_dir().map_or_else(
6461
|| output_path.to_path_buf(),

tooling/bundler/src/bundle/linux/templates/appimage

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ else
1717
linuxdeploy_arch="$ARCH"
1818
fi
1919

20-
mkdir -p "{{app_name}}.AppDir"
21-
cp -r ../appimage_deb/data/usr "{{app_name}}.AppDir"
20+
mkdir -p "{{crate_name}}.AppDir"
21+
cp -r ../appimage_deb/data/usr "{{crate_name}}.AppDir"
2222

23-
cd "{{app_name}}.AppDir"
23+
cd "{{crate_name}}.AppDir"
2424
mkdir -p "usr/bin"
2525
mkdir -p "usr/lib"
2626

@@ -56,14 +56,14 @@ find -L /usr/lib* -name libwebkit2gtkinjectedbundle.so -exec mkdir -p "$(dirname
5656
( cd "{{tauri_tools_path}}" && ( wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH} || wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH} ) )
5757
chmod +x "{{tauri_tools_path}}/AppRun-${ARCH}"
5858

59-
# We need AppRun to be installed as {{app_name}}.AppDir/AppRun.
59+
# We need AppRun to be installed as {{crate_name}}.AppDir/AppRun.
6060
# Otherwise the linuxdeploy scripts will default to symlinking our main bin instead and will crash on trying to launch.
6161
cp "{{tauri_tools_path}}/AppRun-${ARCH}" AppRun
6262

6363
cp "{{icon_path}}" .DirIcon
64-
ln -sf "{{icon_path}}" "{{app_name}}.png"
64+
ln -sf "{{icon_path}}" "{{crate_name}}.png"
6565

66-
ln -sf "usr/share/applications/{{app_name}}.desktop" "{{app_name}}.desktop"
66+
ln -sf "usr/share/applications/{{crate_name}}.desktop" "{{crate_name}}.desktop"
6767

6868
cd ..
6969

@@ -83,4 +83,4 @@ chmod +x "{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage"
8383

8484
dd if=/dev/zero bs=1 count=3 seek=8 conv=notrunc of="{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage"
8585

86-
OUTPUT="{{appimage_filename}}" "{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage" --appimage-extract-and-run --appdir "{{app_name}}.AppDir" --plugin gtk ${gst_plugin} --output appimage
86+
OUTPUT="{{appimage_filename}}" "{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage" --appimage-extract-and-run --appdir "{{crate_name}}.AppDir" --plugin gtk ${gst_plugin} --output appimage

0 commit comments

Comments
 (0)