From 820286e117f57fe7fb418f99da137f88ec4aedc6 Mon Sep 17 00:00:00 2001 From: kwkam Date: Wed, 15 Aug 2018 01:17:29 +0800 Subject: [PATCH] Build: Also search PATH for rcedit (#7503) --- build.psm1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index ea6643f55d..5c20802de9 100644 --- a/build.psm1 +++ b/build.psm1 @@ -602,7 +602,11 @@ Fix steps: if ($Environment.IsWindows) { ## need RCEdit to modify the binaries embedded resources - if (-not (Test-Path "~/.rcedit/rcedit-x64.exe")) { + $rcedit = "~/.rcedit/rcedit-x64.exe" + if (-not (Test-Path -Type Leaf $rcedit)) { + $rcedit = Get-Command "rcedit-x64.exe" -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1 | % Name + } + if (-not $rcedit) { throw "RCEdit is required to modify pwsh.exe resources, please run 'Start-PSBootStrap' to install" } @@ -632,7 +636,7 @@ Fix steps: $iconPath = "$PSScriptRoot\assets\Powershell_black.ico" } - Start-NativeExecution { & "~/.rcedit/rcedit-x64.exe" $pwshPath --set-icon $iconPath ` + Start-NativeExecution { & $rcedit $pwshPath --set-icon $iconPath ` --set-file-version $fileVersion --set-product-version $ReleaseVersion --set-version-string "ProductName" "PowerShell Core 6" ` --set-version-string "LegalCopyright" "(C) Microsoft Corporation. All Rights Reserved." ` --application-manifest "$PSScriptRoot\assets\pwsh.manifest" } | Write-Verbose