Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit b842027
Author: Bob Arnson <bob@firegiant.com>
Date:   Mon Oct 23 00:17:18 2023 -0400

    Introduce a new phase in the build pipeline.

    A useful point in the build pipeline is after all the files in the
    project have been compiled but before they've been linked.
    The WiX core and extensions can operate on symbols across
    the project but without operating at the source-code level.

    This phase is currently named "optimize," after a moderately-similar
    phase in other compiler architectures. The name is, for now, a stake in
    the ground and a better alternate is welcome.

commit bb691bd
Author: Bob Arnson <bob@firegiant.com>
Date:   Fri Oct 13 20:22:34 2023 -0400

    Random typo fix.

commit f5e164d
Author: Bob Arnson <bob@firegiant.com>
Date:   Fri Oct 13 20:22:21 2023 -0400

    Add cert and x64 tests.

commit 0014af6
Author: apacker1 <apacker1@users.noreply.github.com>
Date:   Fri Sep 22 14:41:57 2023 -0700

    DotNetCompatibilityCheck: If running NetCoreCheck.exe fails with error code ERROR_EXE_MACHINE_TYPE_MISMATCH or ERROR_BAD_EXE_FORMAT then don't abort the installation, just set the property to 13.  Fixes issue #7737

commit e570ce5
Author: Rob Mensching <rob@firegiant.com>
Date:   Tue Sep 12 14:08:34 2023 -0700

    Update to latest signing infrastructure

    Fixes 7546

commit 409d3b6
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Sat Aug 26 17:31:08 2023 +1000

    add FIREWALL_EXCEPTION_ATTRIBUTES struct

commit e7656ce
Author: Bob Arnson <bob@firegiant.com>
Date:   Sun Sep 10 22:52:33 2023 -0400

    Remove unused symbol `Version`.

commit f18d7e6
Author: Rob Mensching <rob@firegiant.com>
Date:   Mon Sep 4 23:40:46 2023 -0700

    Correctly process build -outputType switch

    Also add a few additional output types to built-in backends.

    Fixes 7708

commit e29b4aa
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Mon Aug 21 11:34:51 2023 +1000

    remove windows xp specific code from firewall extension

commit b3deb46
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Sat Aug 26 08:31:28 2023 +1000

    add firewall extension decompiler

commit 537e79d
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Sun Aug 20 19:49:21 2023 +1000

    use WcaGetRecordFormattedString to get firewall rule description

commit febb9c9
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Sun Aug 13 11:34:57 2023 +1000

    add integration tests for the firewall extenstion

commit 6f520b9
Author: Bob Arnson <bob@firegiant.com>
Date:   Tue Aug 15 18:05:47 2023 -0400

    Properly fragment NetFx custom actions.

    FIxes wixtoolset/issues#7677.

commit 59f37d2
Author: Rob Mensching <rob@firegiant.com>
Date:   Mon Aug 7 15:43:10 2023 -0700

    Fix the use of ModuleSubstitution table

    Addresses two issues in the creation of configurable merge modules. First, the
    ModuleConfiguration table Id should not be modularized. Second, the
    ModuleSubstitution table was never created. Fixing both of those allows
    configurable merge modules to work again.

    Fixes 7559

commit 2b429e9
Author: Rob Mensching <rob@firegiant.com>
Date:   Mon Aug 7 12:31:20 2023 -0700

    Remove Esproj test

    The npm packages in esproj regularly encounter security issues that are not
    relevant to WiX. The test provides less value than the churn required to keep
    all the test project up to date, so deleting it.

commit 9607c3a
Author: Rob Mensching <rob@firegiant.com>
Date:   Mon Aug 7 12:07:39 2023 -0700

    Ensure the Font actions are scheduled for TrueType fonts

    TrueType fonts are denoted by the empty string in the FontTitle field of the
    FileSymbol. That means a non-null FontTitle field value means a font is being
    installed.

    Fixes 7593

commit 6d5c4be
Author: Bob Arnson <bob@firegiant.com>
Date:   Sat Jul 29 20:57:14 2023 -0400

    Remove legacy permissions support.

    In the long ago, a share could have one user/permissions pair. That's
    really limited, of course, so support for _n_ user/permissions pairs
    was added. In the move to WiX v4, support for that single, legacy user
    was removed from the extension side but not the custom action side.
    Remove that support.

    Fixes wixtoolset/issues#7632.

