Skip to content

Commit ea6016f

Browse files
committed
修复 Linux 和 macOS 下 ffmpeg 路径识别问题;修复菜单项 icon 位置问题和 vue deep style 用法
1 parent d94e7e2 commit ea6016f

File tree

12 files changed

+47
-24
lines changed

12 files changed

+47
-24
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"editor.defaultFormatter": "esbenp.prettier-vscode"
1414
},
1515
"editor.codeActionsOnSave": {
16-
"source.fixAll.eslint": false
16+
"source.fixAll.eslint": "never"
1717
},
1818
}

WindowsInstaller/FFBox.iss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "FFBox"
5-
#define MyAppVersion "4.2"
5+
#define MyAppVersion "4.3"
66
#define MyAppPublisher "滔滔清风"
77
#define MyAppURL "http://ttqf.tech"
88
; #define MyCopyright "版权所有"
@@ -11,7 +11,7 @@
1111

1212
; 安装包输出文件夹
1313
#define MySetupOutDir "./output"
14-
#define MySetupOutBaseFilename "Windows_x86-64_FFBox_4.2"
14+
#define MySetupOutBaseFilename "Windows_x86-64_FFBox_4.3"
1515

1616
; 安装包所用的资源文件夹
1717
#define MyResDir "./res"
@@ -21,7 +21,7 @@
2121
; 点击 license 打开的网页连接
2222
#define MyAppLkLicenseURL 'http://ttqf.tech/LICENSE'
2323
; 安装目录至少需要的空间
24-
#define MyAppNeedSpaceByte 280000000
24+
#define MyAppNeedSpaceByte 290000000
2525
; 外部程序调用本安装程序时,会向外部传安装进度的 window api Message ID
2626
#define WM_MY_INSTALL_PROGRESS 6364
2727

