Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Creating a installer for my QT program
QtWS25 Last Chance

Creating a installer for my QT program

Scheduled Pinned Locked Moved Unsolved General and Desktop
building
14 Posts 3 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R rtvideo

    I see that, it was useful on how to do the package.xml and config, but I still unsure on how to properly do the data part. I see on this link at the bottom of the page https://doc.qt.io/qtinstallerframework/ifw-component-description.html#meta-directory It says you must package the data as a 7zip archive. I just am unsure of what exactly to be putting inside that zip.

    B Offline
    B Offline
    Bonnie
    wrote on last edited by Bonnie
    #4

    @rtvideo said in Creating a installer for my QT program:

    It says you must package the data as a 7zip archive

    As far as I know, you don't need to do that.
    The example doesn't do that, either.
    You just put what you want to install, like exes and dlls.

    For example, if you want

    [Target Dir]
    > [folder]
    > exe
    > dll
    

    Then you should put

    [com.vendor.product]
    > [data]
      > [folder]
      > exe
      > dll
    
    1 Reply Last reply
    0
    • R Offline
      R Offline
      rtvideo
      wrote on last edited by
      #5

      @Bonnie I am working on Linux so should it be the .so files?

      B 1 Reply Last reply
      0
      • R rtvideo

        @Bonnie I am working on Linux so should it be the .so files?

        B Offline
        B Offline
        Bonnie
        wrote on last edited by
        #6

        @rtvideo
        That doesn't matter, anything YOU want to install.
        The installer doesn't care about what are they.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rtvideo
          wrote on last edited by
          #7

          @Bonnie I just want to make sure I have this right - Doing this approach could allow me to send this installer to another machine and you could run my program on that new machine without having qt installed? Because you have the binary file?

          B 1 Reply Last reply
          0
          • R rtvideo

            @Bonnie I just want to make sure I have this right - Doing this approach could allow me to send this installer to another machine and you could run my program on that new machine without having qt installed? Because you have the binary file?

            B Offline
            B Offline
            Bonnie
            wrote on last edited by Bonnie
            #8

            @rtvideo
            That doesn't have to use an installer.
            If properly deployed, you can just pack the deploy folder to an archive file and copy the archive to other machine.
            The key point here is deploying, not making an installer.
            Making an installer still need you to deploy first, as I said, it doesn't care what you put in it.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rtvideo
              wrote on last edited by
              #9

              @Bonnie Would you have a direct link anywhere I can go over a tutorial on how to deploy correctly to another machine like how you described?

              B 1 Reply Last reply
              0
              • R rtvideo

                @Bonnie Would you have a direct link anywhere I can go over a tutorial on how to deploy correctly to another machine like how you described?

                B Offline
                B Offline
                Bonnie
                wrote on last edited by
                #10

                @rtvideo
                Well, there is https://doc.qt.io/qt-5/deployment.html
                For windows, in the Qt bin folder there is a tool named windeployqt.exe which can help to deploy.
                I don't know if there is something like that in linux.
                If you have problems about deployment in Linux, you can open a new topic.

                1 Reply Last reply
                2
                • KH-219DesignK Offline
                  KH-219DesignK Offline
                  KH-219Design
                  wrote on last edited by
                  #11

                  In my understanding (and I welcome corrections if I am mistaken), windeployqt and macdeployqt are "officially" or at least semi-officially supported/endorsed by Qt. On Linux, there exists a similar tool called linuxdeployqt, but it is less official. Don't let that deter you, though. I have used it with ease and success, and in my experience it is quite solid and reliable.

                  Their project: https://github.com/probonopd/linuxdeployqt

                  I am using linuxdeployqt in a public GitHub repo that you can examine if you find that sort of thing helpful.

                  My script is here: https://github.com/219-design/qt-qml-project-template-with-ci/blob/0a696e808621/install_linux.sh

                  GitHub CI is active in my template project, so you can also go to "Actions" (the name GitHub uses for automated CI jobs) and examine as many raw logs of this running as you wish :)

                  There are 3 main parts to the script:

                  The first part creates a staging directory with an internal structure that is prescribed by linuxdeployqt. At the end of that first part, you have a directory that looks like this:

                  AppImage_staging/
                  └── usr
                      ├── bin
                      │   ├── app
                      │   ├── event_filter.o
                      │   ├── gui_tests.o
                      │   ├── libapp.so
                      │   ├── libapp.so.1
                      │   ├── libapp.so.1.0
                      │   ├── libapp.so.1.0.0
                      │   ├── liblibstylesplugin.so
                      │   ├── libminutil.so
                      │   ├── libminutil.so.1
                      │   ├── libminutil.so.1.0
                      │   ├── libminutil.so.1.0.0
                      │   ├── libtestmain.so
                      │   ├── libtestmain.so.1
                      │   ├── libtestmain.so.1.0
                      │   ├── libtestmain.so.1.0.0
                      │   ├── lib_tests
                      │   ├── libutil.so
                      │   ├── libutil.so.1
                      │   ├── libutil.so.1.0
                      │   ├── libutil.so.1.0.0
                      │   ├── main.o
                      │   ├── Makefile
                      │   ├── moc_event_filter.cpp
                      │   ├── moc_event_filter.o
                      │   ├── moc_gui_tests.cpp
                      │   ├── moc_gui_tests.o
                      │   ├── moc_predefs.h
                      │   └── view_model_collection.o
                      ├── lib
                      └── share
                          ├── applications
                          │   └── app.desktop
                          └── icons
                              └── hicolor
                                  └── 256x256
                                      └── apps
                                          └── app.png
                  

                  All the contents that were copied into AppImage_staging/usr/bin/ were produced during my build.

                  The contents of AppImage_staging/usr/share/, in contrast, are not artifacts of the build, but are rather supporting icons and supporting files that are committed in the git repository and rarely change.

                  The second part of the script (see line 37) uses wget to download an app image of linuxdeployqt itself. (In an admirable case of "dogfooding", the linuxdeployqt folks deploy their own software in app image format.)

                  It isn't until the last command of the script that the 3rd and final task takes place.

                  Finally on line 51 we invoke linuxdeployqt.

                  After running linuxdeployqt, the staging folder is now "fully baked". It now contains a heck of a lot more libraries and other supporting files (in particular, QML files).

                  That folder can then be zipped or tarred (or just copied to an external USB drive), and you will be able to take that folder to any other Ubuntu 18 system and run the app regardless of whether "apt-get" versions of Qt have been installed on that system or not.

                  I have only needed to go so far as creating this "full baked" folder. However, if you want to produce a single-file app image, then just add the -appimage option when invoking linuxdeployqt. (My script does not add the -appimage option.)

                  www.219design.com
                  Software | Electrical | Mechanical | Product Design

                  1 Reply Last reply
                  1
                  • R Offline
                    R Offline
                    rtvideo
                    wrote on last edited by
                    #12

                    @KH-219Design Thank you for the detailed response, I have seen linuxdeploy before, but dont you need a very early release of Ubuntu for it to work for you? I think I tried with 18.04 a while back and it would not work.

                    KH-219DesignK 1 Reply Last reply
                    0
                    • R rtvideo

                      @KH-219Design Thank you for the detailed response, I have seen linuxdeploy before, but dont you need a very early release of Ubuntu for it to work for you? I think I tried with 18.04 a while back and it would not work.

                      KH-219DesignK Offline
                      KH-219DesignK Offline
                      KH-219Design
                      wrote on last edited by
                      #13

                      @rtvideo said in Creating a installer for my QT program:

                      @KH-219Design Thank you for the detailed response, I have seen linuxdeployqt before, but dont you need a very early release of Ubuntu for it to work for you? I think I tried with 18.04 a while back and it would not work.

                      Historically that was the case. However, at some point they acquiesced to all the constant requests/pressure/bug-reporting and added the CLI option -unsupported-allow-new-glibc, which you can see being employed by me here.

                      When you use that option, linuxdeployqt will emit this warning in the log, but otherwise everything proceeds just fine:

                      2020-09-12T01:21:59.2440495Z WARNING: Not checking glibc on the host system.
                      2020-09-12T01:21:59.2440877Z          The resulting AppDir or AppImage may not run on older systems.
                      

                      My GitHub "Actions" that I mentioned earlier are running on the Ubuntu 18 GitHub runner.

                      www.219design.com
                      Software | Electrical | Mechanical | Product Design

                      1 Reply Last reply
                      1
                      • R Offline
                        R Offline
                        rtvideo
                        wrote on last edited by
                        #14

                        @KH-219Design Okay great I will take a look over this and see if I can get it working as well, thank you!

                        1 Reply Last reply
                        1

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved