diff --git a/.idea/dictionaries/develar.xml b/.idea/dictionaries/develar.xml index 7b29b2807f9..e9853439a1f 100644 --- a/.idea/dictionaries/develar.xml +++ b/.idea/dictionaries/develar.xml @@ -3,6 +3,7 @@ actperepo addincludedir + appdir appimage appleid appveyor diff --git a/package.json b/package.json index bdc208f1c17..b22e58a6eb0 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ ] }, "devDependencies": { - "@develar/semantic-release": "^6.3.5", + "@develar/semantic-release": "^6.3.6", "@types/debug": "0.0.28", "@types/mime": "0.0.28", "@types/progress": "^1.1.27", diff --git a/src/targets/appImage.ts b/src/targets/appImage.ts index f7703c670e8..f3fca199af9 100644 --- a/src/targets/appImage.ts +++ b/src/targets/appImage.ts @@ -34,15 +34,19 @@ export default class AppImageTarget extends TargetEx { await unlinkIfExists(image) const appImagePath = await appImagePathPromise + const appExecutableImagePath = `/usr/bin/${appInfo.name}` const args = [ "-joliet", "on", "-volid", "AppImage", "-dev", image, "-padding", "0", "-map", appOutDir, "/usr/bin", - "-map", path.join(__dirname, "..", "..", "templates", "linux", "AppRun.sh"), `/AppRun`, + "-map", path.join(__dirname, "..", "..", "templates", "linux", "AppRun.sh"), "/AppRun", "-map", await this.desktopEntry, `/${appInfo.name}.desktop`, - "-move", `/usr/bin/${appInfo.productFilename}`, `/usr/bin/${appInfo.name}`, + "-move", `/usr/bin/${appInfo.productFilename}`, appExecutableImagePath, + // http://stackoverflow.com/questions/13633488/can-i-store-unix-permissions-in-a-zip-file-built-with-apache-ant, xorriso doesn't preserve it for zip, but we set it in any case + "-chmod", "+x", appExecutableImagePath, "--", + "-chmod", "+x", "/AppRun", appExecutableImagePath, "--", ] for (let [from, to] of (await this.helper.icons)) { args.push("-map", from, `/usr/share/icons/default/${to}`) diff --git a/templates/linux/AppRun.sh b/templates/linux/AppRun.sh index 19300f2f0ea..e043616983f 100755 --- a/templates/linux/AppRun.sh +++ b/templates/linux/AppRun.sh @@ -2,6 +2,10 @@ set -e +if [ -z "$APPDIR" ] ; then + APPDIR=$(dirname $(readlink -f "${0}")) +fi + echo "$APPDIR" THIS="$0" @@ -170,9 +174,9 @@ if [ -z "$SKIP" ] ; then # and to /usr/share/applications if run as root # but that does not really work for me... desktop-file-install --rebuild-mime-info-cache \ - --vendor=$VENDORPREFIX --set-key=Exec --set-value="$APPIMAGE %U" \ + --vendor=$VENDORPREFIX --set-key=Exec --set-value="\"${APPIMAGE}\" %U" \ --set-key=X-AppImage-Comment --set-value="Generated by ${THIS}" \ - --set-icon="$VENDORPREFIX-$APP" --set-key=TryExec --set-value="$APPIMAGE" "$DESKTOP_FILE" \ + --set-icon="$VENDORPREFIX-$APP" --set-key=TryExec --set-value=${APPIMAGE// /\\s} "$DESKTOP_FILE" \ --dir "$DESTINATION_DIR_DESKTOP" chmod a+x "$DESTINATION_DIR_DESKTOP/"* RESOURCE_NAME=$(echo "$VENDORPREFIX-$DESKTOP_FILE_NAME" | sed -e 's/.desktop//g')