Skip to content

Commit ae03bd5

Browse files
author
KIvanow
committed
RI-6690 executible fix
1 parent d44b1f4 commit ae03bd5

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

scripts/deb-after-install.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ done
2020
# Brief pause to let processes terminate
2121
sleep 1
2222

23+
if [ -f "$DESKTOP_FILE" ]; then
24+
echo "Updating desktop file for launcher compatibility..."
25+
26+
# First replace the old path with the new path throughout the file
27+
sed -i "s|$OLD_INSTALL_PATH|$NEW_INSTALL_PATH|g" "$DESKTOP_FILE" || true
28+
29+
# Then ensure the Exec line is properly formatted without quotes
30+
sed -i "s|^Exec=.*|Exec=$NEW_INSTALL_PATH/redisinsight %U|g" "$DESKTOP_FILE" || true
31+
32+
# Update desktop database to refresh the icon
33+
update-desktop-database 2>/dev/null || true
34+
fi
35+
2336
# Handle update case: redisinsight exists, Redis Insight exists too
2437
# This means that we are in an update scenario
2538
if [ -d "$NEW_INSTALL_PATH" ] && [ -d "$OLD_INSTALL_PATH" ]; then
@@ -29,11 +42,6 @@ if [ -d "$NEW_INSTALL_PATH" ] && [ -d "$OLD_INSTALL_PATH" ]; then
2942

3043
rm -rf "$OLD_INSTALL_PATH" || true
3144

32-
if [ -f "$DESKTOP_FILE" ]; then
33-
echo "Updating desktop file reference"
34-
sed -i "s|$OLD_INSTALL_PATH|$NEW_INSTALL_PATH|g" "$DESKTOP_FILE" || true
35-
fi
36-
3745
# Ensure binary link and permissions
3846
ln -sf "$NEW_INSTALL_PATH/redisinsight" "/usr/bin/redisinsight" || true
3947
if [ -f "$NEW_INSTALL_PATH/redisinsight" ]; then
@@ -74,11 +82,6 @@ if [ ! -d "$NEW_INSTALL_PATH" ] && [ -d "$OLD_INSTALL_PATH" ]; then
7482
# Simply move the directory
7583
mv "$OLD_INSTALL_PATH" "$NEW_INSTALL_PATH" || true
7684

77-
if [ -f "$DESKTOP_FILE" ]; then
78-
echo "Updating desktop file reference"
79-
sed -i "s|$OLD_INSTALL_PATH|$NEW_INSTALL_PATH|g" "$DESKTOP_FILE" || true
80-
fi
81-
8285
# Ensure binary link and permissions
8386
ln -sf "$NEW_INSTALL_PATH/redisinsight" "/usr/bin/redisinsight" || true
8487
if [ -f "$NEW_INSTALL_PATH/redisinsight" ]; then

0 commit comments

Comments
 (0)