Fix Windows packaging when signing isn't provided, update app icon on Windows (#1055)

This adds a new app icon for windows that is less Mac-like and it also
fixes a bug in the electron-builder.config.cjs file which would cause
the packaging step to crash if it was missing the signing env vars,
rather than just not signing the package.


![image](https://github.com/user-attachments/assets/fe433ae5-0b88-49a9-91b6-d1083460b7b2)
This commit is contained in:
Evan Simkowitz 2024-10-17 14:27:15 -07:00 committed by GitHub
parent 7628e667ca
commit fae06600cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 28 additions and 7 deletions

BIN
assets/appicon-windows.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,20 @@
<svg width="1024" height="727" viewBox="0 0 1024 727" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M328.87 332.526C280.49 332.526 253.744 364.034 239.191 434.533L20.5 403.025C47.2464 172.231 136.925 60.3787 314.317 60.3787C445.688 60.3787 574.307 160.022 637.24 160.022C686.012 160.022 712.365 126.151 726.918 58.0156L945.609 89.5233C921.223 320.711 829.184 432.563 651.793 432.563C518.454 432.17 394.556 332.526 328.87 332.526Z"
fill="url(#paint0_linear_1814_3217)" />
<path
d="M390.87 558.061C342.49 558.061 315.744 589.569 301.191 660.067L82.5 628.559C109.246 397.765 198.925 285.519 376.317 285.519C507.295 285.519 636.307 385.162 699.239 385.162C748.012 385.162 774.365 351.292 788.918 283.156L1007.61 314.664C983.223 545.852 891.184 657.704 713.793 657.704C580.454 657.704 456.556 558.061 390.87 558.061Z"
fill="url(#paint1_linear_1814_3217)" />
<defs>
<linearGradient id="paint0_linear_1814_3217" x1="20.5503" y1="246.309" x2="945.797" y2="246.309"
gradientUnits="userSpaceOnUse">
<stop offset="0.1418" stop-color="#1F4D22" />
<stop offset="0.8656" stop-color="#418D31" />
</linearGradient>
<linearGradient id="paint1_linear_1814_3217" x1="82.5673" y1="471.774" x2="1007.81" y2="471.774"
gradientUnits="userSpaceOnUse">
<stop offset="0.2223" stop-color="#418D31" />
<stop offset="0.7733" stop-color="#58C142" />
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 295 KiB

View File

@ -3,6 +3,8 @@ const pkg = require("./package.json");
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const windowsShouldSign = !!process.env.SM_CODE_SIGNING_CERT_SHA1_HASH;
/** /**
* @type {import('electron-builder').Configuration} * @type {import('electron-builder').Configuration}
* @see https://www.electron.build/configuration/configuration * @see https://www.electron.build/configuration/configuration
@ -47,7 +49,6 @@ const config = {
arch: ["universal", "arm64", "x64"], arch: ["universal", "arm64", "x64"],
}, },
], ],
icon: "build/icons.icns",
category: "public.app-category.developer-tools", category: "public.app-category.developer-tools",
minimumSystemVersion: "10.15.0", minimumSystemVersion: "10.15.0",
mergeASARs: true, mergeASARs: true,
@ -57,7 +58,6 @@ const config = {
artifactName: "${name}-${platform}-${arch}-${version}.${ext}", artifactName: "${name}-${platform}-${arch}-${version}.${ext}",
category: "TerminalEmulator", category: "TerminalEmulator",
executableName: pkg.name, executableName: pkg.name,
icon: "build/icons.icns",
target: ["zip", "deb", "rpm", "AppImage", "pacman"], target: ["zip", "deb", "rpm", "AppImage", "pacman"],
synopsis: pkg.description, synopsis: pkg.description,
description: null, description: null,
@ -73,12 +73,13 @@ const config = {
afterInstall: "build/deb-postinstall.tpl", afterInstall: "build/deb-postinstall.tpl",
}, },
win: { win: {
icon: "build/icons.icns",
publisherName: "Command Line Inc",
target: ["nsis", "msi", "zip"], target: ["nsis", "msi", "zip"],
signtoolOptions: windowsShouldSign && {
signingHashAlgorithms: ["sha256"],
publisherName: "Command Line Inc",
certificateSubjectName: "Command Line Inc", certificateSubjectName: "Command Line Inc",
certificateSha1: process.env.SM_CODE_SIGNING_CERT_SHA1_HASH, certificateSha1: process.env.SM_CODE_SIGNING_CERT_SHA1_HASH,
signingHashAlgorithms: ["sha256"], },
}, },
appImage: { appImage: {
license: "LICENSE", license: "LICENSE",