Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get the default IIS Directory in a Wix install package?

Tags:

iis

wix

wix3

I Would like to set my default install location in Wix to go the default IIS directory

usually C:\inetpub\wwwroot\

in the XML i have

<Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLLOCATION" Name="myProduct">

I Assume i can change either the ProgramFilesFolder directory the the TARGETDIR to one that matches with an IIS property. (in case the default location is moved on a machine)

What would that be?

like image 845
Bluephlame Avatar asked Aug 25 '10 06:08

Bluephlame


1 Answers

You can use a registry search to find the location:

<Property Id="INSTALLLOCATION"> 
    <RegistrySearch Id="FindInetPubFolder" Root="HKLM" Key="SOFTWARE\Microsoft\InetStp" Name="PathWWWRoot" Type="directory" /> 
</Property>

But I would caution you that I don't typically do this. I tend to either create new websites or new virtual directories and use use ProgramFiles\Company\Product\WebSites\WebSite as where I put my files. This allows safer integration with whatever other web sites that might also exist on the box.

like image 82
Christopher Painter Avatar answered Oct 17 '22 09:10

Christopher Painter