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)
{