diff --git a/build.psm1 b/build.psm1 index 43124942bb..435fe63bbb 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1442,6 +1442,15 @@ function Start-PSBootstrap { # Install Windows dependencies if `-Package` or `-BuildWindowsNative` is specified if ($Environment.IsWindows) { + ## need RCEdit to modify the binaries embedded resources + if (-not (Test-Path "~/.rcedit/rcedit-x64.exe")) + { + log "Install RCEdit for modifying exe resources" + $rceditUrl = "https://github.com/electron/rcedit/releases/download/v1.0.0/rcedit-x64.exe" + New-Item -Path "~/.rcedit" -Type Directory -Force > $null + Invoke-WebRequest -OutFile "~/.rcedit/rcedit-x64.exe" -Uri $rceditUrl + } + if ($BuildWindowsNative) { log "Install Windows dependencies for building PSRP plugin" @@ -1862,6 +1871,16 @@ function New-MSIPackage [Switch] $Force ) + ## need RCEdit to modify the binaries embedded resources + if (-not (Test-Path "~/.rcedit/rcedit-x64.exe")) + { + throw "RCEdit is required to modify pwsh.exe resources, please run 'Start-PSBootStrap' to install" + } + + Start-NativeExecution { & "~/.rcedit/rcedit-x64.exe" (Get-PSOutput) --set-icon "$AssetsPath\Powershell_black.ico" ` + --set-file-version $ProductVersion --set-product-version $ProductVersion --set-version-string "ProductName" "PowerShell Core 6" ` + --set-version-string "LegalCopyright" "(C) Microsoft Corporation. All Rights Reserved." } | Write-Verbose + ## AppVeyor base image might update the version for Wix. Hence, we should ## not hard code version numbers. $wixToolsetBinPath = "${env:ProgramFiles(x86)}\WiX Toolset *\bin"