Skip to content

Commit

Permalink
- Proposal #1456: Using PublishAot instead of SfxCA for custom actions
Browse files Browse the repository at this point in the history
  Support for CA compiled with .NETCore (AOT)
  • Loading branch information
oleg-shilo committed Feb 16, 2024
1 parent 6af8bb1 commit 1e41e1f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Source/src/WixSharp/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2778,19 +2778,25 @@ static void ProcessCustomActions(Project wProject, XElement product)

if (existingBinary == null)
{
PackageManagedAsm(
asmFile,
packageFile,
wManagedAction.RefAssemblies.Concat(wProject.DefaultRefAssemblies).Distinct().ToArray(),
wProject.OutDir,
wProject.CustomActionConfig,
wProject.Platform,
false);
string nativeCAdll = asmFile;

if (wManagedAction.CreateInteropWrapper)
{
PackageManagedAsm(
asmFile,
packageFile,
wManagedAction.RefAssemblies.Concat(wProject.DefaultRefAssemblies).Distinct().ToArray(),
wProject.OutDir,
wProject.CustomActionConfig,
wProject.Platform,
false);
nativeCAdll = packageFile;
}

bynaryKey = wAction.Name.Expand() + "_File";
product.Add(new XElement("Binary",
new XAttribute("Id", bynaryKey),
new XAttribute("SourceFile", packageFile)));
new XAttribute("SourceFile", nativeCAdll)));
}
else
{
Expand Down
9 changes: 9 additions & 0 deletions Source/src/WixSharp/ManagedAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,15 @@ internal int GetRefAssembliesHashCode(IEnumerable<string> defaultAssemblies)
/// </summary>
public string MethodName = "";

/// <summary>
/// Flag indicating if the assembly should be wrapped into the native package with `makeSfxCA.exe`.
/// <para>It is set to <c>true</c> by default</para>
/// <para>
/// You should set it to <c>false</c> if the assembly is compiled as AOT.
/// </para>
/// </summary>
public bool CreateInteropWrapper = true;

/// <summary>
/// Comma separated list of properties which the custom action is intended to use. Set this property if you are implementing the 'deferred' (as well as 'rollback' and 'commit') action.
/// <remarks>
Expand Down

0 comments on commit 1e41e1f

Please sign in to comment.