The background: my target directory is set to say hard-coded, C:\MyFolder.
In the IDE, I select the folder containing the files and sub-folders where my files are I want to install. I add all the files from say, C:\Temp\MyFiles. In C:\Temp\MyFiles I have a number of sub-folders which aren't initially added. I select $TARGETDIR$ and drag those sub-folder into it, one by one. I have about 20 sub-folders to drag and drop. Two things:
1. I have to keep selecting $TARGETDIR$ each time I drag a sub-folder. If I don't, the IDE drops the folder into the one I last selected. If I drag the folder and hover over $TARGETDIR$ and release the button it must surely be the sensible assumption that the drop should go into the one I selected. It's like the IDE has a bright-light retinal imprint of the last folder I dropped. I don't think that's correct.
2. Anyway, I select $TARGETDIR$ every time


I'm not doing anything in the MSIcode so it's all down to what's going on in the IDE. I can't submit my project because it's too big. I'm reasonably confident it can be replicated if you create an installation from a folder containing lots of files and lots of sub-folders. Hope this helps.