Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DirBrowseFlags to IisWebDirProperties #596

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/api/wix/WixToolset.Data/ErrorMessages.cs
Original file line number Diff line number Diff line change
@@ -2271,6 +2271,11 @@ public static Message OverlengthTableNameInProductOrMergeModule(SourceLineNumber
return Message(sourceLineNumbers, Ids.OverlengthTableNameInProductOrMergeModule, "The table name '{0}' is invalid because the table name exceeds 31 characters in length. For more information, see: https://learn.microsoft.com/en-au/windows/win32/msi/table-names", tableName);
}

public static Message IllegalMsiUnsignedIntegerValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value)
{
return Message(sourceLineNumbers, Ids.IllegalMsiUnsignedIntegerValue, "The {0}/@{1} attribute's value, '{2}', is not a legal MSI unsigned integer value. Legal MSI unsigned integer values are from 0 to 2,147,483,647, or 2,147,483,649 to 4,294,967,295", elementName, attributeName, value);
}

private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
{
return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
@@ -2672,7 +2677,8 @@ public enum Ids
MsiTransactionInvalidPackage2 = 412,
ExpectedAttributeOrElementWithOtherAttribute = 413,
ExpectedAttributeOrElementWithoutOtherAttribute = 414,
OverlengthTableNameInProductOrMergeModule = 415
OverlengthTableNameInProductOrMergeModule = 415,
IllegalMsiUnsignedIntegerValue = 416
}
}
}
1 change: 1 addition & 0 deletions src/ext/Iis/ca/sca.h
Original file line number Diff line number Diff line change
@@ -75,6 +75,7 @@ enum IIS_CONFIG_ACTION
IIS_DIRPROP_CACHECUST,
IIS_DIRPROP_NOCUSTERROR,
IIS_DIRPROP_LOGVISITS,
IIS_DIRPROP_BROWSEFLAGS,
IIS_DIRPROP_END,
IIS_WEBLOG,
IIS_FILTER_BEGIN,
2 changes: 1 addition & 1 deletion src/ext/Iis/ca/scasched.cpp
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ LPCWSTR vcsWebErrorQuery =
L"SELECT `ErrorCode`, `SubCode`, `ParentType`, `ParentValue`, `File`, `URL` "
L"FROM `Wix4IIsWebError` ORDER BY `ErrorCode`, `SubCode`";

LPCWSTR vcsWebDirPropertiesQuery = L"SELECT `DirProperties`, `Access`, `Authorization`, `AnonymousUser_`, `IIsControlledPassword`, `LogVisits`, `Index`, `DefaultDoc`, `AspDetailedError`, `HttpExpires`, `CacheControlMaxAge`, `CacheControlCustom`, `NoCustomError`, `AccessSSLFlags`, `AuthenticationProviders` "
LPCWSTR vcsWebDirPropertiesQuery = L"SELECT `DirProperties`, `Access`, `Authorization`, `AnonymousUser_`, `IIsControlledPassword`, `LogVisits`, `Index`, `DefaultDoc`, `AspDetailedError`, `HttpExpires`, `CacheControlMaxAge`, `CacheControlCustom`, `NoCustomError`, `AccessSSLFlags`, `AuthenticationProviders`, `Attributes`"
L"FROM `Wix4IIsWebDirProperties`";

LPCWSTR vcsSslCertificateQuery = L"SELECT `Wix4Certificate`.`StoreName`, `Wix4CertificateHash`.`Hash`, `Wix4IIsWebSiteCertificates`.`Web_` FROM `Wix4Certificate`, `Wix4CertificateHash`, `Wix4IIsWebSiteCertificates` WHERE `Wix4Certificate`.`Certificate`=`Wix4CertificateHash`.`Certificate_` AND `Wix4CertificateHash`.`Certificate_`=`Wix4IIsWebSiteCertificates`.`Certificate_`";
22 changes: 21 additions & 1 deletion src/ext/Iis/ca/scawebprop.cpp
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
#include "precomp.h"

// sql queries
enum eWebDirPropertiesQuery { wpqProperties = 1, wpqAccess, wpqAuthorization, wpqUser, wpqControlledPassword, wpqLogVisits, wpqIndex, wpqDefaultDoc, wpqAspDetailedError, wpqHttpExp, wpqCCMaxAge, wpqCCCustom, wpqNoCustomError, wpqAccessSSLFlags, wpqAuthenticationProviders };
enum eWebDirPropertiesQuery { wpqProperties = 1, wpqAccess, wpqAuthorization, wpqUser, wpqControlledPassword, wpqLogVisits, wpqIndex, wpqDefaultDoc, wpqAspDetailedError, wpqHttpExp, wpqCCMaxAge, wpqCCCustom, wpqNoCustomError, wpqAccessSSLFlags, wpqAuthenticationProviders, wpqAttributes };

HRESULT ScaGetWebDirProperties(
__in LPCWSTR wzProperties,
@@ -154,6 +154,9 @@ HRESULT ScaGetWebDirProperties(
{
pswp->wzAuthenticationProviders[0] = L'\0';
}

hr = WcaGetRecordInteger(hRec, wpqAttributes, &pswp->iAttributes);
ExitOnFailure(hr, "failed to get IIsWebDirProperties.Attributes");
}
else if (E_NOMOREITEMS == hr)
{
@@ -296,6 +299,23 @@ HRESULT ScaWriteWebDirProperties(
ExitOnFailure(hr, "Failed to write AuthenticationProviders for Web");
}

if (MSI_NULL_INTEGER != pswp->iAttributes)
{
DWORD dwDirBrowseFlags = 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowDate) ? MD_DIRBROW_SHOW_DATE : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowExtension) ? MD_DIRBROW_SHOW_EXTENSION : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowLongDate) ? MD_DIRBROW_LONG_DATE : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowSize) ? MD_DIRBROW_SHOW_SIZE : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowTime) ? MD_DIRBROW_SHOW_TIME : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbEnableDefaultDoc) ? MD_DIRBROW_LOADDEFAULT : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbEnableDirBrowsing) ? MD_DIRBROW_ENABLED : 0;

// we XOR the flags, we only update things if they should be non-default
dwDirBrowseFlags ^= MD_DIRBROW_SHOW_DATE | MD_DIRBROW_SHOW_TIME | MD_DIRBROW_SHOW_SIZE | MD_DIRBROW_SHOW_EXTENSION | MD_DIRBROW_LONG_DATE | MD_DIRBROW_LOADDEFAULT;
hr = ScaWriteMetabaseValue(piMetabase, wzRootOfWeb, NULL, MD_DIRECTORY_BROWSING, METADATA_INHERIT, IIS_MD_UT_FILE, DWORD_METADATA, (LPVOID)((DWORD_PTR)dwDirBrowseFlags));
ExitOnFailure(hr, "Failed to write DirBrowseFlags for WebDirectory");
}

LExit:
return hr;
}
14 changes: 14 additions & 0 deletions src/ext/Iis/ca/scawebprop.h
Original file line number Diff line number Diff line change
@@ -7,6 +7,18 @@
// global sql queries provided for optimization
extern LPCWSTR vcsWebDirPropertiesQuery;

// enumerations
enum eWebDirAttributes
{
wedbDirBrowseShowDate = 1 << 0,
wedbDirBrowseShowExtension = 1 << 1,
wedbDirBrowseShowLongDate = 1 << 2,
wedbDirBrowseShowSize = 1 << 3,
wedbDirBrowseShowTime = 1 << 4,
wedbEnableDefaultDoc = 1 << 5,
wedbEnableDirBrowsing = 1 << 6,
};


// structs
struct SCA_WEB_PROPERTIES
@@ -40,6 +52,8 @@ struct SCA_WEB_PROPERTIES

int iAccessSSLFlags;

int iAttributes;

WCHAR wzAuthenticationProviders[MAX_DARWIN_COLUMN + 1];
};

21 changes: 21 additions & 0 deletions src/ext/Iis/ca/scawebprop7.cpp
Original file line number Diff line number Diff line change
@@ -146,6 +146,27 @@ HRESULT ScaWriteWebDirProperties7(
hr = ScaWriteConfigString(wz);
ExitOnFailure(hr, "Failed to write AuthenticationProviders for Web");
}

if (MSI_NULL_INTEGER != pswp->iAttributes)
{
DWORD dwDirBrowseFlags = 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowDate) ? MD_DIRBROW_SHOW_DATE : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowExtension) ? MD_DIRBROW_SHOW_EXTENSION : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowLongDate) ? MD_DIRBROW_LONG_DATE : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowSize) ? MD_DIRBROW_SHOW_SIZE : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbDirBrowseShowTime) ? MD_DIRBROW_SHOW_TIME : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbEnableDefaultDoc) ? MD_DIRBROW_LOADDEFAULT : 0;
dwDirBrowseFlags |= (pswp->iAttributes & wedbEnableDirBrowsing) ? MD_DIRBROW_ENABLED : 0;

// we XOR the flags, we only update things if they should be non-default
dwDirBrowseFlags ^= MD_DIRBROW_SHOW_DATE | MD_DIRBROW_SHOW_TIME | MD_DIRBROW_SHOW_SIZE | MD_DIRBROW_SHOW_EXTENSION | MD_DIRBROW_LONG_DATE | MD_DIRBROW_LOADDEFAULT;

hr = ScaWriteConfigID(IIS_DIRPROP_BROWSEFLAGS);
ExitOnFailure(hr, "Failed to write DirProp BrowseFlags id");
hr = ScaWriteConfigInteger(dwDirBrowseFlags);
ExitOnFailure(hr, "Failed to write DirBrowseFlags for Web");
}

//End of Dir Properties
hr = ScaWriteConfigID(IIS_DIRPROP_END);
ExitOnFailure(hr, "Failed to write DirProp end id");
77 changes: 77 additions & 0 deletions src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs
Original file line number Diff line number Diff line change
@@ -25,6 +25,83 @@ public void CanBuildUsingIIs()
}, results);
}

