RedisDesktopManager源码编译windows版(基于2022.1版本)

一、环境依赖

1.Git
2.Visual Studio Community 2019
3.Qt 5.x
4.Python 3.9
5.CMake
6.Windows Openssl
7.NSIS
8.Nuget

二、源码下载

1.clone源码

git clone https://github.com/uglide/RedisDesktopManager.git

2.进入RedisDesktopManager目录,切换到发布tag

git checkout -b 2022.1_release 2022.1

3.下载依赖仓库代码

git submodule update --init --recursive

4.适配windows

#进入3rdparty/qredisclient/3rdparty/hiredis目录

git apply ../hiredis-win.patch

5.下载nuget依赖

#在3rdparty/目录下
nuget install zlib-msvc14-x64 -Version 1.2.11.7795

三、修改代码

1.修改源代码版本号

#源文件src\resp.pro

!defined(VERSION, var) {
    VERSION=2022.1.0
}

2.修改发布包版本号

#源文件build\windows\installer\installer.nsi
#在头部增加

!define VERSION "2022.1.0"

3.修改openssl依赖

#源文件3rdparty\3rdparty.pri的18行

OPENSSL_LIB_PATH = {{OpenSsl安装目录}}\lib\VC

4.修改python依赖

#源文件3rdparty\pyotherside.pri的3~9行
PY_VERSION="39"
PY_WIN_VERSION="3.9.x" //根据实际子版本号修改
PY_LIB_SUFFIX="3.9"

QMAKE_LIBS += -L{{Python安装目录}}\Python$${PY_WIN_VERSION}\libs -lpython$${PY_VERSION}
INCLUDEPATH += {{Python安装目录}}\Python$${PY_WIN_VERSION}\include\

四、编译源代码

1.编译brotli模块

#3rdparty\brotli目录下
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed .
cmake --build . --config Release

2.编译snappy模块

#3rdparty\snappy目录下
cmake .
cmake --build . --config Release

3.编译lz4模块

#3rdparty\lz4\build\cmake目录下
cmake -DLZ4_BUNDLED_MODE=ON  .
cmake --build . --config Release

4.编译zstd模块

#3rdparty\zstd\build\cmake目录下
cmake -DCMAKE_BUILD_TYPE=Release .
cmake --build . --config Release

5.Qt编译

使用QtCreator打开src/resp.pro

配置项目为Release、去除debug信息

Ctrl+B构建项目

成功后在bin\windows\release生成resp.exe文件

五、打包发布

1.拷贝编译exe

将bin\windows\release\resp.exe拷贝到build\windows\installer\resources目录下

2.处理Qt依赖

在build\windows\installer\resources目录下执行windeployqt命令

"{{Qt安装目录}}\{{Qt版本号}}\msvc2019_64\bin\windeployqt.exe" --no-angle --no-opengl-sw --no-compiler-runtime --no-translations --release --force --qmldir {{RESP源代码目录}}\src\qml resp.exe

3.处理python依赖

拷贝python-3.9.x-embed-amd64发行包中的python39.dll、python39.zip到build\windows\installer\resources目录

4.使用NSIS打包

使用NSIS打开build\windows\installer\installer.nsi生成安装包

最后在build\windows\installer目录生成resp-2022.1.0.exe文件

 

 

 

感谢

感谢您的阅读,最后附上打包好的共享链接:

链接:https://download.csdn.net/download/w949413/89280893
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值