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 Offline
    R Offline
    rtvideo
    wrote on 22 Oct 2020, 14:09 last edited by
    #1

    Hello, I am trying to follow this tutorial by qt: https://doc.qt.io/qtinstallerframework/ifw-tutorial.html but I am confused at the "Creating Installer Content" Part. I have made my config.xml file and currently my layout is:

    /camera
    /packages
    /config
    config.xml
    /com.vendor.product
    /data
    /meta

    When it says - "Content to be installed is stored in the data directory of a component. As there is only one component, place the data in the packages/com.vendor.product/data directory. The example already contains a file for testing purposes, but you can place basically any files in the directory." How exactly is this done? Where do I get the components to put in the data folder?

    Also what needs to go into the packages and meta folders?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on 22 Oct 2020, 15:05 last edited by Bonnie
      #2

      Find Path_to_your_QtIFW\examples\tutorial directory. The example is there.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rtvideo
        wrote on 22 Oct 2020, 15:35 last edited by
        #3

        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 1 Reply Last reply 22 Oct 2020, 15:41
        0
        • R rtvideo
          22 Oct 2020, 15:35

          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 22 Oct 2020, 15:41 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 22 Oct 2020, 15:49 last edited by
            #5

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

            B 1 Reply Last reply 22 Oct 2020, 15:54
            0
            • R rtvideo
              22 Oct 2020, 15:49

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

              B Offline
              B Offline
              Bonnie
              wrote on 22 Oct 2020, 15:54 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 22 Oct 2020, 16:04 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 22 Oct 2020, 16:11
                0
                • R rtvideo
                  22 Oct 2020, 16:04

                  @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 22 Oct 2020, 16:11 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 22 Oct 2020, 16:24 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 22 Oct 2020, 16:41
                    0
                    • R rtvideo
                      22 Oct 2020, 16:24

                      @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 22 Oct 2020, 16:41 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
                      • K Offline
                        K Offline
                        KH-219Design
                        wrote on 22 Oct 2020, 17:25 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 22 Oct 2020, 17:52 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.

                          K 1 Reply Last reply 22 Oct 2020, 18:01
                          0
                          • R rtvideo
                            22 Oct 2020, 17:52

                            @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.

                            K Offline
                            K Offline
                            KH-219Design
                            wrote on 22 Oct 2020, 18:01 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 22 Oct 2020, 18:25 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

                              7/14

                              22 Oct 2020, 16:04

                              • Login

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