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


边栏推荐
- List collection
- Redis installation on Linux system
- Lichuang EDA learning notes 10 common connector component identification and passive buzzer driving circuit
- 60 divine vs Code plug-ins!!
- Map集合
- 【OpenGL】OpenGL Examples
- Remove invalid parentheses [simulate stack with array]
- Layout of pyqt5 interface and loading of resource files
- dataworks 同步maxcomputer 到sqlserver ,汉字变乱码了,请问怎么解决
- Use of polarplot function in MATLAB
猜你喜欢

【OpenGL】OpenGL Examples

List collection

Building of Hisilicon 3559 universal platform: obtaining the modified code of data frame
![[leetcode] 15. Sum of three numbers](/img/0c/4363d7737d90c170eb4519828990b9.png)
[leetcode] 15. Sum of three numbers

使用Power Designer工具构建数据库模型

What is the principle of spectral confocal displacement sensor? Which fields can be applied?

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

How to select an OLAP database engine?

Lichuang EDA learning notes 10 common connector component identification and passive buzzer driving circuit

Q-learning notes
随机推荐
Lichuang EDA learning notes 10 common connector component identification and passive buzzer driving circuit
Videos are stored in a folder every 100 frames, and pictures are transferred to videos after processing
qt msvc 安装及调试
Sarsa notes
grep匹配查找
Construction de la plate - forme universelle haisi 3559: obtenir le codage après modification du cadre de données
Flink sql控制台,不识别group_concat函数吗?
Redis cache problem
Sublist3r error reporting solution
如何利用AI技术优化独立站客服系统?听听专家怎么说!
Layout of pyqt5 interface and loading of resource files
Browser plays RTSP video based on nodejs
Ensemble de cartes
MySQL composite query
海思3559开发常识储备:相关名词全解
Dqn notes
MySQL判断执行条件为NULL时,返回0,出错问题解决 Incorrect parameter count in the call to native function ‘ISNULL‘,
Iserver publishing es service query setting maximum return quantity
品达通用权限系统(Day 7~Day 8)
使用Power Designer工具构建数据库模型