Skip to content

Commit

Permalink
Add cert and x64 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Oct 14, 2023
1 parent 0014af6 commit f5e164d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
14 changes: 11 additions & 3 deletions src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,30 @@ namespace WixToolsetTest.Iis
public class IisExtensionFixture
{
[Fact]
public void CanBuildUsingIIsWebAddress()
public void CanBuildUsingIIs()
{
var folder = TestData.Get(@"TestData\UsingIis");
var build = new Builder(folder, typeof(IisExtensionFactory), new[] { folder });

var results = build.BuildAndQuery(Build, validate: true, "Wix4IIsWebSite", "Wix4IIsWebAddress");
var results = build.BuildAndQuery(Build, validate: true, "Wix4Certificate", "Wix4CertificateHash", "Wix4IIsWebSite", "Wix4IIsWebAddress");
WixAssert.CompareLineByLine(new[]
{
"Wix4Certificate:Certificate.MyCert\tMyCert\tMyCert certificate\t2\tTrustedPublisher\t14\tMyCertBits\t\t",
"Wix4IIsWebAddress:TestAddress\tTest\t\t[PORT]\t\t0",
"Wix4IIsWebSite:Test\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest web server\t\tTestWebSiteProductDirectory\t2\t2\tTestAddress\tReadAndExecute\t\t\t\t",
}, results);
}

private static void Build(string[] args)
{
WixRunner.Execute(args).AssertSuccess();
var newArgs = args.ToList();

if (args.First() == "build")
{
newArgs.AddRange(new[] { "-arch", "x64" });
}

WixRunner.Execute(newArgs.ToArray()).AssertSuccess();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<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)" />

Expand All @@ -8,7 +8,7 @@
</Package>

<Fragment>
<StandardDirectory Id="ProgramFilesFolder">
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="MsiPackage">
<Directory Id="TestWebSiteProductDirectory" />
</Directory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +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" />
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component>
<File Source="example.txt" />
<iis:WebSite Id="Test" Description="Test web server" Directory="TestWebSiteProductDirectory" AutoStart="yes" DirProperties="ReadAndExecute" ConfigureIfExists="no" >
<iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />
</iis:WebSite>
</Component>
</ComponentGroup>
<iis:WebDirProperties Id="ReadAndExecute" />
</Fragment>
<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="TestWebSiteProductDirectory" AutoStart="yes" DirProperties="ReadAndExecute" ConfigureIfExists="no" >
<iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />
</iis:WebSite>
</Component>
</ComponentGroup>

<iis:WebDirProperties Id="ReadAndExecute" />
</Fragment>
</Wix>

0 comments on commit f5e164d

Please sign in to comment.