当前位置:网站首页>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


边栏推荐
- grep匹配查找
- Charles打断点修改请求数据&响应数据
- 拆分电商系统为微服务
- Redis-缓存问题
- Introduction to the novelty of substrate source code: comprehensive update of Boca system Boca weight calculation, optimization and adjustment of governance version 2.0
- ECDSA signature verification in crypt
- Splitting e-commerce systems into micro services
- [target tracking] |pytracking configuring win to compile prroi_ pool. pyd
- 【一天学awk】内置变量的使用
- How to use the plug-in mechanism to gracefully encapsulate your request hook
猜你喜欢

Efficient elliptic curve point addition and multiplication in scrypt

市值蒸发650亿后,“口罩大王”稳健医疗,盯上了安全套

Commands for redis basic operations

Idea has a new artifact, a set of code to adapt to multiple terminals!

FlinkSQL自定义UDAF使用的三种方式

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

SuperMap 3D SDKs_ Unity plug-in development - connect data services for SQL queries

How difficult is data governance and data innovation?

Apple executives openly "open the connection": Samsung copied the iPhone and only added a large screen

Edusoho enterprise training version intranet only deployment tutorial (to solve the problems of player, upload and background jam)
随机推荐
Visual Studio配置Qt并通过NSIS实现项目打包
90.(cesium篇)cesium高度监听事件
Introduction to sub source code updating: mid May: uniques NFT module and nomination pool
Google refutes rumors and gives up tensorflow. It's still alive!
Redis installation on Linux system
Swagger2 automatically generates API documents
Solve the problem that the server cannot be connected via SSH during reinstallation
JMeter之性能测试流程及性能测试关注点
Redis-缓存问题
海思3559开发常识储备:相关名词全解
Android development interview real question advanced version (with answer analysis)
Mysql判断计算结果,除以100
Hisilicon 3559 developing common sense reserves: a complete explanation of related terms
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(二)
[cloud native | kubernetes] in depth understanding of deployment (VIII)
SuperMap 3D SDKs_Unity插件开发——连接数据服务进行SQL查询
How to use the plug-in mechanism to gracefully encapsulate your request hook
21. Notes on WPF binding
Vision based robot grasping: from object localization, object pose estimation to parallel gripper grasping estimation
Linux系统Redis的安装