如何编写Qt安装程序的脚本 [英] How to write the scripts for Qt Installer

查看:408
本文介绍了如何编写Qt安装程序的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写我的第一个Qt安装程序,但遇到了麻烦.在安装程序的一个软件包中,我需要在安装结束时运行.exe文件,并添加一个环境变量.

我认为方法是使用package.xml文件中的script选项,但是我不知道如何编写该脚本,我无法在任何地方找到逐步说明的逐步解释.

有人可以帮忙吗?

解决方案

我最近遭受了与自己相同的命运,但是在大多数情况下,我设法从Qt安装程序框架示例中实现了您想要做的事情和文档可在此处找到 http://qt-project.org/doc/qtinstallerframework-1.5/index.html http://doc.qt.io/qtinstallerframework/qtifwexamples. html .

这些页面上提供的信息有点模棱两可,但是通过一些试验,您应该能够创建所需的安装脚本.

您要实现安装脚本的package.xml文件要求您添加

<Script>installscript.qs</Script> 

标签,并且installscript.qs其自身应位于该程序包的meta文件夹中.然后,installscript.qs将包含

component.addOperation("Execute".....)

命令将执行所需的.exe.可以使用执行操作来运行批处理文件,以在用户系统上创建该变量,从而对环境变量执行相同的过程.

在过去的几周中,我一直在尝试实施qt安装程序框架文档中详细介绍的自定义操作,但到目前为止仍未成功,因此,如果您在此领域取得任何进展,请随时将信息传递给;)

I'm trying to write my first Qt installer and having trouble. In my installer, in one of the packages, I need to run an .exe file at the end of the installation and add an environment variable as well.

I think the way to do it is with the script option in the package.xml file but I don't know how to write that script, I cannot find a step by step explanation of how to do it anywhere.

Can someone help?

解决方案

I have been recently suffering the same fate as yourself but have managed, for the most part, to achieve what you are trying to do from the Qt installer framework examples and documentation found here http://qt-project.org/doc/qtinstallerframework-1.5/index.html and http://doc.qt.io/qtinstallerframework/qtifwexamples.html.

The information provided on these pages is a little ambiguous but with a little experimentation you should be able to create the install script that you require.

The package.xml file you would like to implement the install script requires that you add a

<Script>installscript.qs</Script> 

tag and that the installscript.qs its self should be located in the meta folder of that package. The installscript.qs will then contain, among a few other things, a

component.addOperation("Execute".....)

command which will execute your required .exe. The same process for the environment variable could be implemented using the execute operation to run a batch file which creates the variable on the users system.

I have been trying over the last few weeks to implement the custom operations detailed in the qt installer framework documentation but have so far been unsuccessful so if you make any progress in this area feel free to pass the information on ;)

这篇关于如何编写Qt安装程序的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