Skip to content

Commit

Permalink
fix:移除fbs打包方式,改为
Browse files Browse the repository at this point in the history
  • Loading branch information
fandesfyf committed Jun 19, 2023
1 parent b57aa78 commit e7285c1
Show file tree
Hide file tree
Showing 39 changed files with 20 additions and 7,864 deletions.
2 changes: 1 addition & 1 deletion CoreModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
import pynput.keyboard._xorg
import pynput.mouse._xorg

VERSON = "0.14.0B"
VERSON = "0.14.1B"


class JHotkey(QThread):
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ $其他功能:划屏提字:打开软件后可以在任何界面(图片也可
│ jamroll_screenshot.py //滚动截屏模块
│ jampublic.py //一些非常常用的公共引用类/方法,如翻译文字识别线程类等
│ jamresourse.py //转化的资源文件
│ jamtoolsbuild.py //一键构建脚本,调用该脚本即可自动分析项目引用,自动配置项目文件,自动编译/打包等
│ jamtoolsbuild.py //一键构建脚本,调用该脚本即可自动分析项目引用,自动配置项目文件,自动编译/打包等, 基于fbs,后续将移除
│ setjam.py //附加编译脚本,如在构建脚本中设置了编译,则会调用该脚本将所有库转化为c文件后编译,需要Cython支持
| 以下几个库文件是(作者自行编译的)不同平台下的缩略版opencv库(10M+),现在默认clone的项目将不会包含这些文件(因为太大了clone起来太慢),已经放在release里面了,要小一点的文件的话就自己去下载,或者直接安装完全版的opencv-contrib-python==3.4.2.17(70M+)..
│ \ cv2.cp37-win_amd64.pyd //windows下编译的opencv库,如需扩展功能,请自行安装opencv-contrib-python==3.4.2.17
Expand Down Expand Up @@ -305,4 +305,17 @@ opencv-contrib-python # 如果需要更小体积的cv2,则可以从[这里](http

此外,本软件多媒体处理能力主要依赖于[ffmpeg库](https://ffmpeg.org/),需要自行下载[ffmpeg](https://ffmpeg.org/)(用于录屏和多媒体处理)和[gifsicle](http://www.lcdf.org/gifsicle/)(用于gif压缩)可执行文件放到bin目录对应操作系统的文件夹下,方可使用对应功能.

配置好以上环境后,可以通过运行`jamtoolsbuild.py`文件一键打包对应平台下的包,然后通过fbs install命令构建安装程序,详情请看[这里](https://github.com/mherrmann/fbs-tutorial)
### 打包安装程序

> 原本的打包基于fbs库,但是高版本的fbs开始收费了,所以换成了`cx_Freeze`进行打包(感觉更好用了,白嫖真爽!)
配置好以上环境后,可以通过运行以下命令打包为安装目录的文件夹:
```shell
python setup.py build
```
window下打包出来安装目录之后,可以使用nsis打包为安装程序,提供了一个安装程序脚本到`.\build\installer`中,具体用法可以参考[nsis教程](https://nsis.sourceforge.io/Main_Page)

TODO:
- 其他平台使用`cx_Freeze`打包还没有测试
- `cx_Freeze`本身好像支持打包为安装程序,但是不能定义安装页面,后面再看看能不能使用

4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# !usr/bin/python3
# -*- coding: utf-8 -*-

####### 本文件由jamtoolsbuild.py 打包脚本自动生成 ######
####### 本文件由setup.py 打包脚本自动生成 ######

import pynput.keyboard
import pynput.mouse
Expand Down Expand Up @@ -79,5 +79,5 @@
main()


####### 本文件由jamtoolsbuild.py 打包脚本自动生成 ######
####### 本文件由setup.py 打包脚本自动生成 ######

1 change: 0 additions & 1 deletion requirement.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Wheel
Pillow
pynput
fbs==0.9.0
qrcode
requests==2.27
urllib3==1.25.8
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
jamfilelist = ["CoreModels", "jamcontroller", "WEBFilesTransmitter", "clientFilesTransmitter",
"jamscreenshot", "jampublic", "jamroll_screenshot", "Logger", "jamspeak",
"jamWidgets", "jam_transtalater","PaddleOCRModel/PaddleOCRModel"]
print("说明:main.py为存放引入库的文件(无需管),scr文件夹是fbs打包的项目目录.\n"
print("说明:main.py为存放引入库的文件(无需管), cx_Freeze打包输出到build目录下.\n"
"运行本文件打包时,会自动解析所有jamfilelist中源码的引入库,"
"并将所有需要的库格式化后写入main.py文件中,从而让pyinstaller可以找到(否则可能有找不到库的错误)"
"同时会自动配置scr项目目录,然后通过命令行运行打包程序实现自动打包,如需生成安装文件Windows下需要nsis环境,请自行探索..\n"
Expand Down Expand Up @@ -47,7 +47,7 @@
suffix = ""

### gen main.py
file_tips = "\n####### 本文件由jamtoolsbuild.py 打包脚本自动生成 ######\n\n"
file_tips = "\n####### 本文件由setup.py 打包脚本自动生成 ######\n\n"
with open('main.py', "w", encoding="utf-8") as mainf:
importfilelist = ["# !usr/bin/python3\n","# -*- coding: utf-8 -*-\n",
file_tips,"import pynput.keyboard\n", "import pynput.mouse\n"]
Expand Down
7 changes: 0 additions & 7 deletions src/build/settings/base.json

This file was deleted.

6 changes: 0 additions & 6 deletions src/build/settings/linux.json

This file was deleted.

3 changes: 0 additions & 3 deletions src/build/settings/mac.json

This file was deleted.

200 changes: 0 additions & 200 deletions src/installer/windows/Installer.nsi

This file was deleted.

Binary file removed src/main/icons/Icon.ico
Binary file not shown.
11 changes: 0 additions & 11 deletions src/main/icons/README.md

This file was deleted.

Binary file removed src/main/icons/base/512.png
Binary file not shown.
Binary file removed src/main/icons/linux/512.png
Binary file not shown.
Binary file removed src/main/icons/mac/512.png
Binary file not shown.
Empty file removed src/main/python/.gitkeep
Empty file.
Loading

0 comments on commit e7285c1

Please sign in to comment.