commit d8832db
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Wed Aug 2 19:39:25 2023 +1000

    fix stack corruption around cbdata when adding a machine certificate

commit 5e9901d
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Sat Jul 22 09:01:55 2023 +1000

    Multiple extension support in unit tests

commit 1c50eb8
Author: Bob Arnson <bob@firegiant.com>
Date:   Fri Jul 21 19:56:59 2023 -0400

    Fix mentions of dark.exe.

commit e0641f1
Author: Marco Stadler <marco.stadler@bruker.com>
Date:   Mon Apr 24 11:49:53 2023 +0200

    Allow custom package comments

    Fixes #7369

commit 42118ef
Author: Rob Mensching <rob@firegiant.com>
Date:   Wed Jul 19 10:20:19 2023 -0700

    Fix out of date references to Product in warnings

    Fixes 7631

commit 7a603e4
Author: Rob Mensching <rob@firegiant.com>
Date:   Wed Jul 19 10:19:35 2023 -0700

    Remove invalid references to ToolsVersion in ext wixlib projects

commit d20b6d4
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Wed Jul 19 10:11:18 2023 +1000

    feat(build): update xunit to version 2.5.0, fix occasional test timeout

commit cef14c6
Author: Bob Arnson <bob@firegiant.com>
Date:   Thu Jun 15 15:40:37 2023 -0400

    Ensure extensions get the same decompiler helper.

    Fixes wixtoolset/issues#7548.

    THIS IS A BREAKING INTERFACE/EXTENSIBILITY CHANGE.

commit 164c29a
Author: Bob Arnson <bob@firegiant.com>
Date:   Tue Jul 11 21:19:08 2023 -0400

    Partial fix for the weirdly broken...

    IWindowsInstallerDecompileContext.TreatProductAsModule.

    wixtoolset/issues#7607

commit 713f286
Author: Rob Mensching <rob@firegiant.com>
Date:   Sat Jul 8 09:10:50 2023 -0700

    Fix typo where Level was used instead of Value in Level element error message

    Fixes 7603

commit e53c658
Author: Bob Arnson <bob@firegiant.com>
Date:   Thu Jun 29 21:16:35 2023 -0400

    Extract object fields with modularization GUIDs.

commit ddae99c
Author: Bob Arnson <bob@firegiant.com>
Date:   Tue Jun 20 20:09:19 2023 -0400

    Handle MergeModule.CABinet for extraction.

    Fixes wixtoolset/issues#7568,

commit 9a550ac
Author: Michael Stoll <michael.stoll@stolltec.com>
Date:   Wed May 3 18:04:48 2023 +0200

    Add more _NODOMAIN properties to WixQueryOsWellKnownSID

commit 35d30e0
Author: Bob Arnson <bob@firegiant.com>
Date:   Thu May 18 20:47:27 2023 -0400

    Improve logging to remove `(null)`.

    Add detached container runtime test.

    Inspired by wixtoolset/issues#7490.

commit f474066
Author: Jesper Hansen <jesper@staunhansen.dk>
Date:   Mon Jun 12 14:39:32 2023 +0200

    Update WindowsInstallerStandard.cs ordered sequence

    Ordered standard actions by sequence and group for more human readability

commit 2daf189
Author: Nir Bar <nir.bar@panel-sw.co.il>
Date:   Thu Apr 20 08:44:54 2023 +0300

    Allow customized AdditionalOptions for all HarvestX MSBuild ItemGroups

commit 783b829
Author: Rob Mensching <rob@firegiant.com>
Date:   Fri Jun 2 11:45:10 2023 -0700

    ProjectReferences to wixlibs should participate in DefineConstants creation

    Also fix documentation in ResolveWixLibraryReferences target.

    Fixes 7512

commit ed0a765
Author: Bob Arnson <bob@firegiant.com>
Date:   Wed May 31 16:04:27 2023 -0400

    Downgrade bad ProductVersion error to warning.

    Fixes wixtoolset/issues#7522.

commit bc9343a
Author: Rob Mensching <rob@firegiant.com>
Date:   Tue May 30 08:28:14 2023 -0700

    Obsolete removed PackageState.Cached value

    A package's cached status is no longer set via the PackageState. The value was
    removed in native code but the managed code was missed throwing off the enum
    mapping.

    Fixes 7399
  • Loading branch information
nirbar committed Nov 2, 2023
1 parent 2706043 commit ee3747f
Show file tree
Hide file tree
Showing 68 changed files with 1,830 additions and 760 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
build:
name: Build
runs-on: windows-2022
permissions:
packages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -29,6 +32,11 @@ jobs:
# shell: cmd
# run: ./src/vs_config.cmd

