Skip to content

Commit

Permalink
WiX4: #1379: A way (Or create an example) of how to create a standalo…
Browse files Browse the repository at this point in the history
…ne fragment and insert into Projects / chains / etc
  • Loading branch information
oleg-shilo committed Nov 30, 2023
1 parent 0d5be0f commit b003d96
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions Source/src/WixSharp/CommonTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,15 @@ static public RegValue[] ImportRegFile(string regFile)
return RegFileImporter.ImportFrom(regFile);
}

/// <summary>
/// Adds the specified XML content as a WiX Fragment/FragmentRef elements combination.
/// </summary>
/// <param name="placementPath">The placement path to the element matching the specified path (e.g. <c>Select("Product/Package")</c>.</param>
/// <param name="wixFile">The file with the XML fragment content.</param>
/// <returns></returns>
static public WixProject AddWixFragmentFile(this Project project, string placementPath, string wixFile)
=> project.AddWixFragment(placementPath, XElement.Parse(System.IO.File.ReadAllText(wixFile)));

/// <summary>
/// Imports the reg file. It is nothing else but an extension method version of the 'plain' <see cref="T:WixSharp.CommonTasks.Tasks.ImportRegFile"/>.
/// </summary>
Expand Down Expand Up @@ -597,7 +606,7 @@ static public WixStandardBootstrapperApplication AddPayload(this WixStandardBoot
/// <param name="payloadFile">The payload file.</param>
/// <returns></returns>
static public WixStandardBootstrapperApplication AddPayload(this WixStandardBootstrapperApplication project, string payloadFile)
=> project.AddPayload(new Bootstrapper.Payload(payloadFile));
=> project.AddPayload(new Bootstrapper.Payload(payloadFile));

/// <summary>
/// Adds the directory items to the Project.
Expand Down Expand Up @@ -1715,7 +1724,7 @@ public static ManagedProject UnelevateAfterInstallEvent(this ManagedProject proj
{
doc.FindAll("CustomAction")
.FirstOrDefault(x => x.HasAttribute("Id", "WixSharp_AfterInstall_Action"))
?.SetAttribute("Execute", "immediate");
?.SetAttribute("Execute", "immediate");
};
return project;
}
Expand Down Expand Up @@ -2016,9 +2025,9 @@ public int ConsoleRun(Action<string> onConsoleOut)
public static class SessionDataExtensions
{
static string persitentDataDir = System.IO.Path.Combine(
Environment.SpecialFolder.CommonApplicationData.ToPath(),
"WixSharp",
"SessionData")
Environment.SpecialFolder.CommonApplicationData.ToPath(),
"WixSharp",
"SessionData")
.EnsureDirExists();

/// <summary>
Expand Down Expand Up @@ -2130,14 +2139,14 @@ static string PackageDir(string name)
/// <value>The well known locations.</value>
static public List<string> WellKnownLocations = new List<string>
{
@"C:\Program Files (x86)\Windows Kits\10\App Certification Kit",
@"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86",
@"C:\Program Files (x86)\Windows Kits\10\bin\x86",
@"C:\Program Files (x86)\Windows Kits\8.1\bin\x86",
@"C:\Program Files (x86)\Windows Kits\8.0\bin\x86",
@"C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool",
@"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin",
@"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin"
@"C:\Program Files (x86)\Windows Kits\10\App Certification Kit",
@"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86",
@"C:\Program Files (x86)\Windows Kits\10\bin\x86",
@"C:\Program Files (x86)\Windows Kits\8.1\bin\x86",
@"C:\Program Files (x86)\Windows Kits\8.0\bin\x86",
@"C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool",
@"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin",
@"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin"
};

static string signTool;
Expand Down

0 comments on commit b003d96

Please sign in to comment.