From 96895cfe1d46a9b7546c8f7b8727fb369399448a Mon Sep 17 00:00:00 2001 From: develar Date: Tue, 27 Dec 2016 08:46:02 +0100 Subject: [PATCH] fix(appimage): Linux AppImage target doesn't reuse the launcher icon Closes #1003 --- docker/base/Dockerfile | 3 ++- src/targets/LinuxTargetHelper.ts | 9 ++++----- test/src/helpers/expectedContents.ts | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index 304b73944d0..a7140ac9ecc 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -14,9 +14,10 @@ ENV USE_SYSTEM_7ZA true ENV DEBUG_COLORS true ENV FORCE_COLOR true +ENV DEBIAN_FRONTEND noninteractive RUN curl -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv dist yarn && apt-get update -y && apt-get upgrade -y && \ - apt-get install --no-install-recommends -y nodejs git snapcraft qtbase5-dev xorriso bsdtar build-essential autoconf libssl-dev icnsutils graphicsmagick gcc-multilib g++-multilib libgnome-keyring-dev lzip rpm yasm && \ + apt-get install --no-install-recommends -y nodejs git snapcraft qtbase5-dev xorriso bsdtar build-essential autoconf libssl-dev icnsutils jasper graphicsmagick gcc-multilib g++-multilib libgnome-keyring-dev lzip rpm yasm && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ curl -L http://tukaani.org/xz/xz-$XZ_VERSION.tar.xz | tar -xJ && cd xz-$XZ_VERSION && ./configure && make && make install && cd .. && rm -rf xz-$XZ_VERSION && ldconfig && \ mkdir -p /tmp/7z && curl -L http://downloads.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2 | tar -xj -C /tmp/7z --strip-components 1 && cd /tmp/7z && cp makefile.linux_amd64_asm makefile.machine && make && make install && rm -rf /tmp/7z diff --git a/src/targets/LinuxTargetHelper.ts b/src/targets/LinuxTargetHelper.ts index aff715b0c3f..81a71176047 100644 --- a/src/targets/LinuxTargetHelper.ts +++ b/src/targets/LinuxTargetHelper.ts @@ -40,7 +40,7 @@ export class LinuxTargetHelper { const size = parseInt(file!, 10) if (size > 0) { const iconPath = `${iconsDir}/${file}` - mappings.push([iconPath, `${size}x${size}/apps/${this.packager.appInfo.name}.png`]) + mappings.push([iconPath, `${size}x${size}/apps/${this.packager.executableName}.png`]) if (size > maxSize) { maxSize = size @@ -80,8 +80,7 @@ export class LinuxTargetHelper { Exec: exec == null ? `"${installPrefix}/${productFilename}/${this.packager.executableName}"` : exec, Terminal: "false", Type: "Application", - Icon: appInfo.name, - StartupWMClass: `"${productFilename}"`, + Icon: this.packager.executableName, }, extra, platformSpecificBuildOptions.desktop) const category = platformSpecificBuildOptions.category @@ -168,10 +167,10 @@ export class LinuxTargetHelper { } private createMappings(tempDir: string) { - const appName = this.packager.appInfo.name + const name = this.packager.executableName function createMapping(size: string) { - return [process.platform === "darwin" ? `${tempDir}/icon_${size}x${size}.png` : `${tempDir}/icon_${size}x${size}x32.png`, `${size}x${size}/apps/${appName}.png`] + return [process.platform === "darwin" ? `${tempDir}/icon_${size}x${size}.png` : `${tempDir}/icon_${size}x${size}x32.png`, `${size}x${size}/apps/${name}.png`] } return [ diff --git a/test/src/helpers/expectedContents.ts b/test/src/helpers/expectedContents.ts index 875c4b07e66..4a168150507 100755 --- a/test/src/helpers/expectedContents.ts +++ b/test/src/helpers/expectedContents.ts @@ -39,23 +39,23 @@ export const expectedLinuxContents = ["/", "/usr/share/icons/hicolor/64x64/", "/usr/share/icons/hicolor/96x96/", "/usr/share/icons/hicolor/128x128/apps/", - "/usr/share/icons/hicolor/128x128/apps/TestApp.png", + "/usr/share/icons/hicolor/128x128/apps/testapp.png", "/usr/share/icons/hicolor/16x16/apps/", - "/usr/share/icons/hicolor/16x16/apps/TestApp.png", + "/usr/share/icons/hicolor/16x16/apps/testapp.png", "/usr/share/icons/hicolor/24x24/apps/", - "/usr/share/icons/hicolor/24x24/apps/TestApp.png", + "/usr/share/icons/hicolor/24x24/apps/testapp.png", "/usr/share/icons/hicolor/256x256/apps/", - "/usr/share/icons/hicolor/256x256/apps/TestApp.png", + "/usr/share/icons/hicolor/256x256/apps/testapp.png", "/usr/share/icons/hicolor/32x32/apps/", - "/usr/share/icons/hicolor/32x32/apps/TestApp.png", + "/usr/share/icons/hicolor/32x32/apps/testapp.png", "/usr/share/icons/hicolor/48x48/apps/", - "/usr/share/icons/hicolor/48x48/apps/TestApp.png", + "/usr/share/icons/hicolor/48x48/apps/testapp.png", "/usr/share/icons/hicolor/512x512/apps/", - "/usr/share/icons/hicolor/512x512/apps/TestApp.png", + "/usr/share/icons/hicolor/512x512/apps/testapp.png", "/usr/share/icons/hicolor/64x64/apps/", - "/usr/share/icons/hicolor/64x64/apps/TestApp.png", + "/usr/share/icons/hicolor/64x64/apps/testapp.png", "/usr/share/icons/hicolor/96x96/apps/", - "/usr/share/icons/hicolor/96x96/apps/TestApp.png"] + "/usr/share/icons/hicolor/96x96/apps/testapp.png"] //noinspection SpellCheckingInspection export const expectedWinContents = [