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. How to create a .qs file

How to create a .qs file

Scheduled Pinned Locked Moved Unsolved General and Desktop
29 Posts 5 Posters 12.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.
  • M mrjj
    18 Jun 2017, 19:09

    @tomy
    Just right click and create a text file then rename it. ( in your installer project folder)
    Its just a text file type and you add the commands manually.
    Seems to be nothing special you need to do.

    T Offline
    T Offline
    tomy
    wrote on 18 Jun 2017, 20:03 last edited by tomy
    #9

    @mrjj
    Very nifty mrjj. Thanks. :)

    And now what next, please?
    Some points in my mind:

    • Is the command I use (in CMD) correct?
    • Is it acceptable even if the pageform.ui file has nothing special?
    M 1 Reply Last reply 18 Jun 2017, 20:06
    1
    • T tomy
      18 Jun 2017, 20:03

      @mrjj
      Very nifty mrjj. Thanks. :)

      And now what next, please?
      Some points in my mind:

      • Is the command I use (in CMD) correct?
      • Is it acceptable even if the pageform.ui file has nothing special?
      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 18 Jun 2017, 20:06 last edited by
      #10

      @tomy
      Hi
      Ï have never used the installer framework so I cant tell.
      Did you try the simple example
      http://doc.qt.io/qtinstallerframework/ifw-tutorial.html
      to get to know it ?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tomy
        wrote on 18 Jun 2017, 20:36 last edited by
        #11

        Hi,
        Yeah, I used it. There should be some issue in paths in my stuff. :(

        M 1 Reply Last reply 18 Jun 2017, 20:40
        1
        • T tomy
          18 Jun 2017, 20:36

          Hi,
          Yeah, I used it. There should be some issue in paths in my stuff. :(

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 18 Jun 2017, 20:40 last edited by
          #12

          @tomy
          with spaces or what kind of issues?

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tomy
            wrote on 18 Jun 2017, 20:45 last edited by
            #13

            Please take a look at this:
            https://postimg.org/image/kaf5gm31t/

            M 1 Reply Last reply 18 Jun 2017, 20:50
            0
            • T tomy
              18 Jun 2017, 20:45

              Please take a look at this:
              https://postimg.org/image/kaf5gm31t/

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 18 Jun 2017, 20:50 last edited by
              #14

              @tomy
              Oh, there is something in the files it dont like. it seems.

              When you tried the example , no errors were displayed?

              T 1 Reply Last reply 18 Jun 2017, 21:01
              1
              • M mrjj
                18 Jun 2017, 20:50

                @tomy
                Oh, there is something in the files it dont like. it seems.

                When you tried the example , no errors were displayed?

                T Offline
                T Offline
                tomy
                wrote on 18 Jun 2017, 21:01 last edited by
                #15

                @mrjj
                The code is of months ago but the Qt_Calculator.exe of Release mode now works fine in the data folder.
                I think the problem is of either installscript.qs file or pageform.ui file. :(

                M 1 Reply Last reply 18 Jun 2017, 21:02
                0
                • T tomy
                  18 Jun 2017, 21:01

                  @mrjj
                  The code is of months ago but the Qt_Calculator.exe of Release mode now works fine in the data folder.
                  I think the problem is of either installscript.qs file or pageform.ui file. :(

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 18 Jun 2017, 21:02 last edited by
                  #16

                  @tomy
                  But the errors seems to point to package.xml ?

                  1 Reply Last reply
                  1
                  • T Offline
                    T Offline
                    tomy
                    wrote on 18 Jun 2017, 21:05 last edited by tomy
                    #17

                    This is the contents of that file:
                    https://postimg.org/image/hsuszqcel/

                    I see nothing clearly wrong in it.

                    M 1 Reply Last reply 18 Jun 2017, 21:09
                    0
                    • T tomy
                      18 Jun 2017, 21:05

                      This is the contents of that file:
                      https://postimg.org/image/hsuszqcel/

                      I see nothing clearly wrong in it.

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 18 Jun 2017, 21:09 last edited by
                      #18

                      @tomy
                      well the errors says it wont use name, but i fail to see the "meta" it talks about.
                      It also says the default and virtual should not be used together so maybe try to remove one?

                      T 1 Reply Last reply 18 Jun 2017, 21:21
                      1
                      • M mrjj
                        18 Jun 2017, 21:09

                        @tomy
                        well the errors says it wont use name, but i fail to see the "meta" it talks about.
                        It also says the default and virtual should not be used together so maybe try to remove one?

                        T Offline
                        T Offline
                        tomy
                        wrote on 18 Jun 2017, 21:21 last edited by
                        #19

                        @mrjj
                        Well it worked, not completely although. :)

                        I removed that virtual line in the package.xml. And it is in the meta folder. Please look:
                        https://postimg.org/image/u84mw60p9/

                        Then re-done the command. It again returned some issues:
                        https://postimg.org/image/y1wdy7ihz/

                        It finally created an installer in the Result folder on desktop. But It doesn't put a shortcut of the program on desktop, and it's the contents of the installation folder:
                        https://postimg.org/image/kvdfu4zcb/

                        I think now I should somehow change the contents of installscript.qs file.

                        M 1 Reply Last reply 18 Jun 2017, 21:27
                        0
                        • T tomy
                          18 Jun 2017, 21:21

                          @mrjj
                          Well it worked, not completely although. :)

                          I removed that virtual line in the package.xml. And it is in the meta folder. Please look:
                          https://postimg.org/image/u84mw60p9/

                          Then re-done the command. It again returned some issues:
                          https://postimg.org/image/y1wdy7ihz/

                          It finally created an installer in the Result folder on desktop. But It doesn't put a shortcut of the program on desktop, and it's the contents of the installation folder:
                          https://postimg.org/image/kvdfu4zcb/

                          I think now I should somehow change the contents of installscript.qs file.

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 18 Jun 2017, 21:27 last edited by
                          #20

                          @tomy
                          Yes the installscript.qs should contain the actual
                          code to execute while installing.

                          1 Reply Last reply
                          1
                          • T Offline
                            T Offline
                            tomy
                            wrote on 18 Jun 2017, 21:30 last edited by tomy
                            #21

                            Yes, it seems to be the last important issue on the app. How to change it to work fine, please?
                            This is its code:

                            function Component()
                            {
                                // Install to @RootDir@ instead of @HomeDir@ on Windows
                                if (installer.value("os") === "win") {
                                    var homeDir = installer.value("HomeDir");
                                    var targetDir = installer.value("TargetDir").replace(homeDir, "@RootDir@");
                                    installer.setValue("TargetDir", targetDir);
                                }
                            
                                // do not show component selection page
                                installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
                                // no startmenu entry so no need to ask where to create it
                                installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
                            }
                            
                            M 1 Reply Last reply 18 Jun 2017, 21:45
                            0
                            • T tomy
                              18 Jun 2017, 21:30

                              Yes, it seems to be the last important issue on the app. How to change it to work fine, please?
                              This is its code:

                              function Component()
                              {
                                  // Install to @RootDir@ instead of @HomeDir@ on Windows
                                  if (installer.value("os") === "win") {
                                      var homeDir = installer.value("HomeDir");
                                      var targetDir = installer.value("TargetDir").replace(homeDir, "@RootDir@");
                                      installer.setValue("TargetDir", targetDir);
                                  }
                              
                                  // do not show component selection page
                                  installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
                                  // no startmenu entry so no need to ask where to create it
                                  installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
                              }
                              
                              M Offline
                              M Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on 18 Jun 2017, 21:45 last edited by
                              #22

                              @tomy
                              That i dont know
                              It seems to be commands from
                              http://doc.qt.io/qtinstallerframework/scripting.html

                              So you will also need some copy commands from ( i think)
                              http://doc.qt.io/qtinstallerframework/operations.html

                              1 Reply Last reply
                              2
                              • T Offline
                                T Offline
                                tomy
                                wrote on 18 Jun 2017, 21:53 last edited by
                                #23

                                OK, mate. I will read both posts precisely and will post again to you here about the results.

                                1 Reply Last reply
                                1
                                • T Offline
                                  T Offline
                                  tomy
                                  wrote on 19 Jun 2017, 15:28 last edited by
                                  #24

                                  I read the pages and changed the installscript.qs to this:

                                  function Component()
                                  {
                                      if (installer.value("os") === "win")
                                        {
                                           installer.setValue("ApplicationsDir", "ApplicationsDir");
                                           component.addOperation("CreateShortcut",
                                           "@DesktopDir@/Qt_Calculator.exe", "@StartMenuDir@/Qt_Calculator.lnk");
                                        }
                                  }
                                  

                                  My purposes were to first make the app be installed in C:\ProgramFiles folder and then to have a shortcut of the app on my Desktop.
                                  The data folder contains a Qt_Calculator.icon file. These are all contents of that folder:
                                  https://postimg.org/image/f3fddnww5/

                                  Then I again used this command:
                                  C:\Users\Abbasi\Desktop\package_directory\packages\com.vendor.product\data> C:\Qt\QtIFW2.0.1\bin\binarycreator.exe -c C:\Users\Abbasi\Desktop\package_directory\config\config.xml -p C:\Users\Abbasi\Desktop\package_directory\packages C:\Users\Abbasi\Desktop\Result\Qt_Calculator.exe

                                  I got an error and a warning as below:
                                  https://postimg.org/image/w6p5ajr25/

                                  At the end, it created the installer but it works this way:
                                  It creates an installer file in the Result folder and have the default path of C:\Users\Abbasi for installation and after installing it creates no shourcut on the Desktop.

                                  1 Reply Last reply
                                  0
                                  • R Offline
                                    R Offline
                                    Ratzz
                                    wrote on 22 Jun 2017, 13:17 last edited by
                                    #25

                                    @tomy
                                    I used this

                                    Component.prototype.createOperations = function()
                                    {
                                        try {
                                            // call the base create operations function
                                            component.createOperations();
                                            if (installer.value("os") == "win") { 
                                                try {
                                                    var userProfile = installer.environmentVariable("USERPROFILE");
                                                    installer.setValue("UserProfile", userProfile);
                                    				component.addOperation("CreateShortcut", "@TargetDir@/MyApp.exe", "@UserProfile@/Desktop/MyApp.lnk" ,"workingDirectory=@TargetDir@", "iconPath=@TargetDir@/MyApp.ico");			
                                    				component.addOperation("CreateShortcut", "@TargetDir@/MyApp.exe", "@TargetDir@/MyApp.lnk" ,"workingDirectory=@TargetDir@", "iconPath=@TargetDir@/MyApp.ico");			
                                    				component.addOperation("CreateShortcut", "@TargetDir@/MyApp.exe", "@StartMenuDir@/MyApp.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/MyApp.ico");
                                                } catch (e) {
                                                    // Do nothing if key doesn't exist
                                                }
                                            }
                                        } catch (e) {
                                            print(e);
                                        }
                                    }

                                    --Alles ist gut.

                                    1 Reply Last reply
                                    3
                                    • T Offline
                                      T Offline
                                      tomy
                                      wrote on 22 Jun 2017, 13:40 last edited by tomy
                                      #26

                                      Thank you for your reply, I used your code and only changed MyApp to Qt_Calculator but it even didn't create the installer! :( :(

                                      Component.prototype.createOperations = function()
                                      {
                                          try {
                                              // call the base create operations function
                                              component.createOperations();
                                              if (installer.value("os") == "win") {
                                                  try {
                                                      var userProfile = installer.environmentVariable("USERPROFILE");
                                                      installer.setValue("UserProfile", userProfile);
                                                                      component.addOperation("CreateShortcut", "@TargetDir@/Qt_Calculator.exe", "@UserProfile@/Desktop/Qt_Calculator.lnk" ,"workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Qt_Calculator.ico");
                                                                      component.addOperation("CreateShortcut", "@TargetDir@/Qt_Calculator.exe", "@TargetDir@/Qt_Calculator.lnk" ,"workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Qt_Calculator.ico");
                                                                      component.addOperation("CreateShortcut", "@TargetDir@/Qt_Calculator.exe", "@StartMenuDir@/Qt_Calculator.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Qt_Calculator.ico");
                                                  } catch (e) {
                                                      // Do nothing if key doesn't exist
                                                  }
                                              }
                                          } catch (e) {
                                              print(e);
                                          }
                                      }
                                      

                                      I used the command below and got errors:

                                      alt text

                                      And my data folder consists of:

                                      alt text

                                      J.HilkJ 1 Reply Last reply 22 Jun 2017, 15:09
                                      0
                                      • T tomy
                                        22 Jun 2017, 13:40

                                        Thank you for your reply, I used your code and only changed MyApp to Qt_Calculator but it even didn't create the installer! :( :(

                                        Component.prototype.createOperations = function()
                                        {
                                            try {
                                                // call the base create operations function
                                                component.createOperations();
                                                if (installer.value("os") == "win") {
                                                    try {
                                                        var userProfile = installer.environmentVariable("USERPROFILE");
                                                        installer.setValue("UserProfile", userProfile);
                                                                        component.addOperation("CreateShortcut", "@TargetDir@/Qt_Calculator.exe", "@UserProfile@/Desktop/Qt_Calculator.lnk" ,"workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Qt_Calculator.ico");
                                                                        component.addOperation("CreateShortcut", "@TargetDir@/Qt_Calculator.exe", "@TargetDir@/Qt_Calculator.lnk" ,"workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Qt_Calculator.ico");
                                                                        component.addOperation("CreateShortcut", "@TargetDir@/Qt_Calculator.exe", "@StartMenuDir@/Qt_Calculator.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Qt_Calculator.ico");
                                                    } catch (e) {
                                                        // Do nothing if key doesn't exist
                                                    }
                                                }
                                            } catch (e) {
                                                print(e);
                                            }
                                        }
                                        

                                        I used the command below and got errors:

                                        alt text

                                        And my data folder consists of:

                                        alt text

                                        J.HilkJ Online
                                        J.HilkJ Online
                                        J.Hilk
                                        Moderators
                                        wrote on 22 Jun 2017, 15:09 last edited by
                                        #27

                                        Hi @tomy the QInstallerFramework can be confusing, especiall if you don't have a workign example, like it seems to be the case for you.

                                        I went and uploded the InstallerFramework example for an Installer with a -Windows- Start Menu entry.

                                        Let's see if the fileupload system of the updated forum works:
                                        seems like a admin/mod only thing.
                                        External link here:

                                        It boils down to a few steps that we can walk through, if you want to.

                                        if you unzip the file, you get a folder with 2 subfolders config and packages
                                        in the config folder you'll find the config.xml,
                                        This one has information about your Installer over all, infos about your app the developer, release date, links to repositories(only needed for online installer)

                                        In packages you'll find 2 folders data and meta. in Data you place all needed dlls files exe's you need to run your Application without Qt-Installed on your system.

                                        In meta you place the installer script file additional ui-files licenzes etc.

                                        Now open your cmd-line tool on windows.

                                        Win-Key + R
                                        cmd
                                        Enter //ctrl +shift+ enter for elevated rights
                                        
                                        //cd to your folder that contains config- and packages folders
                                        cd c:\Path\To\example\startmenu
                                        
                                        //now enter:
                                        c:\Path\to\QtInstallerFrameWork\bin\binarycreator.exe --offline-only -c config\config.xml -p packages TheNameYourInstallerShallHave.exe
                                        

                                        let's see if you still get errors.


                                        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                        Q: What's that?
                                        A: It's blue light.
                                        Q: What does it do?
                                        A: It turns blue.

                                        1 Reply Last reply
                                        2
                                        • M Offline
                                          M Offline
                                          mrjj
                                          Lifetime Qt Champion
                                          wrote on 22 Jun 2017, 15:13 last edited by
                                          #28

                                          Hmm, only some types are allowed it seems. ( even for mods)
                                          alt text

                                          1 Reply Last reply
                                          1

                                          18/29

                                          18 Jun 2017, 21:09

                                          • Login

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