From c4b4f9995a29d77dcc19f1a83dd10d4ddebb37f5 Mon Sep 17 00:00:00 2001 From: Joel Jolly <128782382+withinJoel@users.noreply.github.com> Date: Sat, 28 Dec 2024 18:01:50 +0530 Subject: [PATCH] Under the hood changes --- .gitignore | 3 ++- Modules/Modules.js | 2 +- dist/run.iss | 24 ++++++++++++++++++++++++ main.js | 26 ++++++++++++++++---------- package-lock.json | 21 +++++++++++++++++++-- package.json | 5 +++-- 6 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 dist/run.iss diff --git a/.gitignore b/.gitignore index 7a72f76..f3d2194 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ -dist/ +dist/Output +dist/Elsa Convertion.txt \ No newline at end of file diff --git a/Modules/Modules.js b/Modules/Modules.js index 6010bbf..8d11620 100644 --- a/Modules/Modules.js +++ b/Modules/Modules.js @@ -1,5 +1,5 @@ ////Version -const currentVersion = '2.0.4'; +const currentVersion = '2.0.5'; ////Load Script function loadScript(url) { diff --git a/dist/run.iss b/dist/run.iss new file mode 100644 index 0000000..ffdf61a --- /dev/null +++ b/dist/run.iss @@ -0,0 +1,24 @@ +[Setup] +AppName=Elsa +AppVersion=2.0.4 +AppPublisher=Joel Jolly +AppPublisherURL=https://github.com/withinjoel/elsa +AppSupportURL=https://github.com/withinjoel/elsa/issues +AppUpdatesURL=https://github.com/withinjoel/elsa/releases +DefaultDirName={pf}\Elsa +DefaultGroupName=Elsa +OutputDir=Output +OutputBaseFilename=Setup +Compression=lzma2 +SolidCompression=yes +SetupIconFile=..\Logo\Elsa.ico + +[Files] +Source: "Elsa\*"; DestDir: "{app}"; Flags: recursesubdirs + +[Icons] +Name: "{commondesktop}\Elsa"; Filename: "{app}\Elsa.exe"; IconFilename: "{app}\Elsa.exe" +Name: "{group}\Elsa"; Filename: "{app}\Elsa.exe"; IconFilename: "{app}\Elsa.exe" + +[Run] +Filename: "{app}\Elsa.exe"; Description: "{cm:LaunchProgram,Elsa}"; Flags: nowait postinstall skipifsilent \ No newline at end of file diff --git a/main.js b/main.js index da7ddb2..4a5c233 100644 --- a/main.js +++ b/main.js @@ -1,14 +1,22 @@ // Import necessary modules -const { app, BrowserWindow, screen, Menu, ipcMain, dialog } = require('electron'); -const path = require('path'); -const os = require('os'); // For OS details -const axios = require('axios'); // For HTTP requests -const fs = require('fs'); -const { exec } = require('child_process'); // To execute commands +import { app, BrowserWindow, screen, Menu } from 'electron'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import contextMenu from 'electron-context-menu'; +import os from 'os'; // For OS details +import axios from 'axios'; // For HTTP requests +import fs from 'fs'; +import { dialog } from 'electron'; +import { ipcMain } from 'electron'; +import { exec } from 'child_process'; // To execute commands + +// Handle __dirname and __filename in ESM +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); // Initialize electron-context-menu with default settings -require('electron-context-menu')({ - showInspectElement: false, // Disable the "Inspect Element" option +contextMenu({ + showInspectElement: true, // Disable the "Inspect Element" option // Add more customization options as needed }); @@ -16,8 +24,6 @@ require('electron-context-menu')({ function createWindow() { const { width, height } = screen.getPrimaryDisplay().workAreaSize; - const emptyMenu = Menu.buildFromTemplate([]); - const win = new BrowserWindow({ title: "Elsa", backgroundColor: "#090909", diff --git a/package-lock.json b/package-lock.json index c7140c5..92b82f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,16 @@ { "name": "Elsa", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "Elsa", - "version": "2.0.4", + "version": "2.0.5", "license": "ISC", "dependencies": { "axios": "^1.7.9", + "dompurify": "^3.2.3", "electron-context-menu": "^4.0.4" }, "devDependencies": { @@ -106,6 +107,13 @@ "@types/node": "*" } }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, "node_modules/@types/yauzl": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", @@ -339,6 +347,15 @@ "dev": true, "optional": true }, + "node_modules/dompurify": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.3.tgz", + "integrity": "sha512-U1U5Hzc2MO0oW3DF+G9qYN0aT7atAou4AgI0XjWz061nyBPbdxkfdhfy5uMgGn6+oLFCfn44ZGbdDqCzVmlOWA==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, "node_modules/electron": { "version": "33.2.1", "resolved": "https://registry.npmjs.org/electron/-/electron-33.2.1.tgz", diff --git a/package.json b/package.json index 7d6131a..d146a00 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "Elsa", - "version": "2.0.4", + "version": "2.0.5", "description": "Elsa", "main": "main.js", + "type": "module", "scripts": { "start": "electron .", "package": "electron-packager . Elsa --platform=win32 --arch=x64 --out=dist --overwrite --icon=Logo/Elsa.png", @@ -18,4 +19,4 @@ "electron-context-menu": "^4.0.4", "dompurify": "^3.2.3" } -} +} \ No newline at end of file