Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QtIF script - Mac signals not being called
Forum Updated to NodeBB v4.3 + New Features

QtIF script - Mac signals not being called

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 2 Posters 225 Views 1 Watching
  • 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.
  • Adam NicholsA Offline
    Adam NicholsA Offline
    Adam Nichols
    wrote on last edited by Adam Nichols
    #1

    What I am attempting to accomplish, is that when the maintenance tool is run to uninstall my app, I need to call a script to remove a shortcut from the Mac folder /Applications, that was created by a script when the finish button was clicked on the initial installation.

    As per the documentation
    https://doc.qt.io/qtinstallerframework/scripting-installer.html#finishButtonClicked-signal

    The following connect functions as expected, but only in the context of being an 'installer' :

    installer.finishButtonClicked.connect(this, finishClicked);
    
    finishClicked = function(){
        if(installer.isInstaller())
        {
            // This code is ALWAYS called at the end of the install process
            console.log(" *** - This is an installer!");
            var result = QMessageBox["question"]("test.quit", "Installer", " - This is an installer!", QMessageBox.Ok);
        }
        else if(installer.isUninstaller())
        {
            // This code is NEVER called
            console.log(" *** - This is an UN-installer!");
            var result = QMessageBox["question"]("test.quit", "UN-Installer", " - This is an UN-installer!", QMessageBox.Ok);
        }
    }
    

    The next 2 connect functions do not get called at all
    https://doc.qt.io/qtinstallerframework/scripting-installer.html#uninstallationStarted-signal
    https://doc.qt.io/qtinstallerframework/scripting-installer.html#uninstallationFinished-signal

    installer.installationFinished.connect(this, installDone);
    installer.uninstallationFinished.connect(this, uninstallComplete);
    
    installDone = function(){
            // This code is NEVER called
    	QMessageBox["question"]("test.quit", "Installer", " signalled by Installer::installationFinished", QMessageBox.Ok);
    }
    
    uninstallComplete = function(){
            // This code is NEVER called
    	QMessageBox["question"]("test.quit", "Installer", " signalled by Installer::uninstallationFinished", QMessageBox.Ok);
    }
    

    The use of QMessageBox is not the only thing that I have tried to get feedback for these signals. I have tried calling scripts, and console.log().

    I also attempted to tie into the same button clicked signal, by differentiating the install from the uninstall by installer.isInstaller() and installer.isUninstaller(), respectively. The case of installer.isUninstaller appears to never be true. Also, there does not appear to be any means to specify the connection type, ie: Qt::QueuedConnection, etc.

    Romain CR 1 Reply Last reply
    0
    • Adam NicholsA Adam Nichols

      What I am attempting to accomplish, is that when the maintenance tool is run to uninstall my app, I need to call a script to remove a shortcut from the Mac folder /Applications, that was created by a script when the finish button was clicked on the initial installation.

      As per the documentation
      https://doc.qt.io/qtinstallerframework/scripting-installer.html#finishButtonClicked-signal

      The following connect functions as expected, but only in the context of being an 'installer' :

      installer.finishButtonClicked.connect(this, finishClicked);
      
      finishClicked = function(){
          if(installer.isInstaller())
          {
              // This code is ALWAYS called at the end of the install process
              console.log(" *** - This is an installer!");
              var result = QMessageBox["question"]("test.quit", "Installer", " - This is an installer!", QMessageBox.Ok);
          }
          else if(installer.isUninstaller())
          {
              // This code is NEVER called
              console.log(" *** - This is an UN-installer!");
              var result = QMessageBox["question"]("test.quit", "UN-Installer", " - This is an UN-installer!", QMessageBox.Ok);
          }
      }
      

      The next 2 connect functions do not get called at all
      https://doc.qt.io/qtinstallerframework/scripting-installer.html#uninstallationStarted-signal
      https://doc.qt.io/qtinstallerframework/scripting-installer.html#uninstallationFinished-signal

      installer.installationFinished.connect(this, installDone);
      installer.uninstallationFinished.connect(this, uninstallComplete);
      
      installDone = function(){
              // This code is NEVER called
      	QMessageBox["question"]("test.quit", "Installer", " signalled by Installer::installationFinished", QMessageBox.Ok);
      }
      
      uninstallComplete = function(){
              // This code is NEVER called
      	QMessageBox["question"]("test.quit", "Installer", " signalled by Installer::uninstallationFinished", QMessageBox.Ok);
      }
      

      The use of QMessageBox is not the only thing that I have tried to get feedback for these signals. I have tried calling scripts, and console.log().

      I also attempted to tie into the same button clicked signal, by differentiating the install from the uninstall by installer.isInstaller() and installer.isUninstaller(), respectively. The case of installer.isUninstaller appears to never be true. Also, there does not appear to be any means to specify the connection type, ie: Qt::QueuedConnection, etc.

      Romain CR Offline
      Romain CR Offline
      Romain C
      wrote last edited by
      #2

      @Adam-Nichols Hi ! I'm interested about your feedback on the uninstall process.
      From my understanding, there a general maintenancetool set inside the install directory that doesn't care about your script. If you take your installer and call it using --start-uninstaller, it will behave as you want.

      1 Reply Last reply
      0

      • Login

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