Skip to content

Conversation

@DHowett
Copy link
Member

@DHowett DHowett commented Oct 24, 2025

This pull request removes the separate build step for producing the user installer and merges the generation of both installers.

Considering that the installers share almost all of the same components and that it takes ~45 minutes to build just one installer (most of the time is spent doing code signing), it seemed ripe for optimization.

The installer build now runs in three chunks:

  • Build all the shared support DLLs, which have never differed between user/machine
  • Build the two MSIs
  • Build the two bootstrappers out of those MSIs

After each step, all newly-generated content is batch signed. This cuts the number of slow code signing calls by half.

In doing this, I took the opportunity to add another code signing validation step to ensure that the bootstrapper contents are signed. We missed that, and now we will not miss it. That will hopefully prevent us from shipping another bootstrapper with an unsigned BA handler and catch if the build regresses and starts to overwrite already-signed DLLs.

I had to change the component generator to remove its special handling of the user/machine switch. Did you know that all it did was replace HKLM with HKCU in every component? We already had a WiX variable for that. The script was doing tons of unnecessary work and making it look like the components differed between the two, when they in truth do not.

I have not yet tried tackling the wxs code generator, which is frankly terrible. It generates new wxs files in a random build (the support DLLs) and then occasionally deletes them and restores them (after the MSI build). This is untenable, but we will survive.

@DHowett DHowett requested a review from a team as a code owner October 24, 2025 15:58

- ${{ if eq(parameters.codeSign, true) }}:
- template: steps-esrp-signing.yml
- template: steps-esrp-sign-files-authenticode.yml

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[authenticode](#security-tab) is not a recognized word. \(unrecognized-spelling\)
wix msi decompile $(InstallerUserRoot)\$(InstallerUserBasename).msi -x $(build.sourcesdirectory)\extractedUserMsi
dir $(build.sourcesdirectory)\extractedMachineMsi
dir $(build.sourcesdirectory)\extractedUserMsi
displayName: "WiX5: Extract and verify MSIs"

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[MSIs](#security-tab) is not a recognized word. \(unrecognized-spelling\)
git clean -xfd ./extractedMachineMsi ./extractedUserMsi
displayName: Verify all binaries are signed and versioned
- template: steps-esrp-sign-files-authenticode.yml

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[authenticode](#security-tab) is not a recognized word. \(unrecognized-spelling\)
- template: steps-esrp-sign-files-authenticode.yml
parameters:
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign VNext MSI
displayName: Sign VNext MSIs

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[MSIs](#security-tab) is not a recognized word. \(unrecognized-spelling\)
displayName: "WiX5: Extract Engines from Bundles"
- template: steps-esrp-signing.yml
- template: steps-esrp-sign-files-authenticode.yml

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[authenticode](#security-tab) is not a recognized word. \(unrecognized-spelling\)
& git clean -fdx installer\ba
displayName: "WiX5: Verify Bootstrapper content is signed"
- template: steps-esrp-sign-files-authenticode.yml

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[authenticode](#security-tab) is not a recognized word. \(unrecognized-spelling\)
- template: steps-esrp-sign-files-authenticode.yml
parameters:
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign Final Bootstrapper
displayName: Sign Final Bootstrappers

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[Bootstrappers](#security-tab) is not a recognized word. \(unrecognized-spelling\)
@@ -0,0 +1,45 @@
parameters:

Check failure

Code scanning / check-spelling

Check File Path

[authenticode](#security-tab) is not a recognized word. \(check-file-path\)
@@ -0,0 +1,45 @@
parameters:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a simple wrapper around ESRP signing for the kind of signing we do most often. It just makes the code shorter to not have the inline sign params 300 times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants