Qt Installer Framework
-
Hi, i am trying to execute some bash script when Uninstaller finished.(Ubuntu 14.04)
function Controller() { if (installer.isUninstaller()) { installer.setDefaultPageVisible(QInstaller.Introduction, false); installer.setDefaultPageVisible(QInstaller.ComponentSelection, false); installer.setDefaultPageVisible(QInstaller.LicenseCheck, false); //Script successfull start installer.executeDetached("@TargetDir@/script.sh","param"); } } Controller.prototype.FinishedPageCallback = function() { // Message appear when Installer or Uninstaller finish var result = QMessageBox["question"]("test.quit", "Installer", "Complete.", QMessageBox.Ok | QMessageBox.Cancel); if (installer.isUninstaller()) { // Message appear when Uninstaller finish var result = QMessageBox["question"]("test.quit", "Installer", "Uninstall complete.", QMessageBox.Ok | QMessageBox.Cancel); // Script don't start! installer.executeDetached("@TargetDir@/script.sh","param"); // also don't work installer.execute("@TargetDir@/script.sh","param"); }
Why i can't starting my script in finished page callback?
-
Hi
I assume the QMessageBox is shown so we know for sure that the code is
executed?Are you sure that @TargetDir@ will be expanded?
I think its not. It must be full path or script.sh must be place in folder that is path of "path" for OS and
simply be called with
installer.execute("script.sh","param");Where does @TargetDir@ come from ?
It is a environment variable?also, you should hook up
http://doc.qt.io/qt-5/qprocess.html#errorOccurred
and see what error code is - if any.Also,
the "param" is normally a QStringList, not just a string. Not sure if issue.
installer.execute("script.sh", QStringList() << "param"); -
Hi
I assume the QMessageBox is shown so we know for sure that the code is
executed?Are you sure that @TargetDir@ will be expanded?
I think its not. It must be full path or script.sh must be place in folder that is path of "path" for OS and
simply be called with
installer.execute("script.sh","param");Where does @TargetDir@ come from ?
It is a environment variable?also, you should hook up
http://doc.qt.io/qt-5/qprocess.html#errorOccurred
and see what error code is - if any.Also,
the "param" is normally a QStringList, not just a string. Not sure if issue.
installer.execute("script.sh", QStringList() << "param");Hi,
@mrjjWhere does @TargetDir@ come from ? It is a environment variable?
it is a predefined variable you can find a list of them in the following link:
http://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables