Below xml creates the specified folders under C:\\Programfiles but I want to create (SomeFolder\\MyApp) Folders in D:\\MySetupFolder\\, how can I create this using the WIX?
Set the value of rootdrive to the drive you want
<CustomAction Id='SetRootDrive' Property='ROOTDRIVE' Value='[%SystemDrive]\'/>
System drive will be by default the default drive used by OS
Added code to call 'SetRootDrive' action: You need to call it from InstallUISequence
<InstallUISequence>
<Show Dialog="MyWelcomeDlg" Before="CostFinalize">NOT Installed</Show>
<!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->
<AppSearch After="FindRelatedProducts"/>
<Custom Action="SetRootDrive" Before="CostInitialize"></Custom>
</InstallUISequence>