@@ -51,7 +51,7 @@ DefaultDirName={pf}/{#MyAppName}
5151
LicenseFile={#MyAppPkgDir}\LICENSE
5252
OutputDir={#MySetupOutDir}
5353
OutputBaseFilename={#MySetupOutBaseFilename}
54-
SetupIconFile={#MyResDir}\256.ico
54+
SetupIconFile={#MyResDir}\..\..\config\256.ico
5555
; ArchitecturesAllowed 指示安装包运行时检查系统的架构类型
5656
ArchitecturesAllowed=x64compatible
5757
; ArchitecturesInstallIn64BitMode 指示安装包本体的架构类型

config/256.icns

36 KB
Binary file not shown.

config/256.ico

27.4 KB
Binary file not shown.

config/512.png

69.2 KB
Loading

electron-builder.json5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
],
2222
"win": {
2323
"artifactName": "${productName}_${version}.${ext}",
24-
"icon": "256.png",
24+
"icon": "config/256.ico",
2525
"target": [
2626
{
2727
"target": "dir",
@@ -41,7 +41,7 @@
4141
},
4242
"mac": {
4343
"artifactName": "${productName}_${version}.${ext}",
44-
"icon": "512.png",
44+
"icon": "config/512.png",
4545
"target": [
4646
{
4747
"target": "dmg",
@@ -57,7 +57,7 @@
5757
},
5858
"linux": {
5959
"artifactName": "${productName}_${version}.${ext}",
60-
"icon": "256.icns",
60+
"icon": "config/256.icns",
6161
"target": [
6262
{
6363
"target": "AppImage",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "FFBox",
3-
"version": "4.3.0-alpha",
3+
"version": "4.3.0",
44
"description": "",
55
"main": "app/main/index.cjs",
66
"scripts": {

src/backend/FFBoxService.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class FFBoxService extends (EventEmitter as new () => TypedEventEmitter<F
2626
private workingStatus: WorkingStatus = WorkingStatus.idle;
2727
private maxThreads = 1;
2828
private ffmpegVersion = '';
29-
private ffmpegPath = 'ffmpeg';
29+
private ffmpegPath = '';
3030
private customFFmpegPath: string;
3131
private globalTask: ServiceTask;
3232
public notifications: Notification[] = [];
@@ -66,7 +66,8 @@ export class FFBoxService extends (EventEmitter as new () => TypedEventEmitter<F
6666
this.maxThreads = currentMaxThreads;
6767
log.info(`设定最大同时运行任务数为 ${this.maxThreads}`);
6868
const customFFmpegPath = await localConfig.get('service.customFFmpegPath');
69-
if (this.customFFmpegPath !== customFFmpegPath) {
69+
// 发生了变更,或者初始化时 ffmpegPath 为空(如果之前已经初始化过,那么 customFFmpegPath 两者之一不为空)
70+
if (this.customFFmpegPath !== customFFmpegPath || !this.ffmpegPath && !customFFmpegPath) {
7071
this.customFFmpegPath = customFFmpegPath as any || undefined;
7172
this.initFFmpeg();
7273
}
@@ -91,24 +92,25 @@ export class FFBoxService extends (EventEmitter as new () => TypedEventEmitter<F
9192
this.ffmpegPath = this.customFFmpegPath;
9293
} else {
9394
log.info('检查 FFmpeg 路径和版本。');
94-
if (process.platform === 'win32') {
95-
this.ffmpegPath = 'ffmpeg';
96-
}
95+
this.ffmpegPath = 'ffmpeg';
9796
if (process.platform === 'darwin') {
9897
await fsPromise.access(path.join(process.execPath, '../ffmpeg'), fs.constants.X_OK).then((result) => {
99-
this.ffmpegPath = path.join(process.execPath, '../ffmpeg'); // 【程序目录】沙箱运行模式,service 与 ffmpeg 处在同一层级
98+
// 【程序目录】沙箱运行模式,service 与 ffmpeg 处在同一层级(此时 execPath 就是 FFBox.app 所在的绝对路径)
99+
this.ffmpegPath = path.join(process.execPath, '../ffmpeg');
100100
}).catch(() => {});
101101
await fsPromise.access('/usr/local/bin/ffmpeg', fs.constants.X_OK).then((result) => {
102-
this.ffmpegPath = '/usr/local/bin/ffmpeg'; // 【系统目录】macOS 只允许用户往 /usr/local/bin/ 放东西(而不能是 /usr/bin/),且此种情况下需要完整路径才能引用
102+
// 【系统目录】macOS 只允许用户往 /usr/local/bin/ 放东西(而不能是 /usr/bin/),且此种情况下需要完整路径才能引用
103+
this.ffmpegPath = '/usr/local/bin/ffmpeg';
103104
}).catch(() => {});
104105
}
105106
if (process.platform === 'linux') {
106107
await fsPromise.access(path.join(process.execPath, '../ffmpeg'), fs.constants.X_OK).then((result) => {
107-
// 【程序目录】deb 沙箱运行模式。service 与 ffmpeg 处在同一目录(/opt/FFBox/)
108+
// 【程序目录】deb 沙箱运行模式。service 与 ffmpeg 处在同一目录(此时 execPath 是 /opt/FFBox/FFBoxService,cwd 是 /home/[用户名]
108109
this.ffmpegPath = path.join(process.execPath, '../ffmpeg');
109110
}).catch(() => {});
110111
await fsPromise.access(path.join(process.cwd(), 'ffmpeg'), fs.constants.X_OK).then((result) => {
111-
this.ffmpegPath = path.join(process.cwd(), 'ffmpeg'); // 【程序目录】AppImage 沙箱运行模式,读取 .AppImage 同级目录
112+
// 【程序目录】AppImage 沙箱运行模式,读取 .AppImage 同级目录(此时 execPath 是 /tmp/.mount_FFBox_[hash]/FFBoxService,cwd 就是终端的 pwd)
113+
this.ffmpegPath = path.join(process.cwd(), 'ffmpeg');
112114
}).catch(() => {});
113115
// 【系统目录】Linux 下 /usr/local/bin/ 和 /usr/bin/ 里的东西均能被直接引用,包括终端执行和沙箱执行,因此此处不需要进行处理
114116
// console.log('路径', process.execPath, process.cwd(), __dirname, this.ffmpegPath);

src/common/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const version = (() => {
2-
let ret = '4.3_alpha';
2+
let ret = '4.3';
33
if (!buildInfo) {
44
ret += ' *'
55
} else if (buildInfo.isDev) {

src/renderer/src/components/Menu/MenuComponent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ defineExpose({
591591
display: flex;
592592
justify-content: center;
593593
align-items: center;
594-
/deep/ svg {
594+
&>:deep(svg) {
595595
width: 20px;
596596
height: 20px;
597597
}

0 commit comments

Comments
 (0)