- name: Install sign tool
if: (github.ref == 'refs/heads/master')
shell: cmd
run: dotnet tool install --tool-path build\.tools sign --version 0.9.1-beta.23356.1

- name: Configure automated logging and crash dumps
shell: cmd
run: |
Expand All @@ -41,6 +49,15 @@ jobs:
reg add "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\Windows Error Reporting\LocalDumps" /t REG_DWORD /v DumpCount /d 10 /f
reg add "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\Windows Error Reporting\LocalDumps" /t REG_DWORD /v DumpType /d 1
- name: 'Az CLI login'
if: (github.ref == 'refs/heads/master')
uses: azure/login@v1
with:
allow-no-subscriptions: true
client-id: ${{ secrets.WIX_SIGNING_CLIENTID }}
tenant-id: ${{ secrets.WIX_SIGNING_TENANTID }}
subscription-id: ${{ secrets.WIX_SIGNING_SUBSCRIPTIONID }}

- name: Decrypt snk
run: gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.GPG_PASSPHRASE }}" --output "${{ github.workspace }}\src\psw-wix.snk" "${{ github.workspace }}\src\psw-wix.snk.gpg"

Expand All @@ -49,8 +66,8 @@ jobs:
run: ./src/build_official.cmd
env:
RuntimeTestsEnabled: true
SigningUser: ${{ github.ref == 'refs/heads/master' && secrets.WIX_SIGNING_USER || '' }}
SigningSecret: ${{ github.ref == 'refs/heads/master' && secrets.WIX_SIGNING_SECRET || '' }}
SigningVaultUri: ${{ github.ref == 'refs/heads/master' && secrets.WIX_SIGNING_VAULTURI || '' }}
SigningCertName: ${{ github.ref == 'refs/heads/master' && secrets.WIX_SIGNING_CERTNAME || '' }}
BuildRunNumber: ${{ github.run_number }}

- name: Resolve build version
Expand Down
42 changes: 17 additions & 25 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<Project>
<PropertyGroup>
<SigningToolFolder>$(ToolsFolder)</SigningToolFolder>
<SigningToolExe>$(SigningToolFolder)\SignClient.exe</SigningToolExe>
<SigningFilelist>$(SigningToolFolder)\empty-filelist.txt</SigningFilelist>
<SigningConfiguration>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), signing.json))\signing.json</SigningConfiguration>
<SigningToolExe>$(SigningToolFolder)\sign.exe</SigningToolExe>
<SigningFilelist>$(MSBuildThisFileDirectory)signing-empty-file-list.txt</SigningFilelist>
<SigningConfiguration>--description "WiX Toolset" --description-url "https://wixtoolset.org/" --timestamp-url "http://timestamp.digicert.com" --file-list "$(SigningFilelist)" --azure-key-vault-managed-identity true --azure-key-vault-url "$(SigningVaultUri)" --azure-key-vault-certificate "$(SigningCertName)"</SigningConfiguration>
</PropertyGroup>

<PropertyGroup Condition=" '$(IsWixTestSupportProject)'=='true' ">
Expand Down Expand Up @@ -129,47 +129,39 @@
</ItemGroup>
</Target>

<Target Name="_GetSignClient"
Condition=" !Exists('$(SigningToolExe)') ">

<WriteLinesToFile File='$(SigningFilelist)' Lines='do-not-sign-files-in-nupkg' Overwrite='true' />

<Exec Command='dotnet.exe tool install --tool-path "$(SigningToolFolder)" SignClient' IgnoreExitCode='true' />
</Target>

<Target Name="SignOutput" DependsOnTargets="_GetSignClient" AfterTargets="AfterBuild"
Condition=" '$(SigningUser)'!='' and '$(SignOutput)'!='false' and
<Target Name="SignOutput" AfterTargets="AfterBuild"
Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' and
('$(MSBuildProjectExtension)'=='.csproj' or ('$(MSBuildProjectExtension)'=='.vcxproj' and '$(ConfigurationType)'!='StaticLibrary'))">

<Message Importance="high" Text="Signing file: $(TargetPath) using configuration from: $(SigningConfiguration)" />
<Message Importance="high" Text="Signing file: $(TargetPath)" />

