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. setValue lose value of key saved inside handler of installationFinished signal during uninstallation - Qt installer framework
Forum Updated to NodeBB v4.3 + New Features

setValue lose value of key saved inside handler of installationFinished signal during uninstallation - Qt installer framework

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
1 Posts 1 Posters 157 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.
  • M Offline
    M Offline
    Mikhail Rubezh
    wrote on last edited by Mikhail Rubezh
    #1

    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. How to fix it?

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