Qt Installer Framework: TypeError cannot read property name

  • Hello,
    I tried creating an installer following the tutorial. I then added a script called "installerscript.qs" as per the startmenu example in the Qt Installer Framework directory.

    The "installerscript.qs" is as follows:

    ** Copyright (C) 2017 The Qt Company Ltd.
    ** Contact: https://www.qt.io/licensing/
    ** This file is part of the FOO module of the Qt Toolkit.
    ** Commercial License Usage
    ** Licensees holding valid commercial Qt licenses may use this file in
    ** accordance with the commercial license agreement provided with the
    ** Software or, alternatively, in accordance with the terms contained in
    ** a written agreement between you and The Qt Company. For licensing terms
    ** and conditions see https://www.qt.io/terms-conditions. For further
    ** information use the contact form at https://www.qt.io/contact-us.
    ** GNU General Public License Usage
    ** Alternatively, this file may be used under the terms of the GNU
    ** General Public License version 3 as published by the Free Software
    ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
    ** included in the packaging of this file. Please review the following
    ** information to ensure the GNU General Public License requirements will
    ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
    function Component()
        // default constructor
    Component.prototype.createOperations = function()
        // call default implementation to actually install program
        if (systemInfo.productType === "windows") {
            component.addOperation("CreateShortcut", "@TargetDir@/program.exe", "@StartMenuDir@/program.lnk",
                "workingDirectory=@TargetDir@", "iconPath=%TargetDir%/Logo.ico",
                "iconId=1", "description=Open exe");
            component.addOperation("CreateDesktopShortcut", "@TargetDir@/program.exe", "@DesktopDir@/AttoView.lnk", 
                "workingDirectory=@TargetDir@", "iconPath=%TargetDir%/Logo.ico",
                "iconId=1", "description=Open exe");

    My package.xml is as below:

    <?xml version="1.0" encoding="UTF-8"?>
        <Description>Attonics Systems Spectrometer Software</Description>
            <License name="End User License Agreement" file="license.txt" />

    When I execute the installer I get the error message:

    Exception while loading component script ":\\metadata\com.mycompany.program\installscript.qs": TypeError: cannot read property 'name' of null on line number: 1

    This example worked when I tried it in the example directory. But gives me the above error when I modify it slightly to work with my own code.

    Help please.

    Thanks and regards.

Log in to reply