installscript.qs Example File | Qt Installer Framework Documentation 4.11.0

- Qt Installer Framework Documentation
- Translation Example
- installscript.qs Example File
- Qt Installer Framework 4.11.0

# installscript.qs Example File

translations/packages/com.vendor.product/meta/installscript.qs

     /* Copyright (C) 2026 The Qt Company Ltd.
      *
      * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
     */

     function Component()
     {
         // constructor
         component.loaded.connect(this, Component.prototype.loaded);
         installer.addWizardPage(component, "Page", QInstaller.TargetDirectory)
     }

     Component.prototype.createOperations = function()
     {
         try {
             // call the base create operations function
             component.createOperations();
         } catch (e) {
             console.log(e);
         }
     }

     Component.prototype.loaded = function ()
     {
         var page = gui.pageByObjectName("DynamicPage");
         if (page != null) {
             page.entered.connect(Component.prototype.dynamicPageEntered);
         }
     }

     Component.prototype.dynamicPageEntered = function ()
     {
         var pageWidget = gui.pageWidgetByObjectName("DynamicPage");
         if (pageWidget != null) {
             pageWidget.m_pageLabel.text = qsTranslate("installscript", "This is a dynamically created page.");
         }
     }