When the user Changes the installation folder, for example to C:\CustomFolder
, my Inno Setup based installer should use the following subfolder for installation instead: C:\CustomFolder\Parent\Child
.
What I found so far is that there is the AppendDefaultDirName
option, which appends the last component of DefaultDirName
to the selected folder name. But this isn't the behaviour I need.
A simple solution is to use {app}\Parent\Child
everywhere in the script, instead of plain {app}
.
You can create a preprocessor define for that to avoid repetitions.
You may also want to move uninstall files to those subfolders using UninstallFilesDir
directive.
#define TheAppPath "{app}\Parent\Child"
[Setup]
UninstallFilesDir={#TheAppPath}
[Files]
Source: "MyProg.exe"; DestDir: "{#TheAppPath}"
Source: "MyProg.dat"; DestDir: "{#TheAppPath}"