我需要bat
在安装程序完成后运行一个插入 postgres Windows 服务的文件,以便我的数据库有一个活动服务器(我使用的是静态 postgres)。该bat
文件运行pg_ctl
注册命令。
根据 Qt 安装程序文档installationFinished
,您可以使用发布方法,一旦安装程序通过控制器或包安装脚本完成,这些方法将运行。我不确定我是否正确使用它,因为运行安装程序后bat
文件没有运行。如何正确使用此功能?
我在控制器脚本中尝试过:
Controller.prototype.installationFinished = function(){
installer.executeDetatched("C:\\Program Files (x86)\\PostgreSQL\\9.6\\pgserv.bat", new Array(), "@homeDir@")
}
还尝试在组件安装脚本中:
Component.prototype.installationFinished = function(){
component.addElevatedOperation("Execute", "cmd", "/C", "C:\\Program Files (x86)\\PostgreSQL\\9.6\\pgserv.bat");
}
此bat
文件用于运行安装后,因为该bat
文件上的命令需要安装后添加到PATH
变量的 postgres\bin 文件夹。
非常感谢大家的帮助!:)