Skip to content

Commit 2eaef11

Browse files
committed
4.0 版本发布前准备(修正图标与 LICENSE 问题;更新 readme)
1 parent 045efd8 commit 2eaef11

File tree

7 files changed

+97
-15
lines changed

7 files changed

+97
-15
lines changed

electron-builder.json5

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
],
2222
"win": {
2323
"artifactName": "${productName}_${version}.${ext}",
24+
"icon": "256.png",
2425
"target": [
2526
{
2627
"target": "dir",
@@ -40,6 +41,7 @@
4041
},
4142
"mac": {
4243
"artifactName": "${productName}_${version}.${ext}",
44+
"icon": "512.png",
4345
"target": [
4446
{
4547
"target": "dmg",
@@ -54,6 +56,8 @@
5456
],
5557
},
5658
"linux": {
59+
"artifactName": "${productName}_${version}.${ext}",
60+
"icon": "256.icns",
5761
"target": [
5862
{
5963
"target": "AppImage",
@@ -64,7 +68,6 @@
6468
"arch": ["x64"],
6569
},
6670
],
67-
"artifactName": "${productName}_${version}.${ext}",
6871
"extraFiles": [
6972
{
7073
"from": "app/backend/index",

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.0.0-gamma",
3+
"version": "4.0.0",
44
"description": "",
55
"main": "app/main/index.cjs",
66
"scripts": {

readme.md

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,68 @@
1-
# 您好!👋
1+
# FFBox 👋
22

3-
## ARE YOU OK ? 🙋
3+
一个多媒体转码百宝箱 / 一个 FFmpeg 的套壳
44

5-
### I'm very happy to ...
5+
软件介绍请转到 [FFBox 官网](http://ffbox.ttqf.tech/)
66

7-
See you here!
7+
![软件截图](https://github.com/ttqftech/FFBox/assets/31009285/8659b34d-4aac-4caa-9ea3-dfdb81ce1f68)
88

9-
**不过 4.0 版本仍在开发中,各方面都在 under construction...**
9+
## 工程简介
1010

11-
我把默认分支切到 4.0+,是为了让 FFBox 看起来没有停更 _(:з」∠)_
11+
您现在看到的是 3.x 版本的 readme 文件。FFBox 在不同的大版本之间,使用的技术/框架存在区别。若需查阅版本对应的 readme,建议切换到对应分支。
1212

13-
*您可以切到 3.0+ 分支阅览一年前就已经做完的 3.0 版的代码*
13+
- `1.x 版本`:经典的“html + css + js”前端三件套,没有工程化和模块化。
14+
- `2.x 版本`:使用 vue 2 进行工程化、模块化开发。主要控制逻辑集中在状态管理器上。
15+
- `3.x 版本`:更好的高聚低耦与工程结构,服务与 UI 分离,引入 TypeScript,支持远程控制。
16+
- `4.x 版本`:全新界面,使用更新、更多样的技术架构,自行编写开发与打包脚本,彻底分离前后端。
1417

15-
***也可以到 `日志.md` 去看 4.0 版本的最新开发进度啦~ 🤣***
18+
## 准备自行编译
19+
20+
由于这里不是前端课堂,此处当然不会有手把手的详细指南🌚。以下会列出一些需要的东西,您可自行了解:
21+
22+
1. `Visual Studio Code`:这是本项目推荐使用的编辑器。本项目已为该编辑器进行了启动后端等相关任务的编写。
23+
2. `node.js`:它是一个 JavaScript 运行环境,主要用于项目的编译。建议使用 `nvm`,当项目运行不起来的时候可尝试使用它来切换一下 node.js 的版本。
24+
3. `pnpm`:它是本项目推荐使用的依赖管理器。
25+
4. `pnpm set registry ___` `pnpm set ELECTRON_MIRROR`:如果您无法正常下载依赖,请配置源。
26+
5. `Visual Studio 2022`:如果您要在 Windows 平台上编译 FFBoxHelper,那么这是必须的。
27+
28+
## FFmpeg
29+
30+
本项目并不自带 FFmpeg。如果您没有 FFmpeg,那么 FFBox 只能为您展示启动命令,不能进行转码工作。您需要在 [FFmpeg 下载页面](http://ffmpeg.org/download.html) 下载 FFmpeg 后,根据 FFBox 的指示,将其放入系统路径(推荐)或程序目录中。
31+
32+
## 开发与打包流程
33+
34+
```mermaid
35+
flowchart TB
36+
subgraph DFmjs[dev-frontend.mjs]
37+
IPE1[injectProcessEnv] --> CSR["createServer(renderer)"] --> watchPreload --> watchMain
38+
end
39+
subgraph BBmjs[build-backend.mjs]
40+
IPE2[injectProcessEnv] --> BB1["buildBackend"]
41+
end
42+
subgraph BBmjs2[build-backend.mjs]
43+
IPE3[injectProcessEnv] --> BB2["buildBackend"]
44+
end
45+
subgraph BFmjs[build-frontend.mjs]
46+
IPE4[injectProcessEnv] --> buildMain --> buildPreload --> buildRenderer
47+
end
48+
subgraph VCLaunchB["vscode launch 编译调试后端 (vite)"]
49+
VSTask["vscode task 启动"] --> BBmjs2
50+
end
51+
subgraph 生产前端["生产前端【npm run build:frontend】"]
52+
BFmjs
53+
end
54+
subgraph 生产后端["生产后端【npm run build:backend】"]
55+
BBmjs --> PB[pkg:backend]
56+
end
57+
subgraph 开发前端["开发前端【npm run dev:frontend】"]
58+
DFmjs
59+
end
60+
subgraph 开发后端["开发后端【vscode F5】"]
61+
VCLaunchB
62+
end
63+
64+
注1[注意 Windows Helper 需要使用 VS 手动编译并放入项目根目录]
65+
开发("开发") --> 开发后端 --> 开发前端
66+
打包("打包") --> 生产后端 & 生产前端 --> pkg["npm run package"]
67+
注1 --> 开发 & 打包[打包【npm run build:everything】]
68+
```

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.0_gamma';
2+
let ret = '4.0';
33
if (!buildInfo) {
44
ret += ' *'
55
} else if (buildInfo.isDev) {

src/main/index.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,28 @@ class ElectronApp {
316316

317317
// 读取 LICENSE 文件
318318
ipcMain.handle('readLicense', () => {
319-
return new Promise((resolve) => {
320-
fs.readFile('./LICENSE', { encoding: 'utf-8' }).then((data) => {
319+
return new Promise(async (resolve) => {
320+
let licensePath = '';
321+
if (getOs() === 'Windows') {
322+
licensePath = './LICENSE';
323+
} else if (getOs() === 'MacOS') {
324+
licensePath = path.join(process.resourcesPath, '../LICENSE');
325+
} else if (getOs() === 'Linux') {
326+
// this.mainWindow.webContents.send('debugMessage', 'service 路径', process.execPath, __dirname, __filename, process.cwd(), path.join(process.execPath, '../FFBoxService'));
327+
await fs.access('./LICENSE', fs.constants.R_OK).then((result) => {
328+
licensePath = './LICENSE'; // 通过终端直接执行
329+
}).catch(() => {});
330+
await fs.access(path.join(process.cwd(), 'LICENSE'), fs.constants.R_OK).then((result) => {
331+
licensePath = path.join(process.cwd(), 'LICENSE'); // 无沙箱双击执行、通过终端直接执行
332+
}).catch(() => {});
333+
await fs.access(path.join(process.execPath, '../LICENSE'), fs.constants.R_OK).then((result) => {
334+
licensePath = path.join(process.execPath, '../LICENSE'); // AppImage 双击执行(/tmp 目录)、deb 安装后双击执行(/opt/FFBox/)
335+
});
336+
}
337+
fs.readFile(licensePath, { encoding: 'utf-8' }).then((data) => {
321338
const cipherText = CryptoJS.SHA1(data);
322-
if (cipherText.toString() === '4e994ccf17287387cf8bf155ad40f30ad5ca5f38') {
339+
if (['c10a2191115c97595e0f0bbb4a127547c9ebb59e', '4e994ccf17287387cf8bf155ad40f30ad5ca5f38'].includes(cipherText.toString())) {
340+
// 两个校验码,适配 LF 换行符和 CRLF 换行符
323341
resolve(data);
324342
} else {
325343
resolve(undefined);

src/renderer/src/stores/appStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const useAppStore = defineStore('app', {
6464
showMenuCenter: 0,
6565
showInfoCenter: false,
6666
paraSelected: 1,
67-
draggerPos: 0.6,
67+
draggerPos: 0.57,
6868
taskViewSettings: {
6969
showParams: true,
7070
showDashboard: true,

日志.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,3 +1401,11 @@ Linux 适配,核心问题依然是两个:FFBoxService 和 ffmpeg 调用。
14011401
另外,在开发过程中,也顺带修了个小 bug:FFBoxService 启动速度赶不上 renderer 启动速度,导致第一次登录显示失败。
14021402
另外,在 deepin 开发环境下,无法正常启动渲染进程,会报错。这个错误后关闭程序的功能以后再去做了。
14031403
另外也增加了文件大小 100MB 的上传限制,避免 CryptoJS 把页面搞崩。
1404+
1405+
## 2024-04-01
1406+
1407+
最后的几天,都在忙着做 FFBox 官网的页面啦~
1408+
1409+
最后把三个平台的图标配置补充了一下(其中 deepin 的 Linux 不支持 png 图标,需要用 icns),另外发现了 Linux 和 macOS 上 LICENSE 读取不正常,修了一下,完事啦~
1410+
1411+
祝大家使用愉快!

0 commit comments

Comments
 (0)