fix tray logo

This commit is contained in:
HorizonCode 2023-06-02 12:42:12 +02:00
parent f5287b6378
commit 769a88521e
4 changed files with 350 additions and 342 deletions

14
app.js
View File

@ -5,11 +5,13 @@ const osuUtil = require('./osuUtil');
const ezppUtil = require('./ezppUtil');
const config = require('./config');
const fs = require('fs');
const path = require('path');
const rpc = require('./discordPresence');
const windowName = require('get-window-by-name');
const terminalUtil = require('./terminalUtil');
const osUtil = require('./osUtil');
const appInfo = require('./appInfo');
const { DownloaderHelper } = require('node-downloader-helper');
let tempOsuPath;
let osuWindowInfo;
@ -121,9 +123,15 @@ const run = () => {
let mainWindow;
let tray = null
app.whenReady().then(() => {
tray = new Tray('./assets/logo.png');
app.whenReady().then(async () => {
const logoFile = path.join(config.configFolder, "logo.png");
if (!fs.existsSync(logoFile)) {
const logoDownload = new DownloaderHelper("https://ez-pp.farm/assets/img/icon.png", config.configFolder, {
fileName: "logo.png",
})
await logoDownload.start();
}
tray = new Tray(logoFile);
const trayMenuTemplate = [
{
label: `EZPPLauncher ${appInfo.appVersion}`,

View File

@ -2,7 +2,7 @@ const { default: axios } = require("axios");
const { compareVersions } = require("compare-versions");
const appName = "EZPPLauncher"
const appVersion = "1.1.3-f1";
const appVersion = "1.1.4";
const hasUpdate = async () => {
const releaseInfo = await axios.get(`https://git.ez-pp.farm/api/v1/repos/EZPPFarm/${appName}/releases/latest`);

View File

@ -68,4 +68,4 @@ async function remove(key) {
await fs.promises.writeFile(configLocation, arr.join('\n'));
}
module.exports = { get, set, remove }
module.exports = { get, set, remove, configFolder }

View File

@ -1,6 +1,6 @@
{
"name": "ezpplauncher",
"version": "1.1.3",
"version": "1.1.4",
"main": "app.js",
"license": "MIT",
"author": "HorizonCode",