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. Qt installer framework
Forum Updated to NodeBB v4.3 + New Features

Qt installer framework

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 2.0k 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 Offline
    M Offline
    MaximK
    wrote on last edited by
    #1

    Good day!

    Please, help with the following issue:

    1. I have dll that is being used by multiple applications.
    2. I`ve created qt installer.
    3. I want to display names of applications that use my dll on the Introduction page of installer.

    For now the only idea that came to my mind is as following:

    Controller.prototype.IntroductionPageCallback = function()
    {
        var page = gui.currentPageWidget();
        if (page != null)
        {
            page.title = "<p style='font-size: 14px;" +
                                   "font-weight: normal;" +
                                   "font-style: italic;" +
                                    ("") +
                                   "font-variant: small-caps;'>" + copyright + " </p>";
    
            if (installer.isInstaller())
            {
                var msg = "";
    
                var ar = installer.execute("cmd", ['/C', 'tasklist', '/M']);
                msg += ar[0]
    
                page.MessageLabel.setText(msg);
            }
            if (installer.isUninstaller())
            {
                    gui.clickButton(buttons.NextButton);
            }
        }
    }
    

    But with such code, installer is no opening. Explain, please, why it does not work, thank you.

    P.S. When I change the command to ['/C', 'tasklist',] for example, it works fine, and shows the list of all processed on Introduction page.

    1 Reply Last reply
    0
    • AndySA Offline
      AndySA Offline
      AndyS
      Moderators
      wrote on last edited by
      #2

      @MaximK said in Qt installer framework:

      But with such code, installer is no opening. Explain, please, why it does not work, thank you.

      P.S. When I change the command to ['/C', 'tasklist',] for example, it works fine, and shows the list of all processed on Introduction page.

      Since it works without the /M then the problem is that the process doesn't seem to terminate which would explain why it doesn't show anything. Have you tried running it directly on a command line to see that tasklist /M would output here? It might be worth debugging it via a small example that uses QProcess too to see if that is outputting anything then too.

      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 2 Replies Last reply
      2
      • AndySA AndyS

        @MaximK said in Qt installer framework:

        But with such code, installer is no opening. Explain, please, why it does not work, thank you.

        P.S. When I change the command to ['/C', 'tasklist',] for example, it works fine, and shows the list of all processed on Introduction page.

        Since it works without the /M then the problem is that the process doesn't seem to terminate which would explain why it doesn't show anything. Have you tried running it directly on a command line to see that tasklist /M would output here? It might be worth debugging it via a small example that uses QProcess too to see if that is outputting anything then too.

        M Offline
        M Offline
        MaximK
        wrote on last edited by MaximK
        #3

        @AndyS Thank you for reply, I have tried to run this command in command line and it works fine. Also I have tried to run this code:

        QProcess process;
            QString exec = "cmd";
            QStringList params;
            params << "/C" << "tasklist" << "/M";
            int status = 0;
            status = process.execute(exec, params);
            process.close();
        

        It also works fine, prints all processes with loaded dlls. Still can not find the reason why installer can not execute it.

        1 Reply Last reply
        0
        • AndySA AndyS

          @MaximK said in Qt installer framework:

          But with such code, installer is no opening. Explain, please, why it does not work, thank you.

          P.S. When I change the command to ['/C', 'tasklist',] for example, it works fine, and shows the list of all processed on Introduction page.

          Since it works without the /M then the problem is that the process doesn't seem to terminate which would explain why it doesn't show anything. Have you tried running it directly on a command line to see that tasklist /M would output here? It might be worth debugging it via a small example that uses QProcess too to see if that is outputting anything then too.

          M Offline
          M Offline
          MaximK
          wrote on last edited by
          #4

          @AndyS Well, due to my impatience, I thought that command does not work, but id does, but very slowly. Added output to file:

          installer.execute('cmd.exe', ['/C', 'tasklist', '/M',  '>', 'temp']);
          

          It outputs information to file, but very slowly. So for now the problem is why the flag '/M' is not executed as fast as the rest of flags.

          1 Reply Last reply
          0
          • AndySA Offline
            AndySA Offline
            AndyS
            Moderators
            wrote on last edited by
            #5

            @MaximK is it fast in the QProcess instance? Qt IFW is just using QProcess anyway so it should perform in the same manner. But the handling of the output could be where the slowdown comes from inside IFW. In which case this is likely to be a bug in Qt IFW.

            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            M 1 Reply Last reply
            1
            • AndySA AndyS

              @MaximK is it fast in the QProcess instance? Qt IFW is just using QProcess anyway so it should perform in the same manner. But the handling of the output could be where the slowdown comes from inside IFW. In which case this is likely to be a bug in Qt IFW.

              M Offline
              M Offline
              MaximK
              wrote on last edited by MaximK
              #6

              @AndyS In Qt project I have invoked the same command using QProcess, and it works fast enough (creates output file for about 1 second). When invoking that command from installer it takes about 2-3 minutes to create output file

              AndySA 1 Reply Last reply
              0
              • M MaximK

                @AndyS In Qt project I have invoked the same command using QProcess, and it works fast enough (creates output file for about 1 second). When invoking that command from installer it takes about 2-3 minutes to create output file

                AndySA Offline
                AndySA Offline
                AndyS
                Moderators
                wrote on last edited by
                #7

                @MaximK Ok, that sounds like a bug in Qt IFW in how it handles the reading of the output. I would report that as a bug on JIRA so it can be investigated further.

                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                M 1 Reply Last reply
                1
                • AndySA AndyS

                  @MaximK Ok, that sounds like a bug in Qt IFW in how it handles the reading of the output. I would report that as a bug on JIRA so it can be investigated further.

                  M Offline
                  M Offline
                  MaximK
                  wrote on last edited by MaximK
                  #8

                  @AndyS Thank you, an interesting thing I tried is:
                  From installer invoke cmd which invokes python script that invoked os.exec('tasklist /M') and it worked fine, fast as invoking from QProccess)) But unfortunately I can not accept such decision, because I can not guarantee that python will be installed on clients PC.

                  So concerning my issue, may be you have some idea how can get the list of processes that are using my dll, and propose the user to close them before installation?

                  1 Reply Last reply
                  0
                  • AndySA Offline
                    AndySA Offline
                    AndyS
                    Moderators
                    wrote on last edited by
                    #9

                    Unfortunately I have no suggestions in that regard. I would report the bug at least as this should be fixed and might not be too difficult to do either.

                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    M 1 Reply Last reply
                    0
                    • AndySA AndyS

                      Unfortunately I have no suggestions in that regard. I would report the bug at least as this should be fixed and might not be too difficult to do either.

                      M Offline
                      M Offline
                      MaximK
                      wrote on last edited by
                      #10

                      @AndyS Anyway thank you

                      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