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

Qt Installer Framework: component scripting problem



  • Hi everyone, I would like to install Python and additional libraries for Python with the provided installer.
    To make this I have to know the path of Python without to check the "Add Python to PATH" option in the Python installer. The problem is that the getEnvironmentVariable() and the getPythonSp() are run before the addOperation(), and I can not retrieve with the Python site-packages path to move libraries into it.

    Component.prototype.createOperations = function()
    {
        component.createOperations();
        var python, path;
    
        if (systemInfo.kernelType === 'winnt') {
            component.addOperation('Execute', '@TargetDir@/python-3.6.5-amd64.exe');
            component.addOperation('Execute', 'py', ['-c', 'import os, sys; os.system("setx PYTHONTEMP " + ";".join(sys.path))']);
    
            python = getEnvironmentVariable('PYTHONTEMP');
            path = getPythonSp(python);
    
            [...]  // additional operations
    
            component.addOperation('Execute', 'cmd', ['/c', 'REG DELETE HKCU\\Environment /f /v PYTHONTEMP']);
        }
    }
    

    I would be grateful, if anyone could help to solve my problem.


Log in to reply