views:

30

answers:

3

I'm in task of migrating our product's installer from InstallShield to WiX.

To deploy web applications, the previous developers used Custom Actions (written in C#) in InstallShield. In Wix, this is no longer necessary because wix supports IIS deployment.

Anyway, one of the code in the Custom Action uses the DirectoryEntry object to set the property of a Web Directory:

DirectoryEntry.Properties["AuthNTLM"][0] = true;

What does this setting do? I know it has something to do with security/permission, but what setting does it actually set in IIS? Does it enable one of the following:

  • Integrated Windows Authentication
  • Digest Authentication
  • Basic Authentication
  • .NET Passport Authentication

Thanks!

A: 

This article should help you understand this.

Yan Sklyarenko
Thanks! Just out of curiosity, do you know why it always access index 0?
Ian
It is obviously related to the type of the property being returned, but I'm not an expert in this area. When I first faced with this, it was a debug session which unveiled the truth :)
Yan Sklyarenko
+2  A: 

A while back I provided an answer to a similar question:

Setting NTAuthenticationProviders at an Application level in IIS 6

AuthFlags (not AuthNTLM) is a flag value. You can set this without using an indexer, for example:

int MD_AUTH_ANONYMOUS = 1;
int MD_AUTH_BASIC = 2;
int MD_AUTH_NT = 4;

using(DirectoryEntry w3svc = new DirectoryEntry(@"IIS://Localhost/W3SVC"))
{
  using(DirectoryEntry webSite = w3svc.Children.Add(iisNumber, "IIsWebServer"))
  {
    // Configure website settings here...
    ....
    webSite.CommitChanges();

    using(DirectoryEntry siteRoot = webSite.Children.Add("root",
                                        IISSchemaClasses.IIsWebVirtualDir))
    {
      // Configure root application settings...
      ....
      // Only allow Basic and NTLM authentication
      siteRoot.Properties["AuthFlags"].Value = MD_AUTH_BASIC | MD_AUTH_NT 
      siteRoot.CommitChanges();
    }

  }
}
Kev
+1  A: 

Actually it probably wasn't needed in InstallShield either. Currently, InstallShield actually has better built-in IIS support then WiX and this type of setting can be done declaratively without writing a custom action. Also the InstallShield UI that collects this information looks pretty much just like the IIS MMC Snap-In so that it's intuitive how the data maps.

Christopher Painter
Chris, what IS version is that? Can you get that in Simple MSI Project?
Ian
I'd have to remember, but I think IIS Changes were introduced back around InstallShield 11. I know it's in 12, 2008, 2009, 2010 and 2011. 2010 and up supports native IIS7 without needing the IIS6 metabase compatibility pieces installed. It can do the pipeline settings and understands the difference between a vDir and Application.
Christopher Painter
Yes, Basic MSI projects support the IIS Changes. That's the only project type I ever use. I have no interest in InstallScript or InstallScript MSI projects. Although I do on a rare occasion still use InstallScript CA's in a Basic MSI project. Not much anymore since I have DTF available and even that is rare.
Christopher Painter