Uploaded image for project: 'Qt Installer Framework'
  1. Qt Installer Framework
  2. QTIFW-2917

setValue lose value of key saved inside handler of installationFinished signal during uninstallation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 4.5.1, 4.5.0
    • Scripting
    • Windows

    Description

      I want to save GUID code from msi package for uninstall it in future. I want save GUID code in setValue method, so invoke it in my SaveMsiGUID() handler of installationFinished signal, but qtifw cant save it during uninstallation so installer.value("JAVA_GUID") method return nothing.

      function Component()
      {     
         installer.installationFinished.connect(SaveMsiGUID); 
      }
      
       Component.prototype.createOperations = function()
      {
          try {
              component.createOperations();
              var FSNT_HOME = installer.value("FSNT_HOME");
              var JAVA_HOME = FSNT_HOME + "\\jre";
              installer.setValue("JAVA_HOME", JAVA_HOME);
      
              var arguments =
              [
                  "msiexec" , "/i",
                  FSNT_HOME + "\\bellsoft-jre17.0.3.1+2-windows-amd64.msi",
                  "INSTALLDIR=" + JAVA_HOME + "\\",
                  "/quiet"
              ];
      
              var undoArguments =
              [
                  "msiexec" , "/x",
                  installer.value("JAVA_GUID"),
                  "/norestart",
                  "/quiet"
              ];
              
              component.addElevatedOperation("Execute", arguments,"UNDOEXECUTE",undoArguments);
      
          } catch (e) {
              console.log(e);
          }
      }
      
       function SaveMsiGUID()
       {
           var FSNT_HOME = installer.value("FSNT_HOME");
        
           var arguments =
           [
               "powershell.exe", `${FSNT_HOME}\\GetGUIDfromMSI.ps1`,
               `${FSNT_HOME}\\bellsoft-jre17.0.3.1+2-windows-amd64.msi`
           ];
           var result = installer.execute(arguments.shift(), arguments);
      
          installer.setValue("JAVA_GUID", result[0]);
           console.log(`GUID of package ${component.name}: ${installer.value("JAVA_GUID")}`);
       }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            installerteam Installer Team
            vanro Mikhail Golozubov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes