@joebigelow / wix / commits / f5e164d5

Add cert and x64 tests.

Bob Arnson committed Oct 13, 2023 at 20:22 UTC f5e164d513772726ef409921672045ae9cb10e8b
3 files changed +41 -17
src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs
+11 -3
@@ -11,14 +11,15 @@ namespace WixToolsetTest.Iis
11 public class IisExtensionFixture
12 {
13 [Fact]
14 - public void CanBuildUsingIIsWebAddress()
14 + public void CanBuildUsingIIs()
15 {
16 var folder = TestData.Get(@"TestData\UsingIis");
17 var build = new Builder(folder, typeof(IisExtensionFactory), new[] { folder });
18
19 - var results = build.BuildAndQuery(Build, validate: true, "Wix4IIsWebSite", "Wix4IIsWebAddress");
19 + var results = build.BuildAndQuery(Build, validate: true, "Wix4Certificate", "Wix4CertificateHash", "Wix4IIsWebSite", "Wix4IIsWebAddress");
20 WixAssert.CompareLineByLine(new[]
21 {
22 + "Wix4Certificate:Certificate.MyCert\tMyCert\tMyCert certificate\t2\tTrustedPublisher\t14\tMyCertBits\t\t",
23 "Wix4IIsWebAddress:TestAddress\tTest\t\t[PORT]\t\t0",
24 "Wix4IIsWebSite:Test\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest web server\t\tTestWebSiteProductDirectory\t2\t2\tTestAddress\tReadAndExecute\t\t\t\t",
25 }, results);
@@ -26,7 +27,14 @@ namespace WixToolsetTest.Iis
27
28 private static void Build(string[] args)
29 {
29 - WixRunner.Execute(args).AssertSuccess();
30 + var newArgs = args.ToList();
31 +
32 + if (args.First() == "build")
33 + {
34 + newArgs.AddRange(new[] { "-arch", "x64" });
35 + }
36 +
37 + WixRunner.Execute(newArgs.ToArray()).AssertSuccess();
38 }
39 }
40 }
src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/Package.wxs
+2 -2
@@ -1,4 +1,4 @@
1 -<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
1 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2 <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200">
3 <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
4
@@ -8,7 +8,7 @@
8 </Package>
9
10 <Fragment>
11 - <StandardDirectory Id="ProgramFilesFolder">
11 + <StandardDirectory Id="ProgramFiles6432Folder">
12 <Directory Id="INSTALLFOLDER" Name="MsiPackage">
13 <Directory Id="TestWebSiteProductDirectory" />
14 </Directory>
src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/PackageComponents.wxs
+28 -12
@@ -1,16 +1,32 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 xmlns:iis="http://wixtoolset.org/schemas/v4/wxs/iis">
4 - <Fragment>
5 - <Property Id="PORT" Value="3062" />
6 - <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
7 - <Component>
8 - <File Source="example.txt" />
9 - <iis:WebSite Id="Test" Description="Test web server" Directory="TestWebSiteProductDirectory" AutoStart="yes" DirProperties="ReadAndExecute" ConfigureIfExists="no" >
10 - <iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />
11 - </iis:WebSite>
12 - </Component>
13 - </ComponentGroup>
14 - <iis:WebDirProperties Id="ReadAndExecute" />
15 - </Fragment>
4 + <Fragment>
5 + <Property Id="PORT" Value="3062" />
6 +
7 + <Binary Id="MyCertBits" SourceFile="example.txt" />
8 +
9 + <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
10 + <Component Id="MyCert" Guid="">
11 + <iis:Certificate
12 + Id="Certificate.MyCert"
13 + Name="MyCert certificate"
14 + Request="no"
15 + StoreLocation="localMachine"
16 + StoreName="trustedPublisher"
17 + Overwrite="yes"
18 + BinaryRef="MyCertBits" />
19 + </Component>
20 +
21 + <Component>
22 + <File Source="example.txt" />
23 +
24 + <iis:WebSite Id="Test" Description="Test web server" Directory="TestWebSiteProductDirectory" AutoStart="yes" DirProperties="ReadAndExecute" ConfigureIfExists="no" >
25 + <iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" />
26 + </iis:WebSite>
27 + </Component>
28 + </ComponentGroup>
29 +
30 + <iis:WebDirProperties Id="ReadAndExecute" />
31 + </Fragment>
32 </Wix>