diff --git a/electron-builder.json b/electron-builder.json index d0aa82c16d..8a9dc99457 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -13,21 +13,30 @@ "node_modules/keytar", "node_modules/sqlite3" ], - "protocols": [{ - "name": "RedisInsight", - "role": "Viewer", - "schemes": ["redisinsight"] - } + "protocols": [ + { + "name": "RedisInsight", + "role": "Viewer", + "schemes": [ + "redisinsight" + ] + } ], "mac": { "target": [ { "target": "dmg", - "arch": ["x64", "arm64"] + "arch": [ + "x64", + "arm64" + ] }, { "target": "zip", - "arch": ["x64", "arm64"] + "arch": [ + "x64", + "arm64" + ] } ], "notarize": { @@ -48,7 +57,9 @@ "entitlementsInherit": "resources/entitlements.mas.inherit.plist", "entitlementsLoginHelper": "resources/entitlements.mas.loginhelper.plist", "hardenedRuntime": false, - "asarUnpack": ["node_modules"], + "asarUnpack": [ + "node_modules" + ], "provisioningProfile": "embedded.provisionprofile", "binaries": [ "Contents/Resources/app-x64.asar.unpacked/node_modules/sqlite3/build/Release/node_sqlite3.node", @@ -64,7 +75,9 @@ "entitlementsInherit": "resources/entitlements.mas.inherit.plist", "entitlementsLoginHelper": "resources/entitlements.mas.loginhelper.plist", "hardenedRuntime": false, - "asarUnpack": ["node_modules"], + "asarUnpack": [ + "node_modules" + ], "provisioningProfile": "dev.provisionprofile", "binaries": [ "Contents/Resources/app-x64.asar.unpacked/node_modules/sqlite3/build/Release/node_sqlite3.node", @@ -89,7 +102,9 @@ ] }, "win": { - "target": ["nsis"], + "target": [ + "nsis" + ], "artifactName": "Redis-Insight-${os}-installer.${ext}", "icon": "resources/icon.ico", "publisherName": [ @@ -107,19 +122,27 @@ "target": [ { "target": "AppImage", - "arch": ["x64"] + "arch": [ + "x64" + ] }, { "target": "deb", - "arch": ["x64"] + "arch": [ + "x64" + ] }, { "target": "rpm", - "arch": ["x64"] + "arch": [ + "x64" + ] }, { "target": "snap", - "arch": ["x64"] + "arch": [ + "x64" + ] } ], "synopsis": "Redis GUI by Redis Ltd.", @@ -131,13 +154,18 @@ "Comment": "Redis GUI by Redis Ltd" } }, + "deb": { + "afterInstall": "scripts/deb-after-install.sh" + }, "snap": { "plugs": [ "default", "password-manager-service" ], "confinement": "strict", - "stagePackages": ["default"] + "stagePackages": [ + "default" + ] }, "flatpak": { "runtimeVersion": "20.08", @@ -151,7 +179,12 @@ "-Dgtk_doc=false", "-Dintrospection=false" ], - "cleanup": ["/bin", "/include", "/lib/pkgconfig", "/share/man"], + "cleanup": [ + "/bin", + "/include", + "/lib/pkgconfig", + "/share/man" + ], "sources": [ { "type": "archive", @@ -184,17 +217,23 @@ { "from": "./redisinsight/api/static", "to": "static", - "filter": ["**/*"] + "filter": [ + "**/*" + ] }, { "from": "./redisinsight/api/defaults", "to": "defaults", - "filter": ["**/*"] + "filter": [ + "**/*" + ] }, { "from": "./redisinsight/api/data", "to": "data", - "filter": ["**/*"] + "filter": [ + "**/*" + ] }, { "from": "LICENSE", @@ -203,7 +242,9 @@ { "from": "./resources/app", "to": "./app", - "filter": ["**/*"] + "filter": [ + "**/*" + ] } ] -} +} \ No newline at end of file diff --git a/scripts/deb-after-install.sh b/scripts/deb-after-install.sh new file mode 100755 index 0000000000..96ec8f9f41 --- /dev/null +++ b/scripts/deb-after-install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -ex + +# Define paths +OLD_INSTALL_PATH="/opt/Redis Insight" # Path with space +NEW_INSTALL_PATH="/opt/redisinsight" # New path without space +DESKTOP_FILE="/usr/share/applications/redisinsight.desktop" + +# Check if old directory exists and rename it +if [ -d "$OLD_INSTALL_PATH" ]; then + echo "Renaming $OLD_INSTALL_PATH to $NEW_INSTALL_PATH" + sudo mv "$OLD_INSTALL_PATH" "$NEW_INSTALL_PATH" +fi + +# Update desktop file to use new path +if [ -f "$DESKTOP_FILE" ]; then + echo "Updating desktop file to use new path" + sudo sed -i "s|$OLD_INSTALL_PATH|$NEW_INSTALL_PATH|g" "$DESKTOP_FILE" +fi + +# Update binary link +sudo ln -sf "$NEW_INSTALL_PATH/redisinsight" "/usr/bin/redisinsight" + +# Set basic executable permissions +sudo chmod +x "$NEW_INSTALL_PATH/redisinsight" + +# Set correct ownership and permissions for chrome-sandbox +sudo chown root:root "$NEW_INSTALL_PATH/chrome-sandbox" +sudo chmod 4755 "$NEW_INSTALL_PATH/chrome-sandbox" + +echo "RedisInsight post-installation setup completed successfully"