QT programs are packaged into applications

The QT program is packaged into a downloadable application (so that other users can use this function without configuring the environment)

Steps : It is divided into two steps, the first is to use QT to generate the .exe file; the second step needs to download a software Inno Setup Compiler.
If you don’t want to download another software, this method doesn’t work, you need to download a software
Step 1: Generate .exe file
①: Click the small arrow on the right side of the small computer to select “Release” as shown in the figure below, and then click the button to run.
insert image description here
②: The generated .exe is in the path where the original program file is located. Select Release, and after selecting and entering twice, you will find the .exe file, and then copy the .exe file to the folder path you want. My side is Copy it to the path of "D:\Software\1.0". (This file is preferably only .exe file, which is more convenient for you to view the added resource files later.)
insert image description here
insert image description here
insert image description here
insert image description here
③: Enter cmd in the new folder and click "enter" to enter the command window. Of course, you can also open a software under QT as well. In order to bring up the command window under this path.
insert image description here
④: Enter the following statement in the command window, and then all the resources needed for the .exe to run will be automatically downloaded to this folder.
insert image description here
insert image description here
Step 2:
①: Download the software Inno Setup Compiler.
Official website address: http://www.jrsoftware.org/isdl.php#stable
②: After installing according to the steps, open it, click File->new, then click next.
insert image description here
The two first ones drawn with red lines are your software Name, the second one is the version you choose, you can choose it according to your heart, after filling it out, click next
insert image description here

Then select as shown in the figure below, and then click next
insert image description here
. There is one point that must be noted here. The place where the red line writes 1 must not default to the path file selected by it. If you want to change it to your own .exe file, it is generated by your own QT project. The path of the .exe file, and then click the button marked 2 to add a folder. For the added folder, select the folder including all the running resources of the .exe. For example, in the "D:\Software\1.0" folder on my side, if a pop-up window pops up, just click "Yes".
insert image description here
insert image description here
Here, you can directly default, of course, you can also modify
Please add a picture description
Please add a picture description
Please add a picture description
this picture according to your own needs. The first line here is to choose where the generated software will be output, and choose according to your needs. The second line is the name of the generated installation package. The third line is the icon of the software. I didn’t choose a new picture here, and I used the default one directly. The fourth line is a password that needs to be entered when installing and downloading after generating the installation package by myself. Set it yourself.
Please add a picture description
In this step, click next
Please add a picture description
and click finish
insert image description here
to generate a page as shown below. It is also possible that the pop-up window is in English. Click "Yes", and then the installation package will be generated, or if you click No, click on the picture. The green run button, let it run, if it does not run, the installation package will not be generated (personal experiment, if it does not run, there will be no installation package).
insert image description here
When closing the page in the above picture, a pop-up window may appear asking you if you want to save the changes on this page, just choose whether to save according to your needs.
Result display
1. Installation package: Double-click the installation package to enter the installation program. It is very simple and brainless installation. If you choose to generate a shortcut on the desktop, there will be a default icon as shown in the second picture. Double-click this icon to run software
insert image description here
insert image description here
**参考教程:**1.https://blog.csdn.net/weixin_36397141/article/details/90082156?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167627958416800225515230%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=167627958416800225515230&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~pc_rank_34-2-90082156-null-null.142v73pc_new_rank,201v4add_ask,239v1control&utm_term=%E4%B8%BA%E4%BB%80%E4%B9%88Inno%20Setup%20Compiler%E6%89%93%E5%8C%85%E6%88%90%E5%BA%94%E7%94%A8%E7%9A%84QT%E7%A8%8B%E5%BA%8F%E5%AE%89%E8%A3%85%E5%90%8E%E4%B8%8D%E6%98%BE%E7%A4%BA%E5%8A%9F%E8%83%BD%E7%95%8C%E9%9D%A2&spm=1018.2226.3001.4187
2.https://blog.csdn.net/weixin_29608475/article/details/113906451?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167627958416800225515230%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=167627958416800225515230&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~pc_rank_34-7-113906451-null-null.142v73pc_new_rank,201v4add_ask,239v1control&utm_term=%E4%B8%BA%E4%BB%80%E4%B9%88Inno%20Setup%20Compiler%E6%89%93%E5%8C%85%E6%88%90%E5%BA%94%E7%94%A8%E7%9A%84QT%E7%A8%8B%E5%BA%8F%E5%AE%89%E8%A3%85%E5%90%8E%E4%B8%8D%E6%98%BE%E7%A4%BA%E5%8A%9F%E8%83%BD%E7%95%8C%E9%9D%A2&spm=1018.2226.3001.4187

Guess you like

Origin blog.csdn.net/weixin_45866980/article/details/129016612