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

Qt installer framework create desktop form at end of installer



  • Hello everyone, I created a form which can be checked to create desktop short cuts, the form is visible however it doesnt create anything, here's the code, any idea whats wrong?

    function Component()
    {
        installer.installationFinished.connect(this, Component.prototype.installationFinishedPageIsShown);
        installer.finishButtonClicked.connect(this, Component.prototype.installationFinished);
    }
    
    Component.prototype.installationFinishedPageIsShown = function()
    {
        try {
            if (installer.isInstaller() && installer.status == QInstaller.Success) {
                installer.addWizardPageItem( component, "ShortCutCheckBoxForm", QInstaller.InstallationFinished );
            }
        } catch(e) {
            console.log(e);
        }
    }
    Component.prototype.createOperations = function()
    {
        component.createOperations();
    }
    Component.prototype.installationFinished = function()
    {
       component.createOperations();
        try {
            if (installer.isInstaller() && installer.status == QInstaller.Success) {
                var isReadMeCheckBoxChecked = component.userInterface( "ShortCutCheckBoxForm" ).ShortCutCheckBox.checked;
                if (isReadMeCheckBoxChecked) {
               component.addOperation("CreateShortcut",
    								"@TargetDir@/Prog.exe",
    								"@DesktopDir@/Prog.lnk",
    								"workingDirectory=@TargetDir@",
    								"iconPath=@TargetDir@/Prog.exe",
    								"iconId=0",
    								"description=Execute Prog");
    								
    			
    
        
                }
            }
        } catch(e) {
            console.log(e);
        }
    }
    

    T



  • Any body?


Log in to reply