Skip to content

Commit

Permalink
Properly fragment NetFx custom actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Aug 15, 2023
1 parent 59f37d2 commit 6f520b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
17 changes: 0 additions & 17 deletions src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ public void CanBuildUsingNativeImage()
var results = build.BuildAndQuery(Build, "Binary", "CustomAction", "Wix4NetFxNativeImage");
WixAssert.CompareLineByLine(new[]
{
"Binary:Wix4NetCheck_arm64\t[Binary data]",
"Binary:Wix4NetCheck_x64\t[Binary data]",
"Binary:Wix4NetCheck_x86\t[Binary data]",
"Binary:Wix4NetFxCA_X86\t[Binary data]",
"CustomAction:Wix4NetFxDotNetCompatibilityCheck_X86\t1\tWix4NetFxCA_X86\tDotNetCompatibilityCheck\t",
"CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_X86\t3649\tWix4NetFxCA_X86\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageCommitUninstall_X86\t3649\tWix4NetFxCA_X86\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageInstall_X86\t3137\tWix4NetFxCA_X86\tExecNetFx\t",
Expand All @@ -140,11 +136,7 @@ public void CanBuildUsingNativeImageX64()
var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "Wix4NetFxNativeImage");
WixAssert.CompareLineByLine(new[]
{
"Binary:Wix4NetCheck_arm64\t[Binary data]",
"Binary:Wix4NetCheck_x64\t[Binary data]",
"Binary:Wix4NetCheck_x86\t[Binary data]",
"Binary:Wix4NetFxCA_X64\t[Binary data]",
"CustomAction:Wix4NetFxDotNetCompatibilityCheck_X64\t1\tWix4NetFxCA_X64\tDotNetCompatibilityCheck\t",
"CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_X64\t3649\tWix4NetFxCA_X64\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageCommitUninstall_X64\t3649\tWix4NetFxCA_X64\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageInstall_X64\t3137\tWix4NetFxCA_X64\tExecNetFx\t",
Expand All @@ -163,11 +155,7 @@ public void CanBuildUsingNativeImageARM64()
var results = build.BuildAndQuery(BuildARM64, "Binary", "CustomAction", "Wix4NetFxNativeImage");
WixAssert.CompareLineByLine(new[]
{
"Binary:Wix4NetCheck_arm64\t[Binary data]",
"Binary:Wix4NetCheck_x64\t[Binary data]",
"Binary:Wix4NetCheck_x86\t[Binary data]",
"Binary:Wix4NetFxCA_A64\t[Binary data]",
"CustomAction:Wix4NetFxDotNetCompatibilityCheck_A64\t1\tWix4NetFxCA_A64\tDotNetCompatibilityCheck\t",
"CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_A64\t3649\tWix4NetFxCA_A64\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageCommitUninstall_A64\t3649\tWix4NetFxCA_A64\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageInstall_A64\t3137\tWix4NetFxCA_A64\tExecNetFx\t",
Expand All @@ -191,11 +179,6 @@ public void CanBuildUsingDotNetCompatibilityCheck()
"Binary:Wix4NetCheck_x86\t[Binary data]",
"Binary:Wix4NetFxCA_X64\t[Binary data]",
"CustomAction:Wix4NetFxDotNetCompatibilityCheck_X64\t1\tWix4NetFxCA_X64\tDotNetCompatibilityCheck\t",
"CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_X64\t3649\tWix4NetFxCA_X64\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageCommitUninstall_X64\t3649\tWix4NetFxCA_X64\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageInstall_X64\t3137\tWix4NetFxCA_X64\tExecNetFx\t",
"CustomAction:Wix4NetFxExecuteNativeImageUninstall_X64\t3137\tWix4NetFxCA_X64\tExecNetFx\t",
"CustomAction:Wix4NetFxScheduleNativeImage_X64\t1\tWix4NetFxCA_X64\tSchedNetFx\t",
"Wix4NetFxDotNetCheck:DotNetCoreCheckManualId\tMicrosoft.NETCore.App\tx64\t7.0.1\tLatestMajor\tDOTNETCORECHECKRESULT",
}, results.OrderBy(s => s).ToArray());
}
Expand Down
16 changes: 11 additions & 5 deletions src/ext/NetFx/wixlib/NetFxExtension_Platform.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,31 @@
<CustomAction Id="$(var.Prefix)NetFxExecuteNativeImageCommitInstall$(var.Suffix)" DllEntry="ExecNetFx" Execute="commit" Impersonate="no" Return="ignore" SuppressModularization="yes" BinaryRef="$(var.Prefix)NetFxCA$(var.Suffix)" />
<CustomAction Id="$(var.Prefix)NetFxExecuteNativeImageUninstall$(var.Suffix)" DllEntry="ExecNetFx" Execute="deferred" Impersonate="no" Return="ignore" SuppressModularization="yes" BinaryRef="$(var.Prefix)NetFxCA$(var.Suffix)" />
<CustomAction Id="$(var.Prefix)NetFxExecuteNativeImageCommitUninstall$(var.Suffix)" DllEntry="ExecNetFx" Execute="commit" Impersonate="no" Return="ignore" SuppressModularization="yes" BinaryRef="$(var.Prefix)NetFxCA$(var.Suffix)" />
<CustomAction Id="$(var.Prefix)NetFxDotNetCompatibilityCheck$(var.Suffix)" DllEntry="DotNetCompatibilityCheck" Execute="immediate" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)NetFxCA$(var.Suffix)" />

<InstallExecuteSequence>
<Custom Action="$(var.Prefix)NetFxScheduleNativeImage$(var.Suffix)" Before="InstallFiles" Overridable="yes" />
<Custom Action="$(var.Prefix)NetFxExecuteNativeImageCommitUninstall$(var.Suffix)" After="MsiPublishAssemblies" Overridable="yes" Condition="RollbackDisabled &lt;&gt; 1" />
<Custom Action="$(var.Prefix)NetFxExecuteNativeImageUninstall$(var.Suffix)" After="$(var.Prefix)NetFxExecuteNativeImageCommitUninstall$(var.Suffix)" Overridable="yes" Condition="RollbackDisabled = 1" />
<Custom Action="$(var.Prefix)NetFxExecuteNativeImageCommitInstall$(var.Suffix)" After="$(var.Prefix)NetFxExecuteNativeImageUninstall$(var.Suffix)" Overridable="yes" Condition="RollbackDisabled &lt;&gt; 1" />
<Custom Action="$(var.Prefix)NetFxExecuteNativeImageInstall$(var.Suffix)" After="$(var.Prefix)NetFxExecuteNativeImageCommitInstall$(var.Suffix)" Overridable="yes" Condition="RollbackDisabled = 1" />
</InstallExecuteSequence>
</Fragment>

<Fragment>
<Binary Id="$(var.Prefix)NetFxCA$(var.Suffix)" SourceFile="!(bindpath.netfxca.$(var.platform))netfxca.dll" />
</Fragment>

<Fragment>
<CustomAction Id="$(var.Prefix)NetFxDotNetCompatibilityCheck$(var.Suffix)" DllEntry="DotNetCompatibilityCheck" Execute="immediate" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)NetFxCA$(var.Suffix)" />

<InstallExecuteSequence>
<Custom Action="$(var.Prefix)NetFxDotNetCompatibilityCheck$(var.Suffix)" Before="LaunchConditions" Overridable="yes" />
</InstallExecuteSequence>

<InstallUISequence>
<Custom Action="$(var.Prefix)NetFxDotNetCompatibilityCheck$(var.Suffix)" Before="LaunchConditions" Overridable="yes" />
</InstallUISequence>
</Fragment>

<!-- NetFx Custom Action DLL Definitions -->
<Fragment>
<Binary Id="$(var.Prefix)NetFxCA$(var.Suffix)" SourceFile="!(bindpath.netfxca.$(var.platform))netfxca.dll" />
<Binary Id="$(var.Prefix)NetCheck_x86" SourceFile="!(bindpath.x86)NetCoreCheck.exe" />
<Binary Id="$(var.Prefix)NetCheck_x64" SourceFile="!(bindpath.x64)NetCoreCheck.exe" />
<Binary Id="$(var.Prefix)NetCheck_arm64" SourceFile="!(bindpath.arm64)NetCoreCheck.exe" />
Expand Down

0 comments on commit 6f520b9

Please sign in to comment.