Release of DMG in QT Mac software release

Source: Internet
Author: User
1. First of all, use QT creator to compile a release version of the software.

 

 

Note that the size of the compiled library is very small, only kb, because some class libraries are not included yet. Now you can only run it locally, and copy it to other Mac computers.

 

2. A tool named macdeployqt under the bin directory of the app QT installation directory is used for program packaging. It is very easy to use. Switch to the bin directory and execute

./Macdeployqt yourappname. App. A new large app is automatically generated in the directory where yourappname. app is located.


I have not studied how to package some third-party class libraries.

 

3. Add an icon to the app

 

Right-click your app and choose show Package content. There is a file named info. plist, which records a lot of information about the software, and the icon information is also recorded here.

First, copy the file with the extension of the icon icns to the resources directory. For icns production, view the article "icns icon production in QT Mac" and edit the info. plist file. Bid information.

[HTML]View plaincopy
  1. <? XML version = "1.0" encoding = "UTF-8"?>
  2. <! Doctype plist public "-// Apple // DTD plist 1.0 // en" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3. <Plist version = "1.0">
  4. <Dict>
  5. <Key> nsprincipalclass </key>
  6. <String> nsapplication </string>
  7. <Key> cfbundleiconfile </key>
  8. <String> icon. icns </string>
  9. <Key> cfbundlepackagetype </key>
  10. <String> appl </string>
  11. <Key> cfbundlegetinfostring </key>
  12. <String> created by QT/qmake </string>
  13. <Key> cfbundlesignature </key>
  14. <String> ???? </String>
  15. <Key> cfbundleexecutable </key>
  16. <String> textureunpacker </string>
  17. <Key> cfbundleidentifier </key>
  18. <String> @ [email protected] </string>
  19. <Key> note </key>
  20. <String> This file was generated by QT/qmake. </string>
  21. </Dict>
  22. </Plist>

Is the value of cfbundleiconfile key. Of course, after this step, we found that the app icon is still the default, but it is not changed to the icon we want. At this time, right-click the app, select the display information (getinfo), and drag the icns file to the icon position in the upper left corner.


4. Generate the DMG file app. Let's take a look at how to generate the DMG file. Create a blank DMG image using disk utility, file-> New-> blank disk image

The size here is 100 MB, and the final DMG file will be automatically cropped out. Double-click the blank window "textureunpacker". Everything is laid out here. Prepare a background image. The following are the images I used for packaging:

Right-click the blank space (or choose the menu mode), select "show view options", select the background as picture, and drag the image to be used as the background.


Drag the app we created above to "textureunpacker" and make alias another application shortcut (right-click and choose make alias)
The final result is as follows:
Convert the DMG. If there is no disk utility, drag it back and right-click textureunpacker. DMG-> convert "textureunpacker"
Add an icon to DMG. Like the icon in the app above, right-click get info and drag icns to the icon position.

Double-click the DMG file to check whether it is expected (ignore the hidden files ):
 

Is it cool to see your own software appear in the application?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.