fix tray logo
This commit is contained in:
parent
f5287b6378
commit
769a88521e
14
app.js
14
app.js
|
@ -5,11 +5,13 @@ const osuUtil = require('./osuUtil');
|
||||||
const ezppUtil = require('./ezppUtil');
|
const ezppUtil = require('./ezppUtil');
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
const rpc = require('./discordPresence');
|
const rpc = require('./discordPresence');
|
||||||
const windowName = require('get-window-by-name');
|
const windowName = require('get-window-by-name');
|
||||||
const terminalUtil = require('./terminalUtil');
|
const terminalUtil = require('./terminalUtil');
|
||||||
const osUtil = require('./osUtil');
|
const osUtil = require('./osUtil');
|
||||||
const appInfo = require('./appInfo');
|
const appInfo = require('./appInfo');
|
||||||
|
const { DownloaderHelper } = require('node-downloader-helper');
|
||||||
|
|
||||||
let tempOsuPath;
|
let tempOsuPath;
|
||||||
let osuWindowInfo;
|
let osuWindowInfo;
|
||||||
|
@ -121,9 +123,15 @@ const run = () => {
|
||||||
|
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
let tray = null
|
let tray = null
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(async () => {
|
||||||
|
const logoFile = path.join(config.configFolder, "logo.png");
|
||||||
tray = new Tray('./assets/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 = [
|
const trayMenuTemplate = [
|
||||||
{
|
{
|
||||||
label: `EZPPLauncher ${appInfo.appVersion}`,
|
label: `EZPPLauncher ${appInfo.appVersion}`,
|
||||||
|
|
|
@ -2,7 +2,7 @@ const { default: axios } = require("axios");
|
||||||
const { compareVersions } = require("compare-versions");
|
const { compareVersions } = require("compare-versions");
|
||||||
|
|
||||||
const appName = "EZPPLauncher"
|
const appName = "EZPPLauncher"
|
||||||
const appVersion = "1.1.3-f1";
|
const appVersion = "1.1.4";
|
||||||
|
|
||||||
const hasUpdate = async () => {
|
const hasUpdate = async () => {
|
||||||
const releaseInfo = await axios.get(`https://git.ez-pp.farm/api/v1/repos/EZPPFarm/${appName}/releases/latest`);
|
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'));
|
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",
|
"name": "ezpplauncher",
|
||||||
"version": "1.1.3",
|
"version": "1.1.4",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "HorizonCode",
|
"author": "HorizonCode",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user