const path = require('path'); const fs = require('fs'); /** * Ensure ffmpeg.dll is next to the exe (appOutDir) so the portable exe finds it. * extraFiles may place it in resources/app; copy to root if needed. */ module.exports = async function (context) { if (context.electronPlatformName !== 'win32') return; const appOutDir = context.appOutDir; const rootFfmpeg = path.join(appOutDir, 'ffmpeg.dll'); const appFfmpeg = path.join(appOutDir, 'resources', 'app', 'ffmpeg.dll'); if (fs.existsSync(rootFfmpeg)) return; // already in place if (fs.existsSync(appFfmpeg)) { fs.copyFileSync(appFfmpeg, rootFfmpeg); } };