@@ -19,62 +19,22 @@ if [ -f "$DESKTOP_FILE" ]; then
19
19
sudo sed -i " s|$OLD_INSTALL_PATH |$NEW_INSTALL_PATH |g" " $DESKTOP_FILE "
20
20
fi
21
21
22
+ # Create the simplest possible launcher script
22
23
sudo tee /usr/bin/redisinsight > /dev/null << 'EOF '
23
24
#!/bin/bash
24
25
25
- # Log file for debugging
26
- LOG_FILE="/tmp/redisinsight-launcher.log"
26
+ cd "/opt/Redis Insight" || exit 1
27
27
28
- # Find the real binary
29
- INSTALL_DIR="/opt/Redis Insight"
30
-
31
- # Function to write to log
32
- log() {
33
- echo "$(date): $1" >> "$LOG_FILE"
34
- }
35
-
36
- # Start with a clean log
37
- echo "$(date): Launcher started" > "$LOG_FILE"
38
- log "Args: $@"
39
-
40
- # Check if the original redisinsight is a script or binary
41
- file_type=$(file -b "$INSTALL_DIR/redisinsight" 2>/dev/null)
42
- log "File type: $file_type"
43
-
44
- # Detect Electron apps
45
- if [ -f "$INSTALL_DIR/resources/electron" ]; then
46
- ELECTRON_PATH="$INSTALL_DIR/resources/electron"
47
- log "Found Electron at: $ELECTRON_PATH"
48
-
49
- if [ -d "$INSTALL_DIR/resources/app" ]; then
50
- APP_PATH="$INSTALL_DIR/resources/app"
51
- log "Found app directory at: $APP_PATH"
52
- cd "$INSTALL_DIR" && exec "$ELECTRON_PATH" "$APP_PATH" "$@"
53
- exit $?
54
- else
55
- log "No app directory found, executing electron directly"
56
- cd "$INSTALL_DIR" && exec "$ELECTRON_PATH" "$@"
57
- exit $?
58
- fi
59
- elif [ -f "$INSTALL_DIR/redisinsight" ]; then
60
- # Execute the original but avoid PATH search
61
- log "Executing original binary with absolute path"
62
- cd "$INSTALL_DIR" && exec ./redisinsight.real "$@"
63
- exit $?
64
- else
65
- log "ERROR: Could not find executable"
66
- echo "Error: Could not find RedisInsight executable" >&2
67
- exit 1
68
- fi
28
+ echo "Launching RedisInsight with args: $@"
29
+ ./redisinsight "$@"
69
30
EOF
70
31
71
32
# Make the launcher script executable
72
33
sudo chmod +x /usr/bin/redisinsight
73
34
74
- # Rename the original to avoid name collision in PATH
35
+ # Ensure the original is executable
75
36
if [ -f " $OLD_INSTALL_PATH /redisinsight" ]; then
76
- sudo mv " $OLD_INSTALL_PATH /redisinsight" " $OLD_INSTALL_PATH /redisinsight.real"
77
- sudo chmod +x " $OLD_INSTALL_PATH /redisinsight.real"
37
+ sudo chmod +x " $OLD_INSTALL_PATH /redisinsight"
78
38
fi
79
39
80
40
# Set correct ownership and permissions for chrome-sandbox (on the original location)
0 commit comments