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/**",
|
"lib/**",
|
||||||
],
|
],
|
||||||
extraResources: [
|
extraResources: ["build/icon.*", "webapp.asar"],
|
||||||
{
|
|
||||||
from: "res/img",
|
|
||||||
to: "img",
|
|
||||||
},
|
|
||||||
"webapp.asar",
|
|
||||||
],
|
|
||||||
extraMetadata: {
|
extraMetadata: {
|
||||||
name: pkg.name,
|
name: pkg.name,
|
||||||
productName: pkg.productName,
|
productName: pkg.productName,
|
||||||
@@ -99,7 +93,7 @@ const config: Omit<Writable<Configuration>, "electronFuses"> & {
|
|||||||
linux: {
|
linux: {
|
||||||
target: ["tar.gz", "deb"],
|
target: ["tar.gz", "deb"],
|
||||||
category: "Network;InstantMessaging;Chat",
|
category: "Network;InstantMessaging;Chat",
|
||||||
icon: "build/icons",
|
icon: "build/icon.png",
|
||||||
executableName: pkg.name, // element-desktop or element-desktop-nightly
|
executableName: pkg.name, // element-desktop or element-desktop-nightly
|
||||||
},
|
},
|
||||||
deb: {
|
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
|
// XXX: we cannot specify this due to https://github.com/electron/osx-sign/issues/344
|
||||||
// strictVerify: true,
|
// strictVerify: true,
|
||||||
entitlements: "./build/entitlements.mac.plist",
|
entitlements: "./build/entitlements.mac.plist",
|
||||||
icon: "build/icons/icon.icns",
|
icon: "build/icon.icns",
|
||||||
mergeASARs: true,
|
mergeASARs: true,
|
||||||
x64ArchFiles: "**/matrix-seshat/*.node", // hak already runs lipo
|
x64ArchFiles: "**/matrix-seshat/*.node", // hak already runs lipo
|
||||||
},
|
},
|
||||||
@@ -137,7 +131,7 @@ const config: Omit<Writable<Configuration>, "electronFuses"> & {
|
|||||||
signtoolOptions: {
|
signtoolOptions: {
|
||||||
signingHashAlgorithms: ["sha256"],
|
signingHashAlgorithms: ["sha256"],
|
||||||
},
|
},
|
||||||
icon: "build/icons/icon.ico",
|
icon: "build/icon.ico",
|
||||||
},
|
},
|
||||||
msi: {
|
msi: {
|
||||||
perMachine: true,
|
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();
|
const asarPath = await getAsarPath();
|
||||||
await loadConfig();
|
await loadConfig();
|
||||||
|
|
||||||
// we assume the resources path is in the same place as the asar
|
// Figure out the tray icon path & brand name
|
||||||
const resPath = await tryPaths("res", path.dirname(asarPath), [
|
const iconFile = `icon.${process.platform === "win32" ? "ico" : "png"}`;
|
||||||
// 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"}`;
|
|
||||||
global.trayConfig = {
|
global.trayConfig = {
|
||||||
icon_path: path.join(resPath, "img", iconFile),
|
icon_path: path.join(path.dirname(asarPath), "build", iconFile),
|
||||||
brand: global.vectorConfig.brand || "Element",
|
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 {
|
function getUuid(): string {
|
||||||
// The uuid field is optional and only needed on unsigned Windows packages where the executable path changes
|
// 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
|
// The hardcoded uuid is an arbitrary v4 uuid generated on https://www.uuidgenerator.net/version4
|
||||||
return global.vectorConfig["uuid"] || "eba84003-e499-4563-8e9d-166e34b5cc25";
|
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
|
// no trays on darwin
|
||||||
if (process.platform === "darwin" || trayIcon) return;
|
if (process.platform === "darwin" || trayIcon) return;
|
||||||
const defaultIcon = nativeImage.createFromPath(config.icon_path);
|
const defaultIcon = nativeImage.createFromPath(config.icon_path);
|
||||||
|
|||||||