Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Installer Framework

Qt Installer Framework

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 3 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qpmr
    wrote on last edited by qpmr
    #1

    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?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      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");

      HojjatJafaryH 1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qpmr
        wrote on last edited by
        #3

        My script wasn't execute because the uninstaller delete his folder)

        mrjjM 1 Reply Last reply
        2
        • Q qpmr

          My script wasn't execute because the uninstaller delete his folder)

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @qpmr
          HeHe well that kinda complicates it for QProcess :)

          1 Reply Last reply
          0
          • mrjjM mrjj

            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");

            HojjatJafaryH Offline
            HojjatJafaryH Offline
            HojjatJafary
            wrote on last edited by
            #5

            Hi,
            @mrjj

            Where 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

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved