Simplify the number of icons (#2497)
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
@@ -82,13 +82,7 @@ const config: Omit<Writable<Configuration>, "electronFuses"> & {
|
||||
},
|
||||
"lib/**",
|
||||
],
|
||||
extraResources: [
|
||||
{
|
||||
from: "res/img",
|
||||
to: "img",
|
||||
},
|
||||
"webapp.asar",
|
||||
],
|
||||
extraResources: ["build/icon.*", "webapp.asar"],
|
||||
extraMetadata: {
|
||||
name: pkg.name,
|
||||
productName: pkg.productName,
|
||||
@@ -99,7 +93,7 @@ const config: Omit<Writable<Configuration>, "electronFuses"> & {
|
||||
linux: {
|
||||
target: ["tar.gz", "deb"],
|
||||
category: "Network;InstantMessaging;Chat",
|
||||
icon: "build/icons",
|
||||
icon: "build/icon.png",
|
||||
executableName: pkg.name, // element-desktop or element-desktop-nightly
|
||||
},
|
||||
deb: {
|
||||
@@ -128,7 +122,7 @@ const config: Omit<Writable<Configuration>, "electronFuses"> & {
|
||||
// XXX: we cannot specify this due to https://github.com/electron/osx-sign/issues/344
|
||||
// strictVerify: true,
|
||||
entitlements: "./build/entitlements.mac.plist",
|
||||
icon: "build/icons/icon.icns",
|
||||
icon: "build/icon.icns",
|
||||
mergeASARs: true,
|
||||
x64ArchFiles: "**/matrix-seshat/*.node", // hak already runs lipo
|
||||
},
|
||||
@@ -137,7 +131,7 @@ const config: Omit<Writable<Configuration>, "electronFuses"> & {
|
||||
signtoolOptions: {
|
||||
signingHashAlgorithms: ["sha256"],
|
||||
},
|
||||
icon: "build/icons/icon.ico",
|
||||
icon: "build/icon.ico",
|
||||
},
|
||||
msi: {
|
||||
perMachine: true,
|
||||
|
||||
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
@@ -233,19 +233,10 @@ async function setupGlobals(): Promise<void> {
|
||||
const asarPath = await getAsarPath();
|
||||
await loadConfig();
|
||||
|
||||
// we assume the resources path is in the same place as the asar
|
||||
const resPath = await tryPaths("res", path.dirname(asarPath), [
|
||||
// If run from the source checkout
|
||||
"res",
|
||||
// if run from packaged application
|
||||
"",
|
||||
]);
|
||||
|
||||
// The tray icon
|
||||
// It's important to call `path.join` so we don't end up with the packaged asar in the final path.
|
||||
const iconFile = `element.${process.platform === "win32" ? "ico" : "png"}`;
|
||||
// Figure out the tray icon path & brand name
|
||||
const iconFile = `icon.${process.platform === "win32" ? "ico" : "png"}`;
|
||||
global.trayConfig = {
|
||||
icon_path: path.join(resPath, "img", iconFile),
|
||||
icon_path: path.join(path.dirname(asarPath), "build", iconFile),
|
||||
brand: global.vectorConfig.brand || "Element",
|
||||
};
|
||||
|
||||
|
||||
@@ -38,18 +38,13 @@ function toggleWin(): void {
|
||||
}
|
||||
}
|
||||
|
||||
interface IConfig {
|
||||
icon_path: string; // eslint-disable-line camelcase
|
||||
brand: string;
|
||||
}
|
||||
|
||||
function getUuid(): string {
|
||||
// The uuid field is optional and only needed on unsigned Windows packages where the executable path changes
|
||||
// The hardcoded uuid is an arbitrary v4 uuid generated on https://www.uuidgenerator.net/version4
|
||||
return global.vectorConfig["uuid"] || "eba84003-e499-4563-8e9d-166e34b5cc25";
|
||||
}
|
||||
|
||||
export function create(config: IConfig): void {
|
||||
export function create(config: (typeof global)["trayConfig"]): void {
|
||||
// no trays on darwin
|
||||
if (process.platform === "darwin" || trayIcon) return;
|
||||
const defaultIcon = nativeImage.createFromPath(config.icon_path);
|
||||
|
||||