From 71e588d223c393cc5d2c918bdef91edef236bf9c Mon Sep 17 00:00:00 2001 From: bergmeister Date: Wed, 22 Nov 2017 10:14:32 +0000 Subject: [PATCH] Disambiguate icon for daily builds on Windows (#5467) * Disambiguate icon for daily builds on Windows. Some code had to be borrowed from build.psm1 because this script has to be self contained in case it gets executed by only downloading this file via the published download link https://twitter.com/Steve_MSFT/status/930585082451992576 --- tools/install-powershell.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index d614d512d6..fac01dc1c4 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -156,6 +156,19 @@ try { Move-Item -Path $contentPath -Destination $Destination } + # Edit icon to disambiguate daily builds. + if ($IsWinEnv -and $Daily.IsPresent) { + if (-not (Test-Path "~/.rcedit/rcedit-x64.exe")) { + Write-Verbose "Install RCEdit for modifying exe resources" -Verbose + $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 + } + + Write-Verbose "Change icon to disambiguate it from a released installation" -Verbose + & "~/.rcedit/rcedit-x64.exe" "$Destination\pwsh.exe" --set-icon "$Destination\assets\Powershell_av_colors.ico" + } + ## Change the mode of 'pwsh' to 'rwxr-xr-x' to allow execution if (-not $IsWinEnv) { chmod 755 $Destination/pwsh }