【问题标题】:Run shell process during QT Install Framework and wait for the result在 QT Install Framework 期间运行 shell 进程并等待结果
【发布时间】:2016-09-22 11:00:33
【问题描述】:

我想在使用 QT 安装框架期间运行一些 shell 命令,以恢复配置安装本身所需的信息(例如列出网络适配器)。

目前 IFW 似乎允许准备仅在安装程序配置过程之后运行的罐装 shell 操作(addOperationaddElevatedOperation)。

相反,我想在安装设置期间运行它们。例如。在安装程序页面之一中运行操作并检索结果。 比如:

Component.prototype.pageChanged = function (page) {
  if (page === QInstaller.ReadyForInstallation) {
    component.runOperation(...)
 }
};

【问题讨论】:

    标签: qt installation


    【解决方案1】:

    QT Installation Framework 安装程序提供了解决此问题的方法。

    您可以使用installer.performOperation 运行ConsumeOutput 操作。

    ConsumeOutput 允许运行外部进程并将进程输出存储到安装程序密钥中。

    【讨论】:

      【解决方案2】:

      我想运行一个外部进程并在我的 基于 Qt 安装程序框架的安装程序。我该怎么做?

      这可以通过native API(Windows 示例)或Qt QProcess::WaitOnFinish(更通用)来解决。因此,您可能需要以某种方式使用 C++ 代码解决安装程序的 API。

      【讨论】:

      • QProcess 是我的替代选择。但是,正如您所写,它需要修改 IFW 代码,这是我想避免的。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-19
      • 1970-01-01
      • 2014-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多