Take the Demo project as an example, build with Qt creator and package with Enigma Virtual Box
Article directory
1. Build the project through release
After selecting the release option in the build kit, run the project again
to find the folder of the build project in the original project directory and
enter the release folder to see the exe file. This is the file packaged by the code, but it lacks the dependencies corresponding to QT. So it can't be executed
put it under a separate folder and copy this path
2. Use the windeployqt tool to add dependencies
Find the Qt command line tool in the task manager and search directly. Note that you must use the MinGW version to add appropriate dependencies, and also pay attention to the number of bits. 64-bit projects cannot be packaged with 32-bit MinGW. Here the project and packaging All 32-bit computers are used. Because there are more 32-bit computers, the compatibility will be better (64-bit computers can run 32-bit software, but 32-bit software cannot run 64-bit computers)
. Execute the following two commands under this command line tool. instructions
Enter the to-be-operated folder cd + the path just copied
cd D:\Code\QT\test
Use the windeployqt tool
windeployqt Demo.exe
The build is completed as shown in the figure. At this time, the exe file can run under this folder, but it still cannot run independently from this folder, so it is packaged with Enigma Virtual Box later.
3. Packaging with Enigma Virtual Box
Enigma Virtual Box is a software virtualization tool, which can encapsulate multiple files into the application master file, thereby making green software into a single-execution file. It supports all types of file formats, the virtualized software does not release any temporary files to your hard disk, and the file emulation process only runs in memory
Enigma Virtual Box download path:
https://enigmaprotector.com/assets/files/enigmavb.exe
Visit the link to download
Select the input and output path, drag the corresponding files to be packaged into the packaging area, and click process to
prompt the packaging and packaging success.
At this time, the packaged Demo_boxed.exe file is an exe file that can be run and published independently.
Running effect diagram
4. Attach a simple method to modify the software icon
Drag the prepared ico icon directly into the project folder
and add it directly in the last line of the project configuration file .pro
RC_ICONS = my.ico