<Exec Command='"$(SigningToolExe)" sign -i $(TargetPath) -c "$(SigningConfiguration)" -n "WiX Toolset" -d "WiX Toolset" -u https://wixtoolset.org/ -r "$(SigningUser)" -s "$(SigningSecret)"'
<Exec Command='"$(SigningToolExe)" code azure-key-vault $(TargetPath) $(SigningConfiguration)'
WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" />
</Target>

<Target Name="SignNupkg" DependsOnTargets="_GetSignClient" AfterTargets="Pack;PackNative"
Condition=" '$(SigningUser)'!='' and '@(NuGetPackOutput)'!='' and '$(SignNupkg)'!='false' ">
<Target Name="SignNupkg" AfterTargets="Pack;PackNative"
Condition=" '$(SigningCertName)'!='' and '@(NuGetPackOutput)'!='' and '$(SignNupkg)'!='false' ">
<ItemGroup>
<SigningNupkgs Include="@(NuGetPackOutput)" Condition=" '%(Extension)'=='.nupkg' " />
</ItemGroup>

<Message Importance="high" Text="Signing nupkg: @(SigningNupkgs->&apos;%(Identity)&apos;) using configuration from: $(SigningConfiguration)" />
<Message Importance="high" Text="Signing nupkg: @(SigningNupkgs->&apos;%(Identity)&apos;)" />

<Exec Command='"$(SigningToolExe)" sign -i "@(SigningNupkgs->&apos;%(Identity)&apos;)" -c "$(SigningConfiguration)" -f "$(SigningFilelist)" -n "WiX Toolset" -d "WiX Toolset" -u https://wixtoolset.org/ -r "$(SigningUser)" -s "$(SigningSecret)"'
<Exec Command='"$(SigningToolExe)" code azure-key-vault "@(SigningNupkgs->&apos;%(Identity)&apos;)" $(SigningConfiguration)'
WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" />
</Target>

<Target Name="SignBundleEngine" DependsOnTargets="_GetSignClient" Condition=" '$(SigningUser)'!='' and '$(SignOutput)'!='false' ">
<Message Importance="high" Text="Signing bundle engine: @(SignBundleEngine->&apos;%(Identity)&apos;) using configuration from: $(SigningConfiguration)" />
<Target Name="SignBundleEngine" Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' ">
<Message Importance="high" Text="Signing bundle engine: @(SignBundleEngine->&apos;%(Identity)&apos;)" />

<Exec Command='"$(SigningToolExe)" sign -i "@(SignBundleEngine->&apos;%(Identity)&apos;)" -c "$(SigningConfiguration)" -f "$(SigningFilelist)" -n "WiX Toolset" -d "WiX Toolset" -u https://wixtoolset.org/ -r "$(SigningUser)" -s "$(SigningSecret)"'
<Exec Command='"$(SigningToolExe)" code azure-key-vault "@(SignBundleEngine->&apos;%(Identity)&apos;)" $(SigningConfiguration)'
WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" />
</Target>

<Target Name="SignBundle" DependsOnTargets="_GetSignClient" Condition=" '$(SigningUser)'!='' and '$(SignOutput)'!='false' ">
<Message Importance="high" Text="Signing bundle: @(SignBundle->&apos;%(Identity)&apos;) using configuration from: $(SigningConfiguration)" />
<Target Name="SignBundle" Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' ">
<Message Importance="high" Text="Signing bundle: @(SignBundle->&apos;%(Identity)&apos;)" />

<Exec Command='"$(SigningToolExe)" sign -i "@(SignBundle->&apos;%(Identity)&apos;)" -c "$(SigningConfiguration)" -f "$(SigningFilelist)" -n "WiX Toolset" -d "WiX Toolset" -u https://wixtoolset.org/ -r "$(SigningUser)" -s "$(SigningSecret)"'
<Exec Command='"$(SigningToolExe)" code azure-key-vault "@(SignBundle->&apos;%(Identity)&apos;)" $(SigningConfiguration)'
WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" />
</Target>

Expand Down
2 changes: 0 additions & 2 deletions src/api/wix/WixToolset.Data/Symbols/SymbolDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ public enum SymbolDefinitionType

