11const { app, BrowserWindow, ipcMain, Menu, clipboard, dialog } = require ( 'electron' ) ;
22const path = require ( 'path' ) ;
3- const fs = require ( 'fs' ) ; // Для синхронных проверок
4- const fsPromises = require ( 'fs' ) . promises ; // Для асинхронных операций
3+ const fs = require ( 'fs' ) ;
4+ const fsPromises = require ( 'fs' ) . promises ;
55const net = require ( 'net' ) ;
66const os = require ( 'os' ) ;
77const { spawn, exec } = require ( 'child_process' ) ;
@@ -12,26 +12,23 @@ const dgram = require('dgram');
1212const crypto = require ( 'crypto' ) ;
1313const ffmpeg = require ( '@ffmpeg-installer/ffmpeg' ) ;
1414
15- const ffmpegPath = ffmpeg . path ;
15+ // --- ИСПРАВЛЕНИЕ ЗДЕСЬ ---
16+ const ffmpegPath = ffmpeg . path . replace ( 'app.asar' , 'app.asar.unpacked' ) ;
17+ // -------------------------
1618
1719let mainWindow = null ;
1820const streamManager = { } ;
1921const usedPorts = new Set ( ) ;
2022const BASE_PORT = 9001 ;
2123
2224function getDataPath ( ) {
23- // В режиме разработки используем стандартный путь, чтобы не засорять папку проекта
2425 if ( ! app . isPackaged ) {
2526 return app . getPath ( 'userData' ) ;
2627 }
27-
28- // В упакованном приложении проверяем наличие файла-маркера
2928 const portableMarkerPath = path . join ( path . dirname ( app . getPath ( 'exe' ) ) , 'portable.txt' ) ;
3029 if ( fs . existsSync ( portableMarkerPath ) ) {
31- // Портативный режим: используем папку с exe
3230 return path . dirname ( app . getPath ( 'exe' ) ) ;
3331 } else {
34- // Стандартный режим: используем AppData/итд
3532 return app . getPath ( 'userData' ) ;
3633 }
3734}
0 commit comments