File tree Expand file tree Collapse file tree 3 files changed +39
-2
lines changed
Expand file tree Collapse file tree 3 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ publish:
6464# provider: generic
6565# url: http://localhost:3000
6666beforePack : scripts/install-darwin-deps.js
67- afterPack : scripts/cleaned-unused-arch-deps .js
67+ afterPack : scripts/after-pack .js
6868afterSign : scripts/notarize.js
6969releaseInfo :
7070 releaseNotes : |
7171 优化导入字幕提示信息
7272 修复改变窗口大小后字幕消失的问题
73-
73+ 修复在 Linux 上无法播放视频报错的问题
Original file line number Diff line number Diff line change 22import { exec as execCallback } from 'node:child_process'
33import { promisify } from 'node:util'
44
5+ import fixLinuxPermissions from './fix-linux-permissions.js'
6+
57const exec = promisify ( execCallback )
68
79export default async function installDarWinDeps ( context ) {
10+ await fixLinuxPermissions ( context )
811 const { packager, arch } = context
912 const platform = packager . platform . nodeName
1013 if ( platform !== 'darwin' ) {
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs' ;
2+ import path from 'node:path' ;
3+
4+ export default async function fixLinuxPermissions ( context ) {
5+ const { packager } = context ;
6+ const platform = packager . platform . nodeName ;
7+ if ( platform !== 'linux' ) {
8+ return ;
9+ }
10+
11+ const { appOutDir } = context ;
12+ const ffprobePath = path . join (
13+ appOutDir ,
14+ 'resources' ,
15+ 'app.asar.unpacked' ,
16+ 'node_modules' ,
17+ '@ffprobe-installer' ,
18+ 'linux-x64' ,
19+ 'ffprobe'
20+ ) ;
21+
22+ try {
23+ // 检查文件是否存在
24+ if ( fs . existsSync ( ffprobePath ) ) {
25+ // 添加执行权限
26+ fs . chmodSync ( ffprobePath , '755' ) ;
27+ console . info ( 'Successfully added execute permission to ffprobe' ) ;
28+ } else {
29+ console . warn ( 'ffprobe not found in resources directory' ) ;
30+ }
31+ } catch ( error ) {
32+ console . error ( 'Error fixing ffprobe permissions:' , error ) ;
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments