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

1

5

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?

Ski answered 25/8, 2010 at 6:12 Comment(0)
I
9

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.

Injun answered 25/8, 2010 at 14:16 Comment(1)
FWIW, I'm not 100% happy with my own answer. INSTALLLOCATION is immutable once a product is installed and should never be changed during a repair or other reinstall. A better technique is to assign the registry search to another property and then assign this property to INSTALLLOCATION only if Not Installed.Injun

© 2022 - 2024 — McMap. All rights reserved.