Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
4.5.1, 4.5.0
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")}`); }