[Fact]
public void CanBuildWebDirProperties()
{
var folder = TestData.Get(@"TestData\WebDirProperties");
var build = new Builder(folder, typeof(IisExtensionFactory), new[] { folder });

var results = build.BuildAndQuery(Build, validate: true, "Wix4IIsWebSite", "Wix4IIsWebDir", "Wix4IIsWebDirProperties");
WixAssert.CompareLineByLine(new[]
{
"Wix4IIsWebDir:TestDirAccessSSL\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestAccessSSL\tTestAccessSSL\t",
"Wix4IIsWebDir:TestDirAccessSSL128\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestAccessSSL128\tTestAccessSSL128\t",
"Wix4IIsWebDir:TestDirAccessSSLMapCert\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestAccessSSLMapCert\tTestAccessSSLMapCert\t",
"Wix4IIsWebDir:TestDirAccessSSLNegotiateCert\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestAccessSSLNegotiateCert\tTestAccessSSLNegotiateCert\t",
"Wix4IIsWebDir:TestDirAccessSSLRequireCert\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestAccessSSLRequireCert\tTestAccessSSLRequireCert\t",
"Wix4IIsWebDir:TestDirAnonymousAccess\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestAnonymousAccess\tTestAnonymousAccess\t",
"Wix4IIsWebDir:TestDirAspDetailedError\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestAspDetailedError\tTestAspDetailedError\t",
"Wix4IIsWebDir:TestDirAuthenticationProviders\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestAuthenticationProviders\tTestAuthenticationProviders\t",
"Wix4IIsWebDir:TestDirBasicAuthentication\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestBasicAuthentication\tTestBasicAuthentication\t",
"Wix4IIsWebDir:TestDirCacheControlCustom\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestCacheControlCustom\tTestCacheControlCustom\t",
"Wix4IIsWebDir:TestDirCacheControlMaxAge\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestCacheControlMaxAge\tTestCacheControlMaxAge\t",
//"Wix4IIsWebDir:TestDirCacheControlMaxAgeNull\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestCacheControlMaxAgeNull\tTestCacheControlMaxAgeNull\t",
"Wix4IIsWebDir:TestDirClearCustomError\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestClearCustomError\tTestClearCustomError\t",
"Wix4IIsWebDir:TestDirDefaultDocuments\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestDefaultDocuments\tTestDefaultDocuments\t",
"Wix4IIsWebDir:TestDirDigestAuthentication\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestDigestAuthentication\tTestDigestAuthentication\t",
"Wix4IIsWebDir:TestDirDirBrowseShowDate\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestDirBrowseShowDate\tTestDirBrowseShowDate\t",
"Wix4IIsWebDir:TestDirDirBrowseShowExtension\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestDirBrowseShowExtension\tTestDirBrowseShowExtension\t",
"Wix4IIsWebDir:TestDirDirBrowseShowLongDate\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestDirBrowseShowLongDate\tTestDirBrowseShowLongDate\t",
"Wix4IIsWebDir:TestDirDirBrowseShowSize\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestDirBrowseShowSize\tTestDirBrowseShowSize\t",
"Wix4IIsWebDir:TestDirDirBrowseShowTime\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestDirBrowseShowTime\tTestDirBrowseShowTime\t",
"Wix4IIsWebDir:TestDirEnableDefaultDoc\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestEnableDefaultDoc\tTestEnableDefaultDoc\t",
"Wix4IIsWebDir:TestDirEnableDirBrowsing\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestEnableDirBrowsing\tTestEnableDirBrowsing\t",
"Wix4IIsWebDir:TestDirExecute\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestExecute\tTestExecute\t",
"Wix4IIsWebDir:TestDirHttpExpires\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestHttpExpires\tTestHttpExpires\t",
"Wix4IIsWebDir:TestDirIIsControlledPassword\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestIIsControlledPassword\tTestIIsControlledPassword\t",
"Wix4IIsWebDir:TestDirIndex\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestIndex\tTestIndex\t",
"Wix4IIsWebDir:TestDirLogVisits\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestLogVisits\tTestLogVisits\t",
"Wix4IIsWebDir:TestDirPassportAuthentication\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestPassportAuthentication\tTestPassportAuthentication\t",
"Wix4IIsWebDir:TestDirRead\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestRead\tTestRead\t",
"Wix4IIsWebDir:TestDirScript\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestScript\tTestScript\t",
"Wix4IIsWebDir:TestDirWindowsAuthentication\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestWindowsAuthentication\tTestWindowsAuthentication\t",
"Wix4IIsWebDir:TestDirWrite\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest\tTestWrite\tTestWrite\t",
"Wix4IIsWebDirProperties:TestAccessSSL\t\t\t\t0\t\t\t\t\t\t\t\t\t8\t\t",
"Wix4IIsWebDirProperties:TestAccessSSL128\t\t\t\t0\t\t\t\t\t\t\t\t\t256\t\t",
"Wix4IIsWebDirProperties:TestAccessSSLMapCert\t\t\t\t0\t\t\t\t\t\t\t\t\t128\t\t",
"Wix4IIsWebDirProperties:TestAccessSSLNegotiateCert\t\t\t\t0\t\t\t\t\t\t\t\t\t32\t\t",
"Wix4IIsWebDirProperties:TestAccessSSLRequireCert\t\t\t\t0\t\t\t\t\t\t\t\t\t64\t\t",
"Wix4IIsWebDirProperties:TestAnonymousAccess\t\t1\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestAspDetailedError\t\t\t\t0\t\t\t\t1\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestAuthenticationProviders\t\t\t\t0\t\t\t\t\t\t\t\t\t\tNTLM\t",
"Wix4IIsWebDirProperties:TestBasicAuthentication\t\t2\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestCacheControlCustom\t\t\t\t0\t\t\t\t\t\t\tCacheControl\t\t\t\t",
"Wix4IIsWebDirProperties:TestCacheControlMaxAge\t\t\t\t0\t\t\t\t\t\t-1\t\t\t\t\t",
//"Wix4IIsWebDirProperties:TestCacheControlMaxAgeNull\t\t\t\t0\t\t\t\t\t\t4294967295\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestClearCustomError\t\t\t\t0\t\t\t\t\t\t\t\t1\t\t\t",
"Wix4IIsWebDirProperties:TestDefaultDocuments\t\t\t\t0\t\t\tDefaultDocument.html,index.html,index.htm\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestDigestAuthentication\t\t16\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestDirBrowseShowDate\t\t\t\t0\t\t\t\t\t\t\t\t\t\t\t1",
"Wix4IIsWebDirProperties:TestDirBrowseShowExtension\t\t\t\t0\t\t\t\t\t\t\t\t\t\t\t2",
"Wix4IIsWebDirProperties:TestDirBrowseShowLongDate\t\t\t\t0\t\t\t\t\t\t\t\t\t\t\t4",
"Wix4IIsWebDirProperties:TestDirBrowseShowSize\t\t\t\t0\t\t\t\t\t\t\t\t\t\t\t8",
"Wix4IIsWebDirProperties:TestDirBrowseShowTime\t\t\t\t0\t\t\t\t\t\t\t\t\t\t\t16",
"Wix4IIsWebDirProperties:TestEnableDefaultDoc\t\t\t\t0\t\t\t\t\t\t\t\t\t\t\t32",
"Wix4IIsWebDirProperties:TestEnableDirBrowsing\t\t\t\t0\t\t\t\t\t\t\t\t\t\t\t64",
"Wix4IIsWebDirProperties:TestExecute\t4\t\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestHttpExpires\t\t\t\t0\t\t\t\t\tyes\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestIIsControlledPassword\t\t\t\t1\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestIndex\t\t\t\t0\t\t1\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestLogVisits\t\t\t\t0\t1\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestPassportAuthentication\t\t64\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestRead\t1\t\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestScript\t512\t\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestWindowsAuthentication\t\t4\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebDirProperties:TestWrite\t2\t\t\t0\t\t\t\t\t\t\t\t\t\t\t",
"Wix4IIsWebSite:Test\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest web server\t\tTestWebSiteProductDirectory\t2\t2\tTestAddress\t\t\t\t\t",
}, results);
}

private static void Build(string[] args)
{
var newArgs = args.ToList();
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--
This file contains the declaration of all the localizable strings.
-->
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">

<String Id="DowngradeError" Value="A newer version of [ProductName] is already installed." />
<String Id="FeatureTitle" Value="MsiPackage" />

</WixLocalization>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200">
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />

<Feature Id="ProductFeature" Title="!(loc.FeatureTitle)">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Package>

<Fragment>
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="MsiPackage">
<Directory Id="TestWebSiteProductDirectory" />
</Directory>
</StandardDirectory>
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:iis="http://wixtoolset.org/schemas/v4/wxs/iis">
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component>
<File Source="example.txt" />

<iis:WebSite Id="Test" Description="Test web server" Directory="TestWebSiteProductDirectory" AutoStart="yes" ConfigureIfExists="no" >
<!--<iis:WebDirProperties Id="Test"
AccessSSL="yes"
AccessSSL128="yes"
AccessSSLMapCert="yes"
AccessSSLNegotiateCert="yes"
AccessSSLRequireCert="yes"
AnonymousAccess="yes"
WindowsAuthentication="yes"
AuthenticationProviders="NTLM"
PassportAuthentication="yes"
BasicAuthentication="yes"
DigestAuthentication="yes"
IIsControlledPassword="yes"
ClearCustomError="yes"
AspDetailedError="yes"
LogVisits="yes"
Index="yes"
Execute="yes"
Read="yes"
Script="yes"
Write="yes"
DirBrowseShowDate="no"
DirBrowseShowExtension="no"
DirBrowseShowLongDate="yes"
DirBrowseShowSize="no"
DirBrowseShowTime="no"
EnableDefaultDoc="no"
EnableDirBrowsing="yes"
/> -->
<iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />

<!-- Test case for AnonymousUser -->
<!-- todo... requires Wix4User, don't want to do today
<iis:WebDir Path="TestAnonymousUser">
<iis:WebDirProperties AnonymousUser="no" />
</iis:WebDir>
-->
<iis:WebDir Id="TestDirAspDetailedError" Path="TestAspDetailedError">
<iis:WebDirProperties Id="TestAspDetailedError" AspDetailedError="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAuthenticationProviders" Path="TestAuthenticationProviders">
<iis:WebDirProperties Id="TestAuthenticationProviders" AuthenticationProviders="NTLM" />
</iis:WebDir>
<iis:WebDir Id="TestDirCacheControlCustom" Path="TestCacheControlCustom">
<iis:WebDirProperties Id="TestCacheControlCustom" CacheControlCustom="CacheControl" />
</iis:WebDir>
<iis:WebDir Id="TestDirCacheControlMaxAge" Path="TestCacheControlMaxAge">
<iis:WebDirProperties Id="TestCacheControlMaxAge" CacheControlMaxAge="4294967295" />
</iis:WebDir>
<!-- This will crash out validation of DB (since this value is = MSI_NULL_INTEGER)
<iis:WebDir Id="TestDirCacheControlMaxAgeNull" Path="TestCacheControlMaxAgeNull">
<iis:WebDirProperties Id="TestCacheControlMaxAgeNull" CacheControlMaxAge="2147483648" />
</iis:WebDir>-->
<iis:WebDir Id="TestDirClearCustomError" Path="TestClearCustomError">
<iis:WebDirProperties Id="TestClearCustomError" ClearCustomError="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirDefaultDocuments" Path="TestDefaultDocuments">
<iis:WebDirProperties Id="TestDefaultDocuments" DefaultDocuments="DefaultDocument.html,index.html,index.htm" />
</iis:WebDir>
<iis:WebDir Id="TestDirHttpExpires" Path="TestHttpExpires">
<iis:WebDirProperties Id="TestHttpExpires" HttpExpires="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirIIsControlledPassword" Path="TestIIsControlledPassword">
<iis:WebDirProperties Id="TestIIsControlledPassword" IIsControlledPassword="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirIndex" Path="TestIndex">
<iis:WebDirProperties Id="TestIndex" Index="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirLogVisits" Path="TestLogVisits">
<iis:WebDirProperties Id="TestLogVisits" LogVisits="yes" />
</iis:WebDir>

<!-- Test cases for Access attributes -->
<iis:WebDir Id="TestDirExecute" Path="TestExecute">
<iis:WebDirProperties Id="TestExecute" Execute="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirRead" Path="TestRead">
<iis:WebDirProperties Id="TestRead" Read="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirScript" Path="TestScript">
<iis:WebDirProperties Id="TestScript" Script="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirWrite" Path="TestWrite">
<iis:WebDirProperties Id="TestWrite" Write="yes" />
</iis:WebDir>

<!-- Test cases for AccessSSL attributes -->
<iis:WebDir Id="TestDirAccessSSL" Path="TestAccessSSL">
<iis:WebDirProperties Id="TestAccessSSL" AccessSSL="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAccessSSL128" Path="TestAccessSSL128">
<iis:WebDirProperties Id="TestAccessSSL128" AccessSSL128="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAccessSSLMapCert" Path="TestAccessSSLMapCert">
<iis:WebDirProperties Id="TestAccessSSLMapCert" AccessSSLMapCert="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAccessSSLNegotiateCert" Path="TestAccessSSLNegotiateCert">
<iis:WebDirProperties Id="TestAccessSSLNegotiateCert" AccessSSLNegotiateCert="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAccessSSLRequireCert" Path="TestAccessSSLRequireCert">
<iis:WebDirProperties Id="TestAccessSSLRequireCert" AccessSSLRequireCert="yes" />
</iis:WebDir>

<!-- Test cases for DirBrowseFlags -->
<iis:WebDir Id="TestDirDirBrowseShowDate" Path="TestDirBrowseShowDate">
<iis:WebDirProperties Id="TestDirBrowseShowDate" DirBrowseShowDate="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirDirBrowseShowExtension" Path="TestDirBrowseShowExtension">
<iis:WebDirProperties Id="TestDirBrowseShowExtension" DirBrowseShowExtension="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirDirBrowseShowLongDate" Path="TestDirBrowseShowLongDate">
<iis:WebDirProperties Id="TestDirBrowseShowLongDate" DirBrowseShowLongDate="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirDirBrowseShowSize" Path="TestDirBrowseShowSize">
<iis:WebDirProperties Id="TestDirBrowseShowSize" DirBrowseShowSize="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirDirBrowseShowTime" Path="TestDirBrowseShowTime">
<iis:WebDirProperties Id="TestDirBrowseShowTime" DirBrowseShowTime="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirEnableDefaultDoc" Path="TestEnableDefaultDoc">
<iis:WebDirProperties Id="TestEnableDefaultDoc" EnableDefaultDoc="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirEnableDirBrowsing" Path="TestEnableDirBrowsing">
<iis:WebDirProperties Id="TestEnableDirBrowsing" EnableDirBrowsing="yes" />
</iis:WebDir>

<!-- Test cases for Authorization attributes -->
<iis:WebDir Id="TestDirAnonymousAccess" Path="TestAnonymousAccess">
<iis:WebDirProperties Id="TestAnonymousAccess" AnonymousAccess="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirBasicAuthentication" Path="TestBasicAuthentication">
<iis:WebDirProperties Id="TestBasicAuthentication" BasicAuthentication="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirDigestAuthentication" Path="TestDigestAuthentication">
<iis:WebDirProperties Id="TestDigestAuthentication" DigestAuthentication="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirPassportAuthentication" Path="TestPassportAuthentication">
<iis:WebDirProperties Id="TestPassportAuthentication" PassportAuthentication="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirWindowsAuthentication" Path="TestWindowsAuthentication">
<iis:WebDirProperties Id="TestWindowsAuthentication" WindowsAuthentication="yes" />
</iis:WebDir>
</iis:WebSite>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is example.txt.
4 changes: 4 additions & 0 deletions src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj
Original file line number Diff line number Diff line change
@@ -12,6 +12,10 @@
<Content Include="TestData\UsingIis\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
<Content Include="TestData\UsingIis\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
<Content Include="TestData\UsingIis\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
<Content Include="TestData\WebDirProperties\example.txt" CopyToOutputDirectory="PreserveNewest" />
<Content Include="TestData\WebDirProperties\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
<Content Include="TestData\WebDirProperties\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
<Content Include="TestData\WebDirProperties\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
80 changes: 80 additions & 0 deletions src/ext/Iis/wixext/IIsCompiler.cs
Original file line number Diff line number Diff line change
@@ -54,6 +54,24 @@ private enum WebErrorParentType
WebSite = 2,
}

