[Win] [] [qt qt5 packaged packaged into an executable file (with icons of any win can run oh)]

[Introduction]

  Business needs to win the qt packaged executable file. We do linux, and do nothing with Kirin system, the program runs in the win, Okay, re-packaged in a win qtcreator chant compiled.

 

【aims】

  1. qt program to add an icon.

  2.qt packaged.

  3. qt program after the package is made of a single file.

【text】

  1. Add a program icon to the qt:

    First, determine the program can correctly compile and run.

    Then a xxx.ico decentralization project file in the code directory, not too big picture just 32 * 32.

    And then open the .pro file for the project, in which joined RC_ICONS = xxx.ico.

    The last compiler run correctly, you can find the build directory with icons in the same directory of the code executable file.

  2.qt packaged:

    2.1. The program is now to be packaged with qt compile and run under Release mode again. // modified release pattern that is key to the implementation of the above click qt lower left corner of the small TV inside select (small TV the default selection debug).

    2.2. EXE program is found (in the build-xxx-Desktop-Release codes inside the same directory), copied to a separate folder, such as a new disk D xxx folder.

    2.3. Create a bat file, typing Notepad open cmd / k "cd / d [windeployqt.exe path of] && windeployqt.exe [path to pack the exe] (this path is the exe their new bond path to the file).

    For example: cmd / k "cd / d C: \ Qt \ Qt5.5.1 \ bin \ && windeployqt.exe D: \ xxx \ xxx.exe, and double-click to open a terminal xxx.bat file back to the file copy.

    2.4 Then enter D: \ xxx folder, click xxx.exe if run properly then the package is complete, xxx folder into can run on any win. If the pop-up warning xxx.dll went to look at qt program directory and copy it back. Up to run the program.

  3. qt packaged into a single file:

    3.1. Packaging single file need to use a packaging tool Enigma Virtual Box. // their casual next line on Baidu.

    3.2. Open the downloaded executable program toolkit click operation.

    3.3. Click the Browse button to select your xxx.exe file, the file will appear under your xxxCale.exe same path exe. This is your last package, you can also modify his position through the back of the browser.

    3.4. Click on the lower left corner of the Add button, select the second add directory tree, path is relative, your xxx folder selected. // This program requires a list of your resources.

    3.5. Click the bottom right corner of the File Options button and select virtualization startup files and compressed files. // This will make the file after you pack very small, less than 1/2.

    3.6. Finally, click the lower right corner of the button to perform packet.

    3.7. Packet end, there will be a xxxCalc.exe file in your specified folder or xxx.exe. Copy the file to your desktop to see the implementation of the program is wrong, correct you can distribute it to other people.

 

【postscript】

  winqt packaged it so simple, perhaps not relate to install it. Because of the demand, the installer may need to set what version of a lot of trouble to get gone. But this is enough. Individual pro-test can be used.

Have any problems in the implementation of the tutorial process, welcome to leave a message or comment oh.

 

 

  

  

Guess you like

Origin www.cnblogs.com/13373-/p/11315687.html