Solved Qt installer framework
-
Good day!
Please, help with the following issue:
- I have dll that is being used by multiple applications.
- I`ve created qt installer.
- 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.
-
@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.
-
@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.
-
@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.
-
@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.
-
@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
-
-
@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?
-
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.
-
@AndyS Anyway thank you