Qt World Summit: Submit your Presentation

Qt Install Framework CopyDirectory

  • Qt Champions 2017


    Qt Install Framework 3.1.1.
    Windows & Mac.

    I'm trying to copy the directory with following code snippet during the installation.

    var sourceDir = "/Users/dheeru/Desktop/Bax1";
    var destDir = "/Users/dheeru/Desktop/dheeru";
    var val = installer.performOperation("CopyDirectory"[sourceDir,destDir,"forceOverwrite"]);

    This does not work. Any idea about this ?

  • @dheerendra Hi, what's the value of val after the operations fails?

  • Qt Champions 2017

    false. It is not copying the contents.

  • I think you are missing a colon, definition states performOperation(string name, stringlist arguments)?
    If that's just a typo in the post, are access rights for the user associated with the installer ok? It might run without sufficient privileges.

  • Qt Champions 2017

    Oh Sorry. It is typo when I did copy-paste here.

    Actual code is

    var val = installer.performOperation("CopyDirectory", [sourceDir,destDir,"forceOverwrite"]);

    Priviledges are perfectly fine. It does not copy.

  • Qt Champions 2017

    After analysing the QtIFW source code, Here is my final input on this.

    With the following code snippet we think that

    1. Contents of 'Bax1' will be copied to 'dheeru' directory.
    2. This understanding is wrong.
    3. Documentation also does not clearly explains this.
    var sourceDir = "/Users/dheeru/Desktop/Bax1";
    var destDir = "/Users/dheeru/Desktop/dheeru";
    var val = installer.performOperation("CopyDirectory",[sourceDir,destDir,"forceOverwrite"]);

    Following is the actual meaning of above code.

    1. Actually 'Bax1' directory itself get cloned in to 'dheeru' directory
    2. 'Bax1' directory should be already existing under 'dheeru' directory before starting the CopyOperation.
    3. If the 'Bax1' directory does not exist under 'dheeru', copy fails.

    I will file the documentation Documentation bug and fix the same as well.

Log in to reply