public static partial class SymbolDefinitions
{
public static readonly Version Version = new Version("4.0.0");

public static IntermediateSymbolDefinition ByName(string name)
{
if (!Enum.TryParse(name, out SymbolDefinitionType type) || type == SymbolDefinitionType.MustBeFromAnExtension)
Expand Down
26 changes: 26 additions & 0 deletions src/api/wix/WixToolset.Extensibility/BaseOptimizerExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Extensibility
{
using WixToolset.Extensibility.Data;

/// <summary>
/// Base class for creating an optimizer extension.
/// </summary>
public abstract class BaseOptimizerExtension : IOptimizerExtension
{
/// <summary>
/// Called after all files have been compiled, before built-in optimizations, and before all sections are linked into a single section.
/// </summary>
public virtual void PreOptimize(IOptimizeContext context)
{
}

/// <summary>
/// Called after all files have been compiled, after built-in optimizations, and before all sections are linked into a single section.
/// </summary>
public virtual void PostOptimize(IOptimizeContext context)
{
}
}
}
5 changes: 5 additions & 0 deletions src/api/wix/WixToolset.Extensibility/Data/IBindContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public interface IBindContext
/// </summary>
string OutputPath { get; set; }

/// <summary>
/// Output type to bind to.
/// </summary>
string OutputType { get; set; }

/// <summary>
/// Type of PDB to create.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface ICompileContext
XDocument Source { get; set; }

/// <summary>
/// Cancellation token to abort cancellation.
/// Cancellation token.
/// </summary>
CancellationToken CancellationToken { get; set; }
}
Expand Down
61 changes: 61 additions & 0 deletions src/api/wix/WixToolset.Extensibility/Data/IOptimizeContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Extensibility.Data
{
using System;
using System.Collections.Generic;
using System.Threading;
using WixToolset.Data;

/// <summary>
/// Context provided to the optimizer.
/// </summary>
public interface IOptimizeContext
{
/// <summary>
/// Service provider made available to the optimizer and its extensions.
/// </summary>
IServiceProvider ServiceProvider { get; }

/// <summary>
/// Set of extensions provided to the optimizer.
/// </summary>
IReadOnlyCollection<IOptimizerExtension> Extensions { get; set; }

/// <summary>
/// Intermediate folder.
/// </summary>
string IntermediateFolder { get; set; }

/// <summary>
/// Collection of bindpaths used to bind files.
/// </summary>
IReadOnlyCollection<IBindPath> BindPaths { get; set; }

/// <summary>
/// Bind variables used during optimization.
/// </summary>
IDictionary<string, string> BindVariables { get; set; }

/// <summary>
/// Gets or sets the platform which the optimizer will use when defaulting 64-bit symbol properties.
/// </summary>
/// <value>The platform which the optimizer will use when defaulting 64-bit symbol properties.</value>
Platform Platform { get; set; }

/// <summary>
/// Collection of intermediates to optimize.
/// </summary>
IReadOnlyCollection<Intermediate> Intermediates { get; set; }

/// <summary>
/// Collection of localization files to use in the optimizer.
/// </summary>
IReadOnlyCollection<Localization> Localizations { get; set; }

/// <summary>
/// Cancellation token.
/// </summary>
CancellationToken CancellationToken { get; set; }
}
}
22 changes: 22 additions & 0 deletions src/api/wix/WixToolset.Extensibility/IOptimizerExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Extensibility
{
using WixToolset.Extensibility.Data;

/// <summary>
/// Interface that all optimizer extensions implement.
/// </summary>
public interface IOptimizerExtension
{
/// <summary>
/// Called after all files have been compiled, before built-in optimizations, and before all sections are linked into a single section.
/// </summary>
void PreOptimize(IOptimizeContext context);

/// <summary>
/// Called after all files have been compiled, after built-in optimizations, and before all sections are linked into a single section.
/// </summary>
void PostOptimize(IOptimizeContext context);
}
}
2 changes: 0 additions & 2 deletions src/ext/ComPlus/wixext/Symbols/ComPlusSymbolDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public enum ComPlusSymbolDefinitionType

public static partial class ComPlusSymbolDefinitions
{
public static readonly Version Version = new Version("4.0.0");

public static IntermediateSymbolDefinition ByName(string name)
{
if (!Enum.TryParse(name, out ComPlusSymbolDefinitionType type))
Expand Down
2 changes: 0 additions & 2 deletions src/ext/DifxApp/wixext/Symbols/DifxAppSymbolDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ public enum DifxAppSymbolDefinitionType

public static partial class DifxAppSymbolDefinitions
{
public static readonly Version Version = new Version("4.0.0");

public static IntermediateSymbolDefinition ByName(string name)
{
if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type))
Expand Down
Loading

0 comments on commit ee3747f

Please sign in to comment.