fix tray logo
This commit is contained in:
parent
f5287b6378
commit
769a88521e
16
app.js
16
app.js
|
@ -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}`,
|
||||
|
@ -329,7 +337,7 @@ async function tryLogin(window) {
|
|||
}
|
||||
|
||||
const checkUpdate = await appInfo.hasUpdate();
|
||||
if(checkUpdate){
|
||||
if (checkUpdate) {
|
||||
window.webContents.send('launcher_update', checkUpdate);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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`);
|
||||
|
|
|
@ -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 }
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ezpplauncher",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"main": "app.js",
|
||||
"license": "MIT",
|
||||
"author": "HorizonCode",
|
||||
|
|
Loading…
Reference in New Issue
Block a user