diff --git a/assets/Product.wxs b/assets/Product.wxs index 8ff6bb88eb4..9159050e8f5 100644 --- a/assets/Product.wxs +++ b/assets/Product.wxs @@ -35,7 +35,7 @@ - + @@ -174,44 +174,44 @@ - + - + - + - + - + - + - + diff --git a/build.psm1 b/build.psm1 index 71104452146..412e541208d 100644 --- a/build.psm1 +++ b/build.psm1 @@ -379,6 +379,24 @@ function Start-BuildNativeUnixBinaries { } } +<# + .Synopsis + Tests if a version is preview + .EXAMPLE + Test-IsPreview -version '6.1.0-sometthing' # returns true + Test-IsPreview -version '6.1.0' # returns false +#> +function Test-IsPreview +{ + param( + [parameter(Mandatory)] + [string] + $Version + ) + + return $Version -like '*-*' +} + function Start-PSBuild { [CmdletBinding()] param( @@ -612,7 +630,13 @@ Fix steps: $pwshPath = Join-Path $Options.Output "pwsh.exe" } - Start-NativeExecution { & "~/.rcedit/rcedit-x64.exe" $pwshPath --set-icon "$PSScriptRoot\assets\Powershell_black.ico" ` + if (Test-IsPreview $ReleaseVersion) { + $iconPath = "$PSScriptRoot\assets\Powershell_av_colors.ico" + } else { + $iconPath = "$PSScriptRoot\assets\Powershell_black.ico" + } + + Start-NativeExecution { & "~/.rcedit/rcedit-x64.exe" $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 diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index ecb274a21ec..5c83e9a1a28 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -174,7 +174,7 @@ try { } 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" + & "~/.rcedit/rcedit-x64.exe" "$Destination\pwsh.exe" --set-icon "$Destination\assets\Powershell_avatar.ico" } ## Change the mode of 'pwsh' to 'rwxr-xr-x' to allow execution diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 867ff105bac..b50ed787c94 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -2279,24 +2279,6 @@ function New-MSIPatch Remove-Item -Path $filesToCleanup -Force -Recurse -ErrorAction SilentlyContinue } -<# - .Synopsis - Tests if a version is preview - .EXAMPLE - Test-IsPreview -version '6.1.0-sometthing' # returns true - Test-IsPreview -version '6.1.0' # returns false -#> -function Test-IsPreview -{ - param( - [parameter(Mandatory)] - [string] - $Version - ) - - return $Version -like '*-*' -} - <# .Synopsis Creates a Windows installer MSI package and assumes that the binaries are already built using 'Start-PSBuild'. @@ -2402,12 +2384,14 @@ function New-MSIPackage [Environment]::SetEnvironmentVariable("AddPathDefault", '1', "Process") [Environment]::SetEnvironmentVariable("UpgradeCodeX64", '31ab5147-9a97-4452-8443-d9709f0516e1', "Process") [Environment]::SetEnvironmentVariable("UpgradeCodeX86", '1d00683b-0f84-4db8-a64f-2f98ad42fe06', "Process") + [Environment]::SetEnvironmentVariable("IconPath", 'assets\Powershell_black.ico', "Process") } else { [Environment]::SetEnvironmentVariable("AddPathDefault", '0', "Process") [Environment]::SetEnvironmentVariable("UpgradeCodeX64", '39243d76-adaf-42b1-94fb-16ecf83237c8', "Process") [Environment]::SetEnvironmentVariable("UpgradeCodeX86", '86abcfbd-1ccc-4a88-b8b2-0facfde29094', "Process") + [Environment]::SetEnvironmentVariable("IconPath", 'assets\Powershell_av_colors.ico', "Process") } $fileArchitecture = 'amd64' $ProductProgFilesDir = "ProgramFiles64Folder"