diff --git a/assets/Powershell_256.ico b/assets/Powershell_256.ico new file mode 100644 index 000000000..dfecd8de8 Binary files /dev/null and b/assets/Powershell_256.ico differ diff --git a/assets/Product.wxs b/assets/Product.wxs index 1a0b0e44e..ea1b7f3a7 100644 --- a/assets/Product.wxs +++ b/assets/Product.wxs @@ -14,9 +14,15 @@ - + - + + + + + + + @@ -25,7 +31,7 @@ - + @@ -37,7 +43,7 @@ - + @@ -48,7 +54,7 @@ - + @@ -59,11 +65,12 @@ - + WorkingDirectory="$(var.ProductVersionWithName)" + Icon = "PowerShellExe.ico" /> diff --git a/build.psm1 b/build.psm1 index b61915a2f..e6b414955 100644 --- a/build.psm1 +++ b/build.psm1 @@ -504,7 +504,7 @@ Built upon .NET Core, it is also a C# REPL. Write-Verbose "Packaging $Source" if ($IsWindows) { - $msiPackagePath = New-MSIPackage -ProductSourcePath $Source -ProductVersion $Version -Verbose + $msiPackagePath = New-MSIPackage -ProductSourcePath $Source -ProductVersion $Version -AssetsPath "$PSScriptRoot\Assets" -Verbose $appxPackagePath = New-AppxPackage -PackageVersion $Version -SourcePath $Source -AssetsPath "$PSScriptRoot\Assets" -Verbose $packages = @($msiPackagePath, $appxPackagePath) @@ -1348,7 +1348,7 @@ function New-MSIPackage # Name of the Product [ValidateNotNullOrEmpty()] - [string] $ProductName = 'OpenPowerShell', + [string] $ProductName = 'PowerShell', # Version of the Product [Parameter(Mandatory = $true)] @@ -1366,7 +1366,12 @@ function New-MSIPackage # File describing the MSI Package creation semantics [ValidateNotNullOrEmpty()] - [string] $ProductWxsPath = (Join-Path $pwd '\assets\Product.wxs') + [string] $ProductWxsPath = (Join-Path $pwd '\assets\Product.wxs'), + + # Path to Assets folder containing artifacts such as icons, images + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string] $AssetsPath ) @@ -1382,9 +1387,21 @@ function New-MSIPackage $wixHeatExePath = Join-Path $wixToolsetBinPath "Heat.exe" $wixCandleExePath = Join-Path $wixToolsetBinPath "Candle.exe" $wixLightExePath = Join-Path $wixToolsetBinPath "Light.exe" + + Write-Verbose "Extract the version in the form of a.b.c.d for $ProductVersion" + $ProductVersionTokens = $ProductVersion.Split('-') + $ProductVersion = ([regex]::matches($ProductVersion, "\d+(\.\d+)+"))[0].value + + # Need to add the last version field for makeappx + $ProductVersion = $ProductVersion + '.' + $ProductVersionTokens[1] - # Wix tooling does not like hyphen in the foldername - $ProductVersion = $ProductVersion.Replace('-', '_') + $assetsInSourcePath = "$ProductSourcePath" + '\assets' + New-Item $assetsInSourcePath -type directory -Force | Write-Verbose + + $assetsInSourcePath = Join-Path $ProductSourcePath 'assets' + + Write-Verbose "Place dependencies such as icons to $assetsInSourcePath" + Copy-Item "$AssetsPath\*.ico" $assetsInSourcePath -Force $productVersionWithName = $ProductName + "_" + $ProductVersion Write-Verbose "Create MSI for Product $productVersionWithName" @@ -1420,7 +1437,7 @@ function New-AppxPackage # Name of the Package [ValidateNotNullOrEmpty()] - [string] $PackageName = 'OpenPowerShell', + [string] $PackageName = 'PowerShell', # Version of the Package [Parameter(Mandatory = $true)] @@ -1471,9 +1488,9 @@ function New-AppxPackage $appxManifest = @" - + - OpenPowerShell + PowerShell Microsoft Corporation #LOGO# @@ -1488,8 +1505,8 @@ function New-AppxPackage - - + +