20
20
# Brief pause to let processes terminate
21
21
sleep 1
22
22
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
+
23
36
# Handle update case: redisinsight exists, Redis Insight exists too
24
37
# This means that we are in an update scenario
25
38
if [ -d " $NEW_INSTALL_PATH " ] && [ -d " $OLD_INSTALL_PATH " ]; then
@@ -29,11 +42,6 @@ if [ -d "$NEW_INSTALL_PATH" ] && [ -d "$OLD_INSTALL_PATH" ]; then
29
42
30
43
rm -rf " $OLD_INSTALL_PATH " || true
31
44
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
-
37
45
# Ensure binary link and permissions
38
46
ln -sf " $NEW_INSTALL_PATH /redisinsight" " /usr/bin/redisinsight" || true
39
47
if [ -f " $NEW_INSTALL_PATH /redisinsight" ]; then
@@ -74,11 +82,6 @@ if [ ! -d "$NEW_INSTALL_PATH" ] && [ -d "$OLD_INSTALL_PATH" ]; then
74
82
# Simply move the directory
75
83
mv " $OLD_INSTALL_PATH " " $NEW_INSTALL_PATH " || true
76
84
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
-
82
85
# Ensure binary link and permissions
83
86
ln -sf " $NEW_INSTALL_PATH /redisinsight" " /usr/bin/redisinsight" || true
84
87
if [ -f " $NEW_INSTALL_PATH /redisinsight" ]; then
0 commit comments