Search code examples
visual-studio-2013deploymentinstallationsetup-deployment

Visual Studio 2013 Installer Project, how to install subdirectories to different location


i have a question regarding an installer project in Visual Studio 2013. I want to install two directories in the same folder (example):

C:\ProgramData\TargetFolder\FirstDirectory and C:\ProgramData\TargetFolder\SecondDirectory

The first folder shall be installed always to TargetFolder. The second folder shall be installed into a dynamic folder, chosen by the user.

I have already set up two target folder within the "File System on Target Machine" window of the installer project. Both have the same default location

C:\ProgramData\TargetFolder

The first folder is a "custom folder" chosen from the right-click menu. The second folder is the "Application Folder", which's default location is usually "C:\Program Files (x86)" (depending on the target machine arch). I changed the second folder's default location to "C:\ProgramData\TargetFolder" - so by default both folder are installed there.

During the installation process the user can choose a different target folder. I tested it with D:\testfolder. My expectation was, that the second folder would be installed in D:\testfolder\secondfolder, and the first folder would be installed in C:\ProgramData\TargetFolder\firstfolder. But as i changed the installation folder in the dialog, both folder are installed in D:\testfolder.

My Question is, how can i separate the two folder?

Thanks,

Michael


Solution

  • I solved it by installing the second folder into the "Program Files" folder. The first folder is fixed installed into the C:\ProgramData\TargetFolder\firstfolder.