From 0ef0b3296bbda10947b59602164788b7057561ad Mon Sep 17 00:00:00 2001 From: William Li Date: Tue, 10 Jul 2018 16:24:50 -0700 Subject: [PATCH] Add XSLT Transform for apphost (#9609) To avoid sign check whitelist apphost.exe name changes very build. Sign check uses File Id in MSI as whitelist name. Template apphost.exe get a new "File Id" in msi different every time (since File Id is generated according to file path, and file path has version number). Use XSLT tranform to match the file path contains "AppHostTemplate\apphost.exe" and give it the same ID all the time. --- build/package/Installer.MSI.targets | 5 +++- .../StableFileIdForApphostTransform.xslt | 26 +++++++++++++++++++ packaging/windows/clisdk/generatemsi.ps1 | 17 ++++++++++-- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 packaging/windows/clisdk/StableFileIdForApphostTransform.xslt diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index 649947574..3c8f0f2f8 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -14,6 +14,7 @@ $(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)-engine.exe $(RepoRoot)/packaging/windows/clisdk/generatemsi.ps1 + $(RepoRoot)/packaging/windows/clisdk/stablefileidforapphosttransform.xslt $(RepoRoot)/packaging/windows/clisdk/generatebundle.ps1 $(RepoRoot)/packaging/windows/clisdk/generatenupkg.ps1 @@ -110,7 +111,9 @@ '$(SimpleVersion)' '$(NugetVersion)' '$(SdkInstallerUpgradeCode)' - '$(Architecture)'" /> + '$(Architecture)' + '$(SdkStableFileIdForApphostTransform)' + " /> + + + + + + + + + + + + + + + + apphosttemplateapphostexe + + + + diff --git a/packaging/windows/clisdk/generatemsi.ps1 b/packaging/windows/clisdk/generatemsi.ps1 index fc9da871d..69c17d078 100644 --- a/packaging/windows/clisdk/generatemsi.ps1 +++ b/packaging/windows/clisdk/generatemsi.ps1 @@ -10,7 +10,8 @@ param( [Parameter(Mandatory=$true)][string]$DotnetCLIDisplayVersion, [Parameter(Mandatory=$true)][string]$DotnetCLINugetVersion, [Parameter(Mandatory=$true)][string]$UpgradeCode, - [Parameter(Mandatory=$true)][string]$Architecture + [Parameter(Mandatory=$true)][string]$Architecture, + [Parameter(Mandatory=$true)][string]$StableFileIdForApphostTransform ) . "$PSScriptRoot\..\..\..\scripts\common\_common.ps1" @@ -26,7 +27,19 @@ function RunHeat Write-Output Running heat.. - .\heat.exe dir `"$inputDir`" -template fragment -sreg -gg -var var.DotnetSrc -cg InstallFiles -srd -dr DOTNETHOME -out $InstallFileswsx | Out-Host + # -t $StableFileIdForApphostTransform to avoid sign check baseline apphost.exe name changes every build. Sign check uses File Id in MSI as whitelist name. + # Template apphost.exe get a new "File Id" in msi different every time (since File Id is generated according to file + # path, and file path has version number) + # use XSLT tranform to match the file path contains "AppHostTemplate\apphost.exe" and give it the same ID all the time. + + .\heat.exe dir `"$inputDir`" -template fragment ` + -sreg -gg ` + -var var.DotnetSrc ` + -cg InstallFiles ` + -srd ` + -dr DOTNETHOME ` + -t $StableFileIdForApphostTransform ` + -out $InstallFileswsx | Out-Host if($LastExitCode -ne 0) {