Commit graph

72 commits

Author SHA1 Message Date
Steve Lee 92cb949cac Use PSReadLine 2.0.0-beta2 from PSGallery (#6998)
Removed building PSReadLine from the repository. Instead, change to downloading from PSGallery.
2018-06-06 09:42:19 -07:00
Steve Lee 5dc7a6cb07 Add Windows Compatibility Pack 2.0.0 to PS Core and adopt the official .NET Core 2.1 (#6958)
To support PowerShell modules built with .NET Windows Compatibility Pack, we decided that it was best to ship the WCP assemblies with PS Core. This also adds many new .NET APIs be default while only adding ~3.5 MB additional disk footprint (to a ~137 MB install currently).
Also update the build to adopt the official .NET Core 2.1.
2018-06-03 22:06:26 -07:00
Steve Lee ed282ce0ef Update PowerShell to build against netcoreapp.2.1-rc1 (#6873) 2018-05-16 23:18:53 -07:00
Ilya 84344cbb32 Update PowerShell to build with .NET Core SDK 2.1.300-rc1-008662 (#6718)
* Build Update
- Change `TargetFramework` to `netcoreapp2.1` and removed unnecessary `RuntimeFrameworkVersion` from `PowerShell.Common.props`
- Update dotnet SDK to 2.1.300-rc1-008662
- Update `TypeGen` target in `Build.psm1` to work with 2.1
- Rename macOS runtime to `osx-x64` as the old build logic expects 10.12 and breaks running on 10.13 system.
- Remove `PackageReference` to `System.Memory` as it's part of dotnetcore 2.1
- Update search for `crossgen` executable to find the matching version

* Test Update
- Update test tools `WebListener` to latest `asp.net core`
- Marked `AuthHeader Redirect` tests as `Pending` due to change in CoreFX
2018-05-02 16:58:39 -07:00
Christoph Bergmeister 16e1823e33 Packaging: Add registry keys to support library folder background for explorer context menu (#6784)
Fixes #6590 by adding registry keys to support the existing explorer context menu also when being inside a library folder. It follows the existing pattern that was already applied to special cases such as drives, Desktop, etc.
Manually Tested on Win 10 1709
Thanks to @mklement0 for triaging the issue and already researching the required registry key (he should also be included in the release notes)
2018-05-02 14:43:25 -07:00
Ilya ffa7e4bac0 Enhance and refactor Add-Type cmdlet (#6141)
- Can compile a source from strings (TypeDefinition and MemberDefinition).
- Can compile from files.
- Can compile only to a file (without loading the produced assembly).
- Do not recompile and don't reload if the sources have not changed.
- Implement `-IgnoreWarnings` to not treat warnings as errors. By default, the cmdlet considers warnings as errors.
- Add VisualBasic support.
- Add new `-CompilerOptions` parameter to allow setting Roslyn command line parameters including:
    - Parser options.
    - Compile options.
    - Emit options.

**ATTENTION:** The `CompilerOptions` can be specified along with other options like `-OutputAssembly`, `-Language` and `-IgnoreWarnings`. The explicit setting parameters will take precedence over the same settings specified in `-CompileOptions`.

See docs about the compiler options:
https://github.com/dotnet/roslyn/blob/master/docs/compilers/CSharp/CommandLine.md
https://github.com/dotnet/roslyn/blob/master/docs/compilers/Visual%20Basic/CommandLine.md

**ATTENTION:** `-OutputType` default is `Library`. If `-OutputType` is absent the `-OutputType` default overlaps a value in `CompileOptions`. In other words output type ("target" ot "t" in command line) is always ignored in `CompileOptions`. We have to use `-OutputType` to set an output type.
2018-04-25 22:40:26 -07:00
Christoph Bergmeister fa3305534f Use '-WorkingDirectory' parameter to handle context menu when path contains single quotes. (#6660)
Use new '-WorkingDirectory' parameter on pwsh.exe to be able to use context menu when path contains single quotes.
2018-04-24 17:03:14 -07:00
Steve Lee f760fde0b7 Remove support for file to opt-out of telemetry, only support env var (#6601)
Since a PR added support to opt out of telemetry via an environment variable, we can remove the,
always intended to be a temporary, solution of deleting a file to opt out of telemetry since the
environment variable can be defined at the system level and exist before even installing PowerShell Core.

Because the variable is defined as opt out, a value of true, yes, or 1 means no telemetry is sent.
2018-04-13 10:29:39 -07:00
Steve Lee 5d3456d11b Fix formatting of tables where headers span multiple rows (#6504)
* In cases where the header spans multiple rows, need to correctly calculate whitespace and trim appropriately

* Use System.Span<int> and C# 7.2 language in SMA

* Added new ref assemblies to Files.wxs
refactor tests to remove similar xml content
added single column test case
2018-04-03 07:24:23 +04:00
Travis Plunk 77f36498e6
Simplify the paths the MSI uses (#6442)
- Implementation of PowerShell/PowerShell-RFC#115 (If anything changes in the RFC, we will treat it as a bug, and fix it later)
- Update registry and directory paths to use 6 for the version for stable and 6-preview for a preview release
- Add checkbox to set path
- default checkbox to off for preview builds and on for stable builds
2018-04-02 10:47:29 -07:00
Steve Lee c18b9999d6 Enable [Environment]::OSVersion to return current OS rather than compatible version (#6457)
* add application manifest dictating compatibility so that osversion shows appropriate os version on Windows
2018-03-28 13:36:16 -07:00
Travis Plunk 701b919345
MSI: add function to generate a MSP (#6445)
add a function to generate an MSP
2018-03-26 14:39:48 -07:00
Ilya 1b745f6a98 Add Test-Json cmdlet (NJsonSchema) (#5229)
Resolve #4220.

The cmdlet is based on NJsonSchema.
It allows to check:

JSON by only parsing
JSON against Schema
implicitly check Schema by parsing (based on previous line check)
NJsonSchema is under MIT (approved see https://github.com/PowerShell/PowerShell/pull/5229#issuecomment-342983215)
2018-03-26 11:52:48 -07:00
Travis Plunk 1730d8c496
MSI: update path with proper value (#6441)
MSI: update path with proper value
- Add verification that path is updated
2018-03-21 12:23:24 -07:00
Travis Plunk f7c2b7def1
MSI: remove the version from the product name (#6415)
MSI: remove the version from the product name

During patching the original MSI information is displayed.
This makes installing a patch for an MSI with a specific version very confusing.
2018-03-20 10:49:01 -07:00
Travis Plunk a099786cdc
Update to DotNet 2.0.6 (#6403)
Update to DotNet 2.0.6
  - this addresses [Microsoft Security Advisory CVE-2018-0875: Hash Collision can cause Denial of Service](https://github.com/PowerShell/Announcements/issues/4)
  - This is a port of d607f207b9 to 6.1
2018-03-15 14:54:00 -07:00
Travis Plunk 8ba6f319f3
MSI: update architecture specific filenames (#6379) 2018-03-13 14:02:12 -07:00
Travis Plunk da905f891b
MSI: Make sure that file components are patchable (#6303)
MSI: Make sure that file components are patchable
- avoid changing names and guids of components between builds as this prevents patch generation
- This required submitting the file generated by heat
- add code to make sure the generated file is not out of date
2018-03-06 10:13:26 -08:00
Travis Plunk 0e276c4e63
Make sure explorer context menu can be patched (#6302)
Make sure explorer context menu can be patched
- set keypath for explorer log context menu
2018-03-05 10:28:56 -08:00
Travis Plunk 7c7ec241a0
MSI: Cause preview builds to install Side by side with release builds (#6301)
MSI: Cause preview builds to install Side by side with release builds
- change the upgrade code if there is a preview part of the version
2018-03-05 10:27:47 -08:00
Travis Plunk 49ec403899
fix MSI creation errors, and capture wixpdb for later patch creation (#6221)
- add `wixpdb` output when creating `MSI` package
- capture `wixpdb` in official build
- clean up anything left behind from previous MSI builds before starting MSI build to prevent using dirty files.
- make sure MSI creation fails if there is an error
- ignore `.wixpdb` files in git
- Add functionality to `Start-NativeExecution` to 
    - only display output if there is an error 
    - log caller information
- WXS validation error fixes
    - Remove unused `ExitDialog` to fix ICE82
    - Add KeyPath to `SetPath` to fix ICE18
    - Use `HKMU` which translates to `HKLM` to runtime to fix various validation errors about creating the shortcut
- Suppress Validation errors
    - suppress ICE61, which is about same version upgrades being allowed
    - suppress ICE57, caused by the shortcut not being installed per user
2018-02-26 15:45:15 -08:00
Christoph Bergmeister 96bd86e5e3 fix various places that still refer to old versions of pwsh (#6179) 2018-02-23 09:54:58 -08:00
Christoph Bergmeister fddfb54669 Add options to enable PSRemoting and register Windows Event Logging Manifest to MSI installer (#5999) 2018-02-22 18:07:10 +04:00
Travis Plunk f906e9ddba
Revert PR 6043 - Adds script to patch the shortcut working directory to the user's home folder (#6203)
Revert PR 6043 - Remove failing script from MSI

reverted from commit 795c611
2018-02-21 10:29:29 -08:00
Travis Plunk ca959a735a
change the registry version detection value to semver from the default value (#6192)
change the registry version detection value to semanticversion from the default value
fixes #6171
2018-02-21 10:28:12 -08:00
Travis Plunk fa40a87bd7
Add registry value for easy detection (#6094)
Add registry value for easy detection. For example, the presence of a single key of 6.0.* x64. This is much faster than MSI detection.

Note there are currently two GUIDs, one for 6.0.* x64 and one for 6.0.* x86.

fixes #6090
2018-02-05 10:02:58 -08:00
Steve Lee 6ceaf92bf9 change logo to SVG (#6072)
Current README uses a PNG which doesn't scale for high dpi displays (starts to look fuzzy).
Created 64 pixel wide version of svg of the black logo and inserted into README.md.
Note that it currently doesn't render as the absolute URL points to master so that it gets
rendered correctly in other places where the README.md is used (like docker hub).
2018-02-02 18:35:59 -08:00
Chris Duck 795c61125a Adds script to patch the shortcut working directory to the user's home folder. (#6043)
Update the shortcut created by the installer to use %HOMEDRIVE%%HOMEPATH% for the working directory.
2018-01-31 08:11:29 +04:00
Benjamin Staneck 51dbfae0ff Rework Windows Start menu folder name (#5891)
Changes the Windows start menu folder name from ProductSemanticVersionWithName to ProductSemanticVersionWithNameAndOptionalArchitecture - now the start menu is `PowerShell` for all versions.
2018-01-26 08:14:55 +04:00
Christoph Bergmeister d3a775da9a Packaging: simplify building an installable package for Windows (#5871)
This is the continuation of PR 5499 that had to be abandoned due to a fatal merge conflict and I did not want to risk accidentally reverting recent fixes.

    Remove unnecessary/unused default for productGuid because it always gets a new Guid when being called from Start-PSPackage
    Add defaults for required files but also add extra path validation attribute
    Rename ProductGuid to ProductCode
2018-01-17 15:34:03 -08:00
Christoph Bergmeister a07cc49809 Use HKLM instead of HKCU registry keys since the current installation scope is perMachine. (#5915) 2018-01-17 07:09:12 +04:00
Christoph Bergmeister bb09b88390 Fix start menu folder clash of shortcut when x86 and x64 are both installed by appending " (x86)" for x86 to the . (#5826) 2018-01-10 18:18:44 -08:00
Christoph Bergmeister 378e8d5678 Make Explorer context menu registry entries platform specific to allow side by side of x86 and x64. The main menu has a " (x86)" appended to the main menu. (#5824)
Make explorer context menu registry entries platform specific to allow them to work also when both x86 and x64 are installed. The main menu has a " (x86)" appended to the main menu as well.
2018-01-10 08:17:06 +04:00
Christoph Bergmeister d2863fc50d Reduce image file sizes using lossless compression with imgbot (#5808) 2018-01-09 14:51:57 -08:00
Christoph Bergmeister f8a5fc1f19 packaging: x86 package gets installed as an x64 component and has the same UpgradeCode as the x64 installer leading to an uninstallation of an x64 installation (and vice versa) (#5812)
Fix bug #5597: x86/x64 installer are uninstalling each other when installing either of them:

-Make x86 installer to be installed as an x86 component (-arch argument to candle.exe, which sets the `sys.BUILDARCH` variable)
-Make the UpgradeCode unique per platform
-Replace `var.ProductTargetArchitecture` variable with sys.BUILDARCH use to have only 1 variable for the architecture
-Additionally, the architecture was appended to the package name to be able to distinguish the installations.
2018-01-08 12:32:38 -08:00
Chris e351a7e5c2 Move checkbox to the top to allow toggling it using the space bar (the Enter key already defaults to the Finish) button. (#5792)
Move definition of Launch PowerShell checkbox to the top to allow toggling it using the spacebar (the Enter key already defaults to the Finish button).
Reuse product name variable.
2018-01-06 11:53:45 +04:00
Chris ceb8f50e43 Add option to add explorer context menu in Windows installer (#5774)
A new dialogue is added in the Windows installer to offer the option of adding explorer.exe context menus to open PowerShell in the current location as a normal shell or as administrator. The context menu entries are achiveven via registry entries and is available when right-clicking on:
- the background of explorer
- a folder in explorer
- a drive in explorer
- on the Desktop
2018-01-05 21:53:19 +04:00
Travis Plunk 24298f76f5
Packaging: make mac package require 10.12 or newer (#5649)
Fixes #4290
Make mac package require 10.12 or newer.
Required that the package is installed to a disk with macOS installed.
The Apple example XML had a background image added as well, so I added a background image:
https://user-images.githubusercontent.com/10873629/33738943-014c9d00-db50-11e7-9628-310ce6427438.png
2017-12-08 10:55:34 -08:00
Steve Lee 4bc52d2358 Use consistent '(c)' for copyright symbol (#5210)
- Remove the year about copyright
- Fix casing of `All rights reserved`
- Replace Unicode characters representing single quote with a single quote
2017-10-26 14:12:19 -07:00
Dongbo Wang 2fd484f491 Update the man help file used in packaging (#5173)
* Update pacakging.psm1 and rename man file

* Update pwsh.1.ronn
2017-10-19 15:09:16 -07:00
Steve Lee 2cc091115b Rename powershell.exe to pwsh.exe (#5101)
- Rename powershell.exe to pwsh.exe
- Fixe appveyor.psm1
- Update MSI to include 'pwsh' in path and app paths
- Revert change for hyper-v powershell direct
- Update names in packaging.psm1.
- Fix check for SxS
2017-10-17 17:25:11 -07:00
Dongbo Wang f7bab36f5d Fix the prerequisite check of MSI package (#5070)
* Skip check 'vsruntime140.dll' on Win10

* Make the precheck accurate

* Update windows installation prerequisites

* Change 'higher' to 'above'

* Address comments

* Address more comments

* Address some more comments

* [Feature] Update the installer test
2017-10-10 16:40:07 -07:00
Greg Zimmerman 68f318364c Add black version of icns for macOS. (#5073) 2017-10-09 17:31:00 -07:00
Steve Lee c83cf72dbf change logo in readme to current black logo (#5030) 2017-10-06 08:00:23 -07:00
Dongbo Wang 008d5e0e6e Replace CRLF with LF for two files under assets folder (#5025) 2017-10-05 16:45:27 -07:00
Steve Lee ee902a649e New icon for PowerShell Core (#4848)
* added new icon

* added new icon

* update icon to new version of console image with avatar colors

* added svg for blue Windows PowerShell icon

* changed default to the black icon

* added custom bitmaps to the installer

* fixed `launch powershell` checkbox so it shows up more nicely as the default checkbox
has a grey background

also reformatted the xml using a xml formatter to make it easier to read

* address PR feedback
2017-10-03 10:35:32 -07:00
Steve Lee 74df9c2d46 added instructions to get permission to use assets (#4938) 2017-10-02 13:44:41 -07:00
bergmeister da49841f16 Use a simple file based check for the VC++ 2015 redistributables (#4745)
* A simple and minimal fix of 4665 to check for the Visual Studio C++ 2015 redistributables. Note that this is specific to 2015 (vcruntime140.dll refers to the Visual Studio version 14.0, which maps to Visual Studio 2015).
A previous check registry check of 'SOFTWARE\Microsoft\DevDiv\VC\Servicing\14.0\RuntimeMinimum' failed because when the redistributables are installed via Windows update (which does not use MSI), then the registry entry did not get populated.
The 'Pending' attribute was removed from existing tests since the download links are now present again and the tests were improved using Pester TestCases.

* Fixed typo spotted in code review of PR 4745

* Remove DirectorySearch Id duplication by defining it once and referencing according to this special trick in the official WiX documentation here: http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/directorysearchref.html
Renamed property values as suggested.

* Remove replacements of HTTPS with HTTP, i.e. test against exact link. Use -UseBasicParsing switch with the hope of not having failures in the CI environment.
Added comment why there is no assertion about the StatusCode.

* Replace download links with link to pre-requisites page as suggested in PR 4745 because this page is easier to update

* Compilation error CNDL0012 fix: WiX does not allow lowercase characters for file search property Ids because due to them being used for a search property means that they must be public, hence lowercase is not allowed.
2017-09-14 18:42:36 -07:00
Steve Lee 7c9b188c13 Rename $IsOSX to $IsMacOS (#4757) 2017-09-07 10:34:40 -07:00
Mike Richmond d5521beb18 Remove VCRedist check because it ignores the files installed via KB (#4664) 2017-08-24 15:42:10 -07:00