Hi,

I have a product with a custom Rule. I want to install the file in 2
different directories. How should it be done? I tried the following, but it
only installs once (in pluginInstallPrefix).

Product {
    name: "InstallScript"
    type: ["install-script"]
    property string wsVersion: project.wsVersion
    property string pluginInstallPrefix: project.pluginInstallPrefix
    property string otherInstallPath: project.otherInstallPath

    Group {
        name: "Template"
        files: ["install.bat.in"]
        fileTags: ["install-template"]
    }

    Rule {
        multiplex: false
        inputs: ["install-template"]
        Artifact {
            filePath: "install.bat"
            fileTags: ["install-script", "install-script-other"]
        }
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "Generating " + output.fileName;
            cmd.highlight = "codegen";
            cmd.sourceCode = function() {
                var file = new TextFile(input.filePath);
                var content = file.readAll();
                file.close()
                content = content.replace("$$VER$$", product.wsVersion);
                file = new TextFile(output.filePath, TextFile.WriteOnly);
                file.write(content);
                file.close();
            }
            return [cmd];
        }
    }

    Group {
        name: "Install"
        fileTagsFilter: ["install-script"]
        qbs.install: true
        qbs.installDir: product.pluginInstallPrefix
    }
    Group {
        name: "Install Other"
        fileTagsFilter: ["install-script-other"]
        qbs.install: true
        qbs.installDir: product.otherInstallPath
    }
}
_______________________________________________
Qbs mailing list
[email protected]
https://lists.qt-project.org/listinfo/qbs

Reply via email to