Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions assets/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- Properties About The Package -->
<Package Id="*" Keywords="Installer" Platform="$(sys.BUILDARCH)" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Description="PowerShell package" Comments="PowerShell for every system" />
<!-- Add PowerShell icon for executable -->
<Icon Id="PowerShellExe.ico" SourceFile="assets\Powershell_black.ico" />
<Icon Id="PowerShellExe.ico" SourceFile="$(env.IconPath)" />
<!-- Add PowerShell icon in Add/Remove Programs -->
<Property Id="ARPPRODUCTICON" Value="PowerShellExe.ico" />
<!-- Set properties for add/remove programs -->
Expand Down Expand Up @@ -174,44 +174,44 @@
<!-- When clicking on background in Explorer -->
<RegistryKey Root="HKCR" Key="Directory\Background\shell\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)">
<RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]$(env.IconPath)"/>
<RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)"/>
</RegistryKey>
<!-- When clicking on Drive in Explorer -->
<RegistryKey Root="HKCR" Key="Drive\shell\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)">
<RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]$(env.IconPath)"/>
<RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)"/>
</RegistryKey>
<!-- When clicking on Desktop background in Explorer -->
<RegistryKey Root="HKCR" Key="DesktopBackground\shell\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)">
<RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]$(env.IconPath)"/>
<RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)"/>
</RegistryKey>
<!-- When clicking on folder in Explorer -->
<RegistryKey Root="HKCR" Key="Directory\shell\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)">
<RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]$(env.IconPath)"/>
<RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)"/>
</RegistryKey>
<!-- When being in a Library folder in Explorer -->
<RegistryKey Root="HKCR" Key="LibraryFolder\background\shell\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)">
<RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]$(env.IconPath)"/>
<RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)"/>
</RegistryKey>
<!-- Sub menus to open PowerShell at the current location either as a normal shell or as Administrator -->
<RegistryKey Root="HKCR" Key="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)\shell\open">
<RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextSubMenuDialogText)"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]$(env.IconPath)"/>
</RegistryKey>
<RegistryKey Root="HKCR" Key="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)\shell\open\command">
<RegistryValue Type="string" Value="[$(var.ProductDirectoryName)]pwsh.exe -NoExit -WorkingDirectory &quot;%V&quot; "/>
</RegistryKey>
<RegistryKey Root="HKCR" Key="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)\shell\runas">
<RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextSubMenuElevatedDialogText)"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/>
<RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]$(env.IconPath)"/>
<RegistryValue Type="string" Value="" Name="HasLUAShield"/>
</RegistryKey>
<RegistryKey Root="HKCR" Key="Directory\ContextMenus\$(var.ProductName)$(var.SimpleProductVersion)$(sys.BUILDARCH)\shell\runas\command">
Expand Down
26 changes: 25 additions & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/install-powershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't this one of the same icons set during the build?

Copy link
Contributor Author

@bergmeister bergmeister Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the daily build only (which I still want to disambiguate from preview as I have RTM, preview and daily versions pinned to my taskbar), see my summary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, makes sense.

}

## Change the mode of 'pwsh' to 'rwxr-xr-x' to allow execution
Expand Down
20 changes: 2 additions & 18 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down Expand Up @@ -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"
Expand Down