From 5f36de6697b6ea2807fe6a9d149c0e19dc6d526e Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Sun, 16 Oct 2022 23:16:05 +0200 Subject: [PATCH] add appInfo --- .gitignore | 1 + appInfo.js | 4 ++++ preload/preload.js | 3 ++- ui/windowManager.js | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 appInfo.js diff --git a/.gitignore b/.gitignore index 167ab9f..3e8acf0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ +release/ yarn.lock \ No newline at end of file diff --git a/appInfo.js b/appInfo.js new file mode 100644 index 0000000..072057d --- /dev/null +++ b/appInfo.js @@ -0,0 +1,4 @@ +const appName = "EZPPLauncher" +const appVersion = "1.0.0"; + +module.exports = { appName, appVersion }; \ No newline at end of file diff --git a/preload/preload.js b/preload/preload.js index d2a9c49..240c164 100644 --- a/preload/preload.js +++ b/preload/preload.js @@ -1,5 +1,6 @@ const { ipcRenderer } = require('electron'); const { Titlebar, Color } = require('custom-electron-titlebar'); +const appInfo = require('../appInfo'); let titlebar; window.addEventListener('DOMContentLoaded', () => { @@ -10,7 +11,7 @@ window.addEventListener('DOMContentLoaded', () => { maximizable: false }); - titlebar.updateTitle("EZPPLauncher"); + titlebar.updateTitle(`${appInfo.appName} ${appInfo.appVersion}`); const $ = require('jquery'); const Swal = require('sweetalert2'); diff --git a/ui/windowManager.js b/ui/windowManager.js index 774cdb0..d0b7042 100644 --- a/ui/windowManager.js +++ b/ui/windowManager.js @@ -1,4 +1,5 @@ const path = require("path"); +const appInfo = require('../appInfo'); const { BrowserWindow } = require('electron'); const { attachTitlebarToWindow } = require('custom-electron-titlebar/main'); @@ -31,7 +32,7 @@ module.exports = { window.show(); }); - window.webContents.setUserAgent("EZPPLauncher"); + window.webContents.setUserAgent(`${appInfo.appName} ${appInfo.appVersion}`); attachTitlebarToWindow(window); // window.webContents.openDevTools({ // mode: "detach"