2

My installers use IISMain to install to the typicall IIS folder structure:

<Fragment>
  <Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="IISMain" Name="inetpub">

When there is only a C:\ drive, this installs to C:\inetpub\. However, we recently added an E:\ drive and created an Inetpub folder on it. We did not make any changes to the system beyond this - all we did was add the E:\ drive and use typical New Folder functionality to create the new Inetpub folder. However, my installers now install to the new E:\Inetpub\ folder.

While this is the desired functionality for the installer, I am confused as to how IISMain knows to point to the new folder instead of the original folder. How does the IISMain directory path get set?

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
zimdanen
  • 5,508
  • 7
  • 44
  • 89

1 Answers1

3

TARGETDIR is a Windows Installer folder that will end up pointing to the root of the largest (most free space) drive on the machine. So if E:\ is larger than C:\ then TARGETDIR will be E:\.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130
  • When you say "largest," do you mean "with the most space" or "with the most free space?" The `E` drive is about 2 MB smaller than the `C` drive but has much more free space. – zimdanen Apr 24 '13 at 20:40
  • Looks like [it's the drive with the most free space](http://stackoverflow.com/a/11003825/128217). Well crap - that seems unsafe - it could change over time. How do you make it stable? – zimdanen Apr 24 '13 at 20:45
  • Once installed, the Components won't switch directories. Upgrade may pick a new drive though. What do you want the picking algorithm to be? – Rob Mensching Apr 24 '13 at 21:14
  • So, we uninstall and reinstall to update (haven't played with the upgrade functionality yet). I would want it to go to the default IIS drive. – zimdanen Apr 24 '13 at 22:22