Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt in Windows Docker container
QtWS25 Last Chance

Qt in Windows Docker container

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
11 Posts 5 Posters 10.6k 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.
  • F Offline
    F Offline
    Felix Maurer
    wrote on last edited by
    #1

    Hi,

    I'm developing a Qt application on Windows. Currently I'm trying to automate the build process.
    I wanted to try using Docker containrs, to have a reliable build environment. However, I'm stuck at creating an image that contains a Qt installation. I have a Windows image that contains the msvc2017 toolchain but I don't know how to install Qt into the image in a non-interactive fashion.

    Is there a way to install Qt on Windows without a graphical installer? I tried the offline installer and a script but was unsuccessful.

    Regards
    Felix

    U 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What script are you using ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Felix Maurer
        wrote on last edited by Felix Maurer
        #3

        I used the script I found on StackOverflow and tried to modify it based on the documentation and the commets in this bug report.

        function Controller() {
            //gui.setSilent(true);
        	
            //installer.autoRejectMessageBoxes();
            installer.installationFinished.connect(function() {
                gui.clickButton(buttons.NextButton);
            })
        }
        
        Controller.prototype.WelcomePageCallback = function() {
            gui.clickButton(buttons.NextButton);
        }
        
        Controller.prototype.IntroductionPageCallback = function() {
            gui.clickButton(buttons.NextButton);
        }
        
        Controller.prototype.CredentialsPageCallback = function() {
            gui.clickButton(buttons.SkipButton);
        }
        
        Controller.prototype.TargetDirectoryPageCallback = function()
        {
            gui.currentPageWidget().TargetDirectoryLineEdit.setText("C:/Qt");
            gui.clickButton(buttons.NextButton);
        }
        
        Controller.prototype.ComponentSelectionPageCallback = function() {
            var widget = gui.currentPageWidget();
        
            widget.deselectAll();
        	widget.selectComponent("qt.595.win64_msvc2017_64");
        	widget.selectComponent("qt.595.qtcharts.win64_msvc2017_64");
        	
            gui.clickButton(buttons.NextButton);
        }
        
        Controller.prototype.LicenseAgreementPageCallback = function() {
            gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
            gui.clickButton(buttons.NextButton);
        }
        
        Controller.prototype.StartMenuDirectoryPageCallback = function() {
            gui.clickButton(buttons.NextButton);
        }
        
        Controller.prototype.ReadyForInstallationPageCallback = function()
        {
            gui.clickButton(buttons.NextButton);
        }
        
        Controller.prototype.FinishedPageCallback = function() {
        	var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
        	if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
        		checkBoxForm.launchQtCreatorCheckBox.checked = false;
        	}
            gui.clickButton(buttons.FinishButton);
        }
        

        The installer opens but nothing happens. Furthermore, I can click buttons but only jump between the first two pages of the installer.

        I called the installer like this C:\Users\mrf\qt-opensource-windows-x86-5.9.5.exe --verbose --script .\qt-noninteractive.qs.

        1 Reply Last reply
        0
        • F Felix Maurer

          Hi,

          I'm developing a Qt application on Windows. Currently I'm trying to automate the build process.
          I wanted to try using Docker containrs, to have a reliable build environment. However, I'm stuck at creating an image that contains a Qt installation. I have a Windows image that contains the msvc2017 toolchain but I don't know how to install Qt into the image in a non-interactive fashion.

          Is there a way to install Qt on Windows without a graphical installer? I tried the offline installer and a script but was unsuccessful.

          Regards
          Felix

          U Offline
          U Offline
          user2301
          wrote on last edited by
          #4

          @Felix-Maurer Hi, were you able to create QT docker container?

          1 Reply Last reply
          0
          • U Offline
            U Offline
            user2301
            wrote on last edited by user2301
            #5

            I also tried but no luck. Below is the dockerfile and qt-installer-non-interactive.qs.
            I get this Network error: [ QNetworkReply::NetworkError(UnknownNetworkError) ] "Failed to connect to server. Check your network connection and try again."

            function Controller() {
                installer.autoRejectMessageBoxes();
                installer.installationFinished.connect(function() {
                    gui.clickButton(buttons.NextButton);
                })
            }
            
            Controller.prototype.WelcomePageCallback = function() {
                gui.clickButton(buttons.NextButton, 3000);
            }
            
            Controller.prototype.CredentialsPageCallback = function() {
                gui.clickButton(buttons.NextButton);
            }
            
            Controller.prototype.IntroductionPageCallback = function() {
                gui.clickButton(buttons.NextButton);
            }
            
            Controller.prototype.TargetDirectoryPageCallback = function()
            {
                gui.currentPageWidget().TargetDirectoryLineEdit.setText("C:\\Qt");
                gui.clickButton(buttons.NextButton);
            }
            
            Controller.prototype.ComponentSelectionPageCallback = function() {
                var widget = gui.currentPageWidget();
            
                widget.deselectAll();
                //widget.selectComponent("qt.55.gcc_64");
                //widget.selectComponent("qt.55.qtquickcontrols");
            
                widget.selectComponent("qt.tools.qtcreator");
                widget.selectComponent("qt.tools.vcredist_msvc2015_x64");
                widget.selectComponent("qt.qt5.5101.win64_msvc2015_64");
                widget.deselectComponent("qt.tools.vcredist_msvc2015_x86");
                //widget.deselectComponent("qt.55.qtquick1");
                //widget.deselectComponent("qt.55.qtscript");
                //widget.deselectComponent("qt.55.qtwebengine");
                //widget.deselectComponent("qt.extras");
                widget.deselectComponent("qt.qt5.5101.doc");
                widget.deselectComponent("qt.qt5.5101.examples");
            
                gui.clickButton(buttons.NextButton);
            }
            
            Controller.prototype.LicenseAgreementPageCallback = function() {
                gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
                gui.clickButton(buttons.NextButton);
            }
            
            Controller.prototype.StartMenuDirectoryPageCallback = function() {
                gui.clickButton(buttons.NextButton);
            }
            
            Controller.prototype.ReadyForInstallationPageCallback = function()
            {
                gui.clickButton(buttons.NextButton);
            }
            
            Controller.prototype.FinishedPageCallback = function() {
            var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
            if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
                checkBoxForm.launchQtCreatorCheckBox.checked = false;
            }
                gui.clickButton(buttons.FinishButton);
            }
            
            FROM microsoft/windowsservercore:10.0.14393.2189
            
            COPY ["./install", "C:/tmp/qt"]
            
            RUN ["C:\\tmp\\qt\\qt-opensource-windows-x86-5.10.1.exe", "--script C:\\tmp\\qt\\qt-installer-noninteractive.qs"]
            
            ENV PATH "$PATH:C:\Qt\Qt5.10.1"
            
            ENV PATH "$PATH:C:\Program Files (x86)\Microsoft Visual Studio 15.0\VC"
            
            CMD ["vcvarsall.bat", "x86_amd64"]
            
            1 Reply Last reply
            0
            • F Offline
              F Offline
              Felix Maurer
              wrote on last edited by
              #6

              I haven't retried it yet but will again in some days.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mkalinow
                wrote on last edited by
                #7

                Hi,

                this is the Docker setup we use to create QBS builds. Maybe that can be of help even though this is made for Linux.

                http://code.qt.io/cgit/qbs/qbs.git/tree/docker/stretch/Dockerfile

                1 Reply Last reply
                2
                • M Offline
                  M Offline
                  mkalinow
                  wrote on last edited by
                  #8

                  And here it is for Windows:
                  http://code.qt.io/cgit/qbs/qbs.git/tree/docker/windowsservercore/Dockerfile

                  U 1 Reply Last reply
                  2
                  • F Offline
                    F Offline
                    Felix Maurer
                    wrote on last edited by
                    #9

                    Very cool thanks! That did work for me. Now I just have to adjust it to our needs.

                    Pablo J. RoginaP 1 Reply Last reply
                    1
                    • F Felix Maurer

                      Very cool thanks! That did work for me. Now I just have to adjust it to our needs.

                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on last edited by
                      #10

                      @Felix-Maurer if your issue is solved, please don't forget to mark your post as such. Thanks.

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      1 Reply Last reply
                      0
                      • M mkalinow

                        And here it is for Windows:
                        http://code.qt.io/cgit/qbs/qbs.git/tree/docker/windowsservercore/Dockerfile

                        U Offline
                        U Offline
                        user2301
                        wrote on last edited by
                        #11

                        @mkalinow I tried the above script but it did not work due to network issues. Is it possible to create docker build without connecting to internet or download offline?

                        1 Reply Last reply
                        0

                        • Login

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