Skip to content

Commit

Permalink
fix(appimage): Linux AppImage target doesn't reuse the launcher icon
Browse files Browse the repository at this point in the history
Closes #1003
  • Loading branch information
develar committed Dec 27, 2016
1 parent 03e43d1 commit 96895cf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions src/targets/LinuxTargetHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 [
Expand Down
18 changes: 9 additions & 9 deletions test/src/helpers/expectedContents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 96895cf

Please sign in to comment.