当前位置:网站首页>Visual studio configures QT and implements project packaging through NSIS
Visual studio configures QT and implements project packaging through NSIS
2022-06-30 12:42:00 【DeepHao】
Visual Studio To configure Qt
Click on here Go to Alibaba software source to download Qt, What I use here is Qt5.14.2, Double click Install after download . Need to have Qt Account number , If not, you can take Qt Apply for . Click next in turn , Again Qt When selecting components , The recommendations are shown in the figure below , take MSVC and MinGW All choose , also 32 Bit and 64 All bits are installed

Install and use Visual Studio 2017, Pay attention to check " Use C++ Desktop development "
Visual Studio 2017 To configure Qt5.14.2, choice “ Tools ", Expansion and update , Search for Qt And install 

choice Qt VS Tools, choice Qt Versions,
add to Qt Of MSVC route , find “qmake.exe", Click ok , take 32 Bit and 64 Bits are added , Easy to switch at any time 
NSIS install
Go to Official website , Download and install

Qt Project packaging
windeployqt Implement packaging
utilize visual studio To complete a Qt engineering , As shown below , The tutorial is in bilibili, choice x64 and release
After compilation, the project directory will generate "x64/Release/CoinFlip.exe" file 
Create a new folder on the desktop Coin, Name at will , Put the above .exe Copy files to 
open Qt The command box comes with you ( Do not use windows Self contained cmd)

VCINSTALLDIR
D:\programming\Microsoft Visual Studio\2017\Community\VC
The value is Visual Studio Under the installation path of VC
Use NSIS Further packaging
Pack the whole of the above Coin Folder compressed into “.zip” file , open NSIS Software . Follow the steps shown below , Click on the bottom right corner when finished generate, Just wait for it to finish 
Appears after completion exe file , Double click Install 
Use NSIS Custom script implementation further packaging
clone This warehouse , Enter into VimeoSetup Catalog , Take the next step Coin Folder replacement VimeoSetup Under the App Folder and rename App
open “NSIS-UI-Plugin” engineering 
choice Release or Debug, choice x86,Qt VS Tools Medium version selection x86
stay " attribute " Revision in China "Qt Installation", Click on “ application ”,“ determine ”
After completion , Right click " Generate ", When it's done "Win32\Release" Lower generation "NSIS-UI-Plugin.dll" file 
If an error is reported but an "NSIS-UI-Plugin.dll" file , Don't worry , This is because... Was not added NSIS environment variable , So will NSIS Add to the environment variable to resolve , Where the value is NSIS The installation path
NSIS_DIR
D:\Program Files (x86)\NSIS

Another solution is to generate "NSIS-UI-Plugin.dll" Manually copy files to "D:\Program Files (x86)\NSIS\Plugins\x86-unicode", And rename to "nsQtPlugin.dll", If previously used Debug The schema is renamed "nsQtPluginD.dll"
However, it is recommended to add environment variables , Because the following steps still need to add NSIS environment variable
Get into "VimeoSetup", edit "vimeo-template.nsi" file , The meanings of each variable are as follows 
I'll change it as follows , I created a new icon , So I changed the pop-up icon to the corresponding file name 
Save when done , add to NSIS environment variable ( As shown above ). double-click "build-setup.bat", If it is Debug Mode double click "build-setup [debug].bat", Can open "bat" File to see the running command
@echo off
python.exe ..\NsisScriptGenerate.py "%~dp0vimeo-template.nsi" "%~dp0App"
"%NSIS_DIR%\makensisw.exe" "%~dp0\vimeo.nsi"
PAUSE
You may encounter the following problems , Because of the original NsisScriptGenerate.py use Python2, Therefore, the following modifications are required
print "file total: " + str(g_extract_file_cmd_total) + ", dir total: " + str(g_create_dir_cmd_total)
in
print("file total: " + str(g_extract_file_cmd_total) + ", dir total: " + str(g_create_dir_cmd_total))
print nsis_script_template_path
in
print(nsis_script_template_path)
print g_root_dir
in
print(g_root_dir)
Double click when finished "build-setup.bat", if Debug Pattern , double-click "build-setup [debug].bat"
If there is no response , Need to add Python environment variable ( because ".bat" The file will call the system cmd, Therefore, the system environment variables will be retrieved Python, See Python Environment variable add ), Or manual use Python Execute... In the current directory
python ../NsisScriptGenerate.py vimeo-template.nsi App
To generate "vimeo.nsi" file , And then double-click "build-setup.bat", if Debug Pattern , double-click "build-setup [debug].bat"
When finished, get "CoinFlip-setup.exe" file 
Double-click to open , You will get the following installation process



Python Environment variable add
Add the following environment variables :
take Python Add the installation directory to the environment variables and Scripts Folder path

If input Python Always open the Microsoft app store , The solution is as follows :
Search in settings " Application execution alias ", Disable the response shortcut , When it's done "cmd" Input in "python", When the following interface appears, the addition succeeds


边栏推荐
- Global capital market 101: Breit, one of the best investment targets for domestic high net worth people
- [300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (II)
- Generate entity classes from SQL Server database tables through EF core framework
- Map集合
- Sword finger offer 05 Replace spaces: replace each space in the string s with "%20"“
- pyqt5界面的布局与资源文件的载入
- Visual Studio配置Qt并通过NSIS实现项目打包
- Redis6 learning notes - Chapter 2 - Basic redis6 operations
- New function of SuperMap iserver11i -- release and use of legend
- Four ways for flinksql to customize udtf
猜你喜欢

Hisilicon 3559 universal platform construction: introduction to YUV format

Reading the table data of Tencent documents in the applet

SuperMap 3D SDKs_Unity插件开发——连接数据服务进行SQL查询

Construction de la plate - forme universelle haisi 3559: obtenir le codage après modification du cadre de données

Hisilicon 3559 sample parsing: Venc

iServer发布ES服务查询设置最大返回数量

FlinkSQL自定义UDATF实现TopN

Joplin implements style changes

海思3559万能平台搭建:获取数据帧修改后编码

【MySQL】MySQL的安装与配置
随机推荐
How do different types of variables compare with zero
解决服务器重装无法通过ssh连接的问题
浅谈 JMeter 运行原理
Shell编程概述
问卷星问卷抓包分析
Android development interview real question advanced version (with answer analysis)
Use of polarplot function in MATLAB
各厂家rtsp地址格式如下:
Clipboardjs - development learning summary 1
MySql实现两个查询结果相除
视频按每100帧存一个文件夹,处理完再图片转视频
【一天学awk】基础中的基础
JMeter之性能测试流程及性能测试关注点
Shell基础入门
60 个神级 VS Code 插件!!
Dqn notes
Google refutes rumors and gives up tensorflow. It's still alive!
Solve the problem that the server cannot be connected via SSH during reinstallation
Introduction to new features of ES6
Substrate 源码追新导读: 波卡系波卡权重计算全面更新, Governance 2.0 版本的优化和调整