Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QT Installerframework is altering my string slashes



  • Hi,

    I'm trying to creating a bundle for my software with the QT installer framework. I have a couple of .msi files that I want to install and everything goes fine during installation.

    However when i try to uninstall these .msi files with the maintaincetool I get the following error:
    Created warning message box "installationErrorWithRetry": "Installer Error", "Error during uninstallation process:\nExecution failed (Unexpected exit code: 1619): "msiexec /x C:/Program Files (x86)/Company/Repository/Installer/Setup.msi /q"" .

    Noticeable is that the string does use the correct windows style slashes during the installation as seen below:
    [7042] - arguments: msiexec, /i, C:\Program Files (x86)\Company\Repository\Installer\Setup.msi, /passive, HOST_ID=200, UNDOEXECUTE, msiexec, /x, C:\Program Files (x86)\Company\Repository\Installer\Setup.msi, /q

    I made the following script for instalation:

    // Utility function like QString QDir::toNativeSeparators(const QString & pathName) [static]
    var Dir = new function () {
        this.toNativeSeparator = function (path) {
            if (installer.value("os") == "win")
                return path.replace(/\//g, '\\');
            return path;
        }
    };
    
    function Component()
    {
    }
    
    Component.prototype.createOperations = function()
    {
    	component.createOperations();
    							
    	var packageInstaller =  Dir.toNativeSeparator(installer.value("TargetDir") + "/Installer/Setup.msi") ;	
    	
    	component.addElevatedOperation("Execute", "msiexec", "/i", packageInstaller, "/passive", "HOST_ID=200", 
    									"UNDOEXECUTE", "msiexec", "/x", packageInstaller, "/q" );
    }
    

    I would like to use the msi file to uninstall the program and not the GUID as posted in this thread: using-msi-files-in-qt-framework-installer


Log in to reply