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 cert and x64 tests. #461

Merged
merged 2 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
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
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>
12 changes: 6 additions & 6 deletions src/ext/Util/ca/CloseApps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static HRESULT PromptToContinue(
}

/******************************************************************
SendProcessMessage - helper function to enumerate the top-level
SendProcessMessage - helper function to enumerate the top-level
windows and send to all matching a process ID.

******************************************************************/
Expand Down Expand Up @@ -164,7 +164,7 @@ void SendProcessMessage(
}

/******************************************************************
SendApplicationMessage - helper function to iterate through the
SendApplicationMessage - helper function to iterate through the
processes for the specified application and send all
applicable process Ids a message and give them time to process
the message.
Expand Down Expand Up @@ -250,7 +250,7 @@ void TerminateProcesses(
/******************************************************************
WixCloseApplications - entry point for WixCloseApplications Custom Action

called as Type 1 CustomAction (binary DLL) from Windows Installer
called as Type 1 CustomAction (binary DLL) from Windows Installer
in InstallExecuteSequence before InstallFiles
******************************************************************/
extern "C" UINT __stdcall WixCloseApplications(
Expand Down Expand Up @@ -462,9 +462,9 @@ extern "C" UINT __stdcall WixCloseApplications(


/******************************************************************
WixCloseApplicationsDeferred - entry point for
WixCloseApplicationsDeferred - entry point for
WixCloseApplicationsDeferred Custom Action
called as Type 1025 CustomAction
called as Type 1025 CustomAction
(deferred binary DLL)

NOTE: deferred CustomAction since it modifies the machine
Expand Down Expand Up @@ -533,7 +533,7 @@ extern "C" UINT __stdcall WixCloseApplicationsDeferred(
SendApplicationMessage(pwzTarget, WM_QUERYENDSESSION, dwTimeout);
}

// If we find that an app that we need closed is still runing, require a
// If we find that an app that we need closed is still running, require a
// restart or kill the process as directed.
ProcFindAllIdsFromExeName(pwzTarget, &prgProcessIds, &cProcessIds);
if (0 < cProcessIds)
Expand Down