/// <summary>
/// Web Directory Browse Flags.
/// </summary>
/// <remarks>Note that this must be kept in sync with the eWebDirAttributes in scawebprop.h.</remarks>
[Flags]
public enum WebDirAttributes : int
{
DirBrowseShowDate = 1 << 1,
DirBrowseShowExtension = 1 << 2,
DirBrowseShowLongDate = 1 << 3,
DirBrowseShowSize = 1 << 4,
DirBrowseShowTime = 1 << 5,
EnableDefaultDoc = 1 << 6,
EnableDirBrowsing = 1 << 7,

Reserved = 1 << 31,
}

/// <summary>
/// Processes an element for the Compiler.
/// </summary>
@@ -1336,6 +1354,8 @@ private string ParseWebDirPropertiesElement(Intermediate intermediate, Intermedi
var accessSet = false;
int accessSSLFlags = 0;
var accessSSLFlagsSet = false;
WebDirAttributes attributes = 0;
var dirAttributesFlagsSet = false;
string anonymousUser = null;
var aspDetailedError = YesNoType.NotSet;
string authenticationProviders = null;
@@ -1374,6 +1394,10 @@ private string ParseWebDirPropertiesElement(Intermediate intermediate, Intermedi
break;
case "CacheControlMaxAge":
cacheControlMaxAge = this.ParseHelper.GetAttributeLongValue(sourceLineNumbers, attrib, 0, uint.MaxValue); // 4294967295 (uint.MaxValue) represents unlimited
if (cacheControlMaxAge == 0x8000_0000)
{
this.Messaging.Write(ErrorMessages.IllegalMsiUnsignedIntegerValue(sourceLineNumbers, element.Name.LocalName, "CacheControlMaxAge", cacheControlMaxAge.ToString()));
}
break;
case "ClearCustomError":
notCustomError = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
@@ -1497,6 +1521,57 @@ private string ParseWebDirPropertiesElement(Intermediate intermediate, Intermedi
accessSSLFlagsSet = true;
break;

// DirBrowse attributes
case "DirBrowseShowDate":
if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
{
attributes |= WebDirAttributes.DirBrowseShowDate;
dirAttributesFlagsSet = true;
}
break;
case "DirBrowseShowExtension":
if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
{
attributes |= WebDirAttributes.DirBrowseShowExtension;
dirAttributesFlagsSet = true;
}
break;
case "DirBrowseShowLongDate":
if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
{
attributes |= WebDirAttributes.DirBrowseShowLongDate;
dirAttributesFlagsSet = true;
}
break;
case "DirBrowseShowSize":
if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
{
attributes |= WebDirAttributes.DirBrowseShowSize;
dirAttributesFlagsSet = true;
}
break;
case "DirBrowseShowTime":
if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
{
attributes |= WebDirAttributes.DirBrowseShowTime;
dirAttributesFlagsSet = true;
}
break;
case "EnableDefaultDoc":
if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
{
attributes |= WebDirAttributes.EnableDefaultDoc;
dirAttributesFlagsSet = true;
}
break;
case "EnableDirBrowsing":
if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
{
attributes |= WebDirAttributes.EnableDirBrowsing;
dirAttributesFlagsSet = true;
}
break;

// Authorization attributes
case "AnonymousAccess":
if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
@@ -1634,6 +1709,11 @@ private string ParseWebDirPropertiesElement(Intermediate intermediate, Intermedi
{
symbol.AuthenticationProviders = authenticationProviders;
}

if (dirAttributesFlagsSet)
{
symbol.Attributes = (int)attributes;
}
}

return id?.Id;
710 changes: 377 additions & 333 deletions src/ext/Iis/wixext/IIsDecompiler.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/ext/Iis/wixext/IisExtensionFactory.cs
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ public class IisExtensionFactory : BaseExtensionFactory
protected override IReadOnlyCollection<Type> ExtensionTypes => new[]
{
typeof(IIsCompiler),
typeof(IIsDecompiler),
typeof(IIsExtensionData),
typeof(IisWindowsInstallerBackendBinderExtension),
};
1 change: 1 addition & 0 deletions src/ext/Iis/wixext/IisTableDefinitions.cs
Original file line number Diff line number Diff line change
@@ -118,6 +118,7 @@ public static class IisTableDefinitions
new ColumnDefinition("NoCustomError", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether IIs will return custom errors for this directory."),
new ColumnDefinition("AccessSSLFlags", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Specifies AccessSSLFlags IIS metabase property."),
new ColumnDefinition("AuthenticationProviders", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Comma delimited list, in order of precedence, of Windows authentication providers that IIS will attempt to use: NTLM, Kerberos, Negotiate, and others."),
new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Flags for WebDir IIS metabase properties"),
},
symbolIdIsPrimaryKey: true
);
10 changes: 9 additions & 1 deletion src/ext/Iis/wixext/Symbols/IIsWebDirPropertiesSymbol.cs
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ public static partial class IisSymbolDefinitions
new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.NoCustomError), IntermediateFieldType.Number),
new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.AccessSSLFlags), IntermediateFieldType.Number),
new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.AuthenticationProviders), IntermediateFieldType.String),
new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.Attributes), IntermediateFieldType.Number),
},
typeof(IIsWebDirPropertiesSymbol));
}
@@ -50,6 +51,7 @@ public enum IIsWebDirPropertiesSymbolFields
NoCustomError,
AccessSSLFlags,
AuthenticationProviders,
Attributes,
}

public class IIsWebDirPropertiesSymbol : IntermediateSymbol
@@ -147,5 +149,11 @@ public string AuthenticationProviders
get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.AuthenticationProviders].AsString();
set => this.Set((int)IIsWebDirPropertiesSymbolFields.AuthenticationProviders, value);
}

public int? Attributes
{
get => (int?)this.Fields[(int)IIsWebDirPropertiesSymbolFields.Attributes].AsNullableNumber();
set => this.Set((int)IIsWebDirPropertiesSymbolFields.Attributes, value);
}
}
}
}
12 changes: 9 additions & 3 deletions src/internal/SetBuildNumber/Directory.Packages.props.pp
Original file line number Diff line number Diff line change
@@ -40,15 +40,21 @@

<PackageVersion Include="WixToolset.Heat" Version="{packageversion}" />

<PackageVersion Include="WixToolset.Bal.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.BootstrapperApplications.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Bal.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.ComPlus.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Dependency.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.DirectX.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Firewall.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Http.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Iis.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Msmq.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.NetFx.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.PowerShell.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Sql.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.UI.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Util.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Firewall.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Msmq.wixext" Version="{packageversion}" />
<PackageVersion Include="WixToolset.VisualStudio.wixext" Version="{packageversion}" />
</ItemGroup>

<ItemGroup>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<UpgradeCode>{A75B81F4-3335-4B4D-B766-303E136ED374}</UpgradeCode>
<ProductComponentsRef>true</ProductComponentsRef>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Iis.wixext" />
</ItemGroup>
</Project>
32 changes: 32 additions & 0 deletions src/test/msi/TestData/IIsExtensionTests/IisInstall/Product.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:iis="http://wixtoolset.org/schemas/v4/wxs/iis">
<Fragment>
<Property Id="PORT" Value="3062" />

<Binary Id="MyCertBits" SourceFile="example.txt" />

<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="MyCert" Guid="">
<iis:Certificate
Id="Certificate.MyCert"
Name="MyCert certificate"
Request="no"
StoreLocation="localMachine"
StoreName="trustedPublisher"
Overwrite="yes"
BinaryRef="MyCertBits" />
</Component>

<Component>
<File Source="example.txt" />

<iis:WebSite Id="Test" Description="Test web server" Directory="INSTALLFOLDER" AutoStart="yes" DirProperties="ReadAndExecute" ConfigureIfExists="no" >
<iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />
</iis:WebSite>
</Component>
</ComponentGroup>

<iis:WebDirProperties Id="ReadAndExecute" />
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is example.txt.
160 changes: 160 additions & 0 deletions src/test/msi/TestData/IIsExtensionTests/WebDirProperties/Product.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:iis="http://wixtoolset.org/schemas/v4/wxs/iis">
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component>
<File Source="example.txt" />

<iis:WebSite Id="Test" Description="Test web server" Directory="INSTALLFOLDER" AutoStart="yes" ConfigureIfExists="no" >
<!--<iis:WebDirProperties Id="Test"
AccessSSL="yes"
AccessSSL128="yes"
AccessSSLMapCert="yes"
AccessSSLNegotiateCert="yes"
AccessSSLRequireCert="yes"
AnonymousAccess="yes"
WindowsAuthentication="yes"
AuthenticationProviders="NTLM"
PassportAuthentication="yes"
BasicAuthentication="yes"
DigestAuthentication="yes"
IIsControlledPassword="yes"
ClearCustomError="yes"
AspDetailedError="yes"
LogVisits="yes"
Index="yes"
Execute="yes"
Read="yes"
Script="yes"
Write="yes"
DirBrowseShowDate="no"
DirBrowseShowExtension="no"
DirBrowseShowLongDate="yes"
DirBrowseShowSize="no"
DirBrowseShowTime="no"
EnableDefaultDoc="no"
EnableDirBrowsing="yes"
/> -->
<iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />

<!-- Test case for AnonymousUser -->
<!-- todo... requires Wix4User, don't want to do today
<iis:WebDir Path="TestAnonymousUser">
<iis:WebDirProperties AnonymousUser="no" />
</iis:WebDir>
-->
<iis:WebDir Id="TestDirAspDetailedError" Path="TestAspDetailedError">
<iis:WebDirProperties Id="TestAspDetailedError" AspDetailedError="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAuthenticationProviders" Path="TestAuthenticationProviders">
<iis:WebDirProperties Id="TestAuthenticationProviders" AuthenticationProviders="NTLM" />
</iis:WebDir>
<iis:WebDir Id="TestDirCacheControlCustom" Path="TestCacheControlCustom">
<iis:WebDirProperties Id="TestCacheControlCustom" CacheControlCustom="CacheControl" />
</iis:WebDir>
<iis:WebDir Id="TestDirCacheControlMaxAge" Path="TestCacheControlMaxAge">
<iis:WebDirProperties Id="TestCacheControlMaxAge" CacheControlMaxAge="4294967295" />
</iis:WebDir>
<!-- This will crash out validation of DB (since this value is = MSI_NULL_INTEGER)
<iis:WebDir Id="TestDirCacheControlMaxAgeNull" Path="TestCacheControlMaxAgeNull">
<iis:WebDirProperties Id="TestCacheControlMaxAgeNull" CacheControlMaxAge="2147483648" />
</iis:WebDir>-->
<iis:WebDir Id="TestDirClearCustomError" Path="TestClearCustomError">
<iis:WebDirProperties Id="TestClearCustomError" ClearCustomError="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirDefaultDocuments" Path="TestDefaultDocuments">
<iis:WebDirProperties Id="TestDefaultDocuments" DefaultDocuments="DefaultDocument.html,index.html,index.htm" />
</iis:WebDir>
<iis:WebDir Id="TestDirHttpExpires" Path="TestHttpExpires">
<iis:WebDirProperties Id="TestHttpExpires" HttpExpires="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirIIsControlledPassword" Path="TestIIsControlledPassword">
<iis:WebDirProperties Id="TestIIsControlledPassword" IIsControlledPassword="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirIndex" Path="TestIndex">
<iis:WebDirProperties Id="TestIndex" Index="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirLogVisits" Path="TestLogVisits">
<iis:WebDirProperties Id="TestLogVisits" LogVisits="yes" />
</iis:WebDir>

<!-- Test cases for Access attributes -->
<iis:WebDir Id="TestDirExecute" Path="TestExecute">
<iis:WebDirProperties Id="TestExecute" Execute="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirRead" Path="TestRead">
<iis:WebDirProperties Id="TestRead" Read="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirScript" Path="TestScript">
<iis:WebDirProperties Id="TestScript" Script="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirWrite" Path="TestWrite">
<iis:WebDirProperties Id="TestWrite" Write="yes" />
</iis:WebDir>

<!-- Test cases for AccessSSL attributes -->
<iis:WebDir Id="TestDirAccessSSL" Path="TestAccessSSL">
<iis:WebDirProperties Id="TestAccessSSL" AccessSSL="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAccessSSL128" Path="TestAccessSSL128">
<iis:WebDirProperties Id="TestAccessSSL128" AccessSSL128="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAccessSSLMapCert" Path="TestAccessSSLMapCert">
<iis:WebDirProperties Id="TestAccessSSLMapCert" AccessSSLMapCert="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAccessSSLNegotiateCert" Path="TestAccessSSLNegotiateCert">
<iis:WebDirProperties Id="TestAccessSSLNegotiateCert" AccessSSLNegotiateCert="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirAccessSSLRequireCert" Path="TestAccessSSLRequireCert">
<iis:WebDirProperties Id="TestAccessSSLRequireCert" AccessSSLRequireCert="yes" />
</iis:WebDir>

<!-- Test cases for DirBrowseFlags -->
<iis:WebDir Id="TestDirDirBrowseShowDate" Path="TestDirBrowseShowDate">
<iis:WebDirProperties Id="TestDirBrowseShowDate" DirBrowseShowDate="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirDirBrowseShowExtension" Path="TestDirBrowseShowExtension">
<iis:WebDirProperties Id="TestDirBrowseShowExtension" DirBrowseShowExtension="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirDirBrowseShowLongDate" Path="TestDirBrowseShowLongDate">
<iis:WebDirProperties Id="TestDirBrowseShowLongDate" DirBrowseShowLongDate="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirDirBrowseShowSize" Path="TestDirBrowseShowSize">
<iis:WebDirProperties Id="TestDirBrowseShowSize" DirBrowseShowSize="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirDirBrowseShowTime" Path="TestDirBrowseShowTime">
<iis:WebDirProperties Id="TestDirBrowseShowTime" DirBrowseShowTime="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirEnableDefaultDoc" Path="TestEnableDefaultDoc">
<iis:WebDirProperties Id="TestEnableDefaultDoc" EnableDefaultDoc="no" />
</iis:WebDir>
<iis:WebDir Id="TestDirEnableDirBrowsing" Path="TestEnableDirBrowsing">
<iis:WebDirProperties Id="TestEnableDirBrowsing" EnableDirBrowsing="yes" />
</iis:WebDir>

<!-- Test cases for Authorization attributes -->
<iis:WebDir Id="TestDirAnonymousAccess" Path="TestAnonymousAccess">
<iis:WebDirProperties Id="TestAnonymousAccess" AnonymousAccess="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirBasicAuthentication" Path="TestBasicAuthentication">
<iis:WebDirProperties Id="TestBasicAuthentication" BasicAuthentication="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirDigestAuthentication" Path="TestDigestAuthentication">
<iis:WebDirProperties Id="TestDigestAuthentication" DigestAuthentication="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirPassportAuthentication" Path="TestPassportAuthentication">
<iis:WebDirProperties Id="TestPassportAuthentication" PassportAuthentication="yes" />
</iis:WebDir>
<iis:WebDir Id="TestDirWindowsAuthentication" Path="TestWindowsAuthentication">
<iis:WebDirProperties Id="TestWindowsAuthentication" WindowsAuthentication="yes" />
</iis:WebDir>
</iis:WebSite>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<UpgradeCode>{A75B81F4-3335-4B4D-B766-303E136ED374}</UpgradeCode>
<ProductComponentsRef>true</ProductComponentsRef>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Iis.wixext" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is example.txt.
30 changes: 30 additions & 0 deletions src/test/msi/WixToolsetTest.MsiE2E/IisExtensionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolsetTest.MsiE2E
{
using System;
using WixTestTools;
using Xunit;
using Xunit.Abstractions;

public class IisExtensionTests : MsiE2ETests
{
public IisExtensionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }

[RuntimePrereqFeatureFact("IIS-WebServerRole", "IIS-WebServer")]
public void CanInstallAndUninstallIis()
{
var product = this.CreatePackageInstaller("InstallIis");
product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
}

[RuntimePrereqFeatureFact("IIS-WebServerRole", "IIS-WebServer")]
public void CanInstallAndUninstallWebDirProperties()
{
var product = this.CreatePackageInstaller("WebDirProperties");
product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
}
}
}