Fix: Using ASAR for every parts of the projects (the server is now in it) and i put the binaries in a /binaries folder. It's better for readability of the resources folder

This commit is contained in:
MasterAcnolo
2026-01-15 21:22:40 +01:00
parent e45810b54c
commit c356e2e30d
3 changed files with 22 additions and 20 deletions

View File

@@ -3,6 +3,8 @@ const fs = require("fs");
const { app } = require("electron");
const config = require("../../config");
const { logger } = require("../logger.js");
let userYtDlp;
let ffmpegPath;
let denoPath;
@@ -11,16 +13,21 @@ const sourceYtDlp = path.join(process.resourcesPath, "yt-dlp.exe");
if (config.localMode) {
userYtDlp = path.join(__dirname, "../../ressources/yt-dlp.exe");
ffmpegPath = path.join(__dirname, "../../ressources"); // <- contient ffmpeg.exe et ffprobe.exe
ffmpegPath = path.join(__dirname, "../../ressources/"); // <- contient ffmpeg.exe et ffprobe.exe
denoPath = path.join(__dirname, "../../ressources/deno.exe");
} else {
userYtDlp = path.join(app.getPath("userData"), "yt-dlp.exe");
ffmpegPath = path.join(process.resourcesPath, "ffmpeg.exe");
denoPath = path.join(process.resourcesPath, "deno.exe");
userYtDlp = path.join(app.getPath("userData"),"binaries","yt-dlp.exe");
ffmpegPath = path.join(process.resourcesPath, "binaries","ffmpeg.exe");
denoPath = path.join(process.resourcesPath, "binaries","deno.exe");
if (!fs.existsSync(userYtDlp)) {
fs.copyFileSync(sourceYtDlp, userYtDlp);
}
}
if (!userYtDlp){ logger.error("Missing YT-DLP")}
if (!ffmpegPath){ logger.error("Missing FFMPEG")}
if (!denoPath){ logger.error("Missing DENO")}
module.exports = { userYtDlp, ffmpegPath, denoPath };