Question: How to change the installer path and add subfolder using qt installer framework.

Default output: 

```
C:\Program Files (x86)\Subfolder

```

I want to path to example output.

Example output:

```
D:\Subfolder
C:\Desktop\Subfolder
C:\Documents\Subfolder

```

Answer: 
I know this is old but maybe is usefull for someone.

I changed a Qt Installer Framework example called dynamicpage (look in QtIfw examples dir), where the target directory is selected from a custom widget called targetwidgetui. To avoid the user write directly in the line edit I added in my file config/controllerscript.qs this code:

```
Controller.prototype.TargetDirectoryPageCallback = function()
{
    currentPage.TargetDirectoryLineEdit.enabled = false;
}

```

I also added @ApplicationsDir@/MyAppFolder in config.xml so this is the default install path.

When the user change the destination folder I take the path and append "/MyAppFolder". To do this I changed a function in the dynamicpage example, in file installscript.qs. This is how my function look like now: 

```
Component.prototype.chooseTarget = function () {
    var widget = gui.pageWidgetByObjectName("DynamicTargetWidget");
    if (widget != null) {
        var newTarget = QFileDialog.getExistingDirectory("Choose your target directory.", widget
            .targetDirectory.text);
        if (newTarget != "")
        {
            newTarget += "/MyAppFolder"; // The same subfolder of TargetDir in config.xml
            widget.targetDirectory.text = Dir.toNativeSparator(newTarget);
        }
    }
}

```

Using this you will append always your folder to the installation path.
In your `config.xml` file you can add

```
<TargetDir>*YOUR_PATH*/subfolder</TargetDir>

```

To install to a custom directory.

From [Qt Installer Framework documentation](http://doc.qt.io/qtinstallerframework/ifw-globalconfig.html):

> 
> TargetDir
> 
> 
> Default target directory for installation. On Linux, this is usually the user's home directory.
> 
> 
> 

Note that you can use predefined variables like `@ApplicationsDir@` or `@DesktopDir@` as [stated here](http://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables).