|
| 1 | +--- |
| 2 | +RFC: RFC |
| 3 | +Author: Joey Aiello |
| 4 | +Status: Draft |
| 5 | +Version: 0.1 |
| 6 | +Area: Installation |
| 7 | +Comments Due: March 27, 2018 |
| 8 | +Plan to implement: Yes |
| 9 | +--- |
| 10 | + |
| 11 | +# MSI Installation Path Location |
| 12 | + |
| 13 | +Today, when using the MSI package on Windows, |
| 14 | +PowerShell Core is installed to `$env:ProgramFiles\PowerShell\<version>\`. |
| 15 | +This path was chosen early in the development of PowerShell Core in order to provide a deterministic, |
| 16 | +file-based way to query the installed version of PowerShell. |
| 17 | +In this RFC, we will explore the possibility of installing to different paths in order to support certain side-by-side scenarios. |
| 18 | + |
| 19 | +## Motivation |
| 20 | + |
| 21 | +Now that PowerShell Core 6.0 has GA'd, some users would like to run a preview version of PowerShell Core 6.1 side-by-side with PowerShell Core. |
| 22 | +Today, that's only possible if one version is installed via the MSI and another is installed via the "portable" ZIP package. |
| 23 | +Unfortunately, this makes the ZIP-installed copy of PowerShell difficult to install, and |
| 24 | + |
| 25 | +Also, in working to support Microsoft Update (MU) for servicing of PowerShell Core, |
| 26 | +we require that the path of all PowerShell Core binaries does not change between servicing. |
| 27 | +For example, if needed to patch a hypothetical version 6.0.3 to 6.0.4, the location of `pwsh.exe` and all associated binaries cannot change. |
| 28 | + |
| 29 | +Lastly, we now have multiple mechanisms for querying the version directly from the PowerShell binary itself. |
| 30 | +In order to support *nix-y semantics, we've added a `--version` parameter to `pwsh` that returns the version. |
| 31 | +We also provide the version of PowerShell in the FileVersion object associated with `pwsh`. |
| 32 | + |
| 33 | +## Specification |
| 34 | + |
| 35 | +* There shall be two "flavors" of MSIs available: |
| 36 | + * Stable: a production-ready, supported build. |
| 37 | + * Preview: an unsupported build that may contain incomplete new features and high-impact bugs, |
| 38 | + and should therefore not be used in production. |
| 39 | +* All stable MSIs of PowerShell Core 6.x shall be installed to `$env:ProgramFiles\PowerShell\6\`. |
| 40 | +* All preview MSIs of PowerShell Core 6.x shall be installed to `$env:ProgramFiles\PowerShell\6-preview`. |
| 41 | +* When a stable MSI is run on a machine that already has a stable PowerShell Core 6.x installed, |
| 42 | + an in-place update of that stable build shall be performed. |
| 43 | +* When a preview MSI is run on a machine that already has a preview PowerShell Core 6.x installed, |
| 44 | + an in-place update of that stable build shall be performed. |
| 45 | + |
| 46 | +## Alternate Considerations and Proposals |
| 47 | + |
| 48 | +### Include the minor version number in the folder name |
| 49 | + |
| 50 | +This proposal would install/update all stable PowerShell Core 6.x builds to `$env:ProgramFiles\PowerShell\6.0`, |
| 51 | +and all stable PowerShell Core 6.1 builds to `$env:ProgramFiles\PowerShell\6.1`. |
| 52 | +Similarly, previews of PowerShell Core 6.1 would be installed to `$env:ProgramFiles\PowerShell\6.1-preview`, |
| 53 | +and previews of PowerShell Core 6.2 would be installed to `$env:ProgramFiles\PowerShell\6.2-preview`. |
| 54 | + |
| 55 | +This is undesirable given the Modern Lifecycle Policy that PowerShell Core has adopted. |
| 56 | +Essentially, we've given users 6 months to migrate off of an older minor version of PowerShell Core once a new one is released. |
| 57 | +Therefore, it makes more sense to *update* users from stable 6.0 to 6.1 than leave a version lying around that will soon become unsupported. |
| 58 | +If users want to maintain unsupported versions of PowerShell Core side-by-side, |
| 59 | +they should do a portable ZIP install. |
| 60 | + |
| 61 | +## Open Questions |
| 62 | + |
| 63 | +* What happens if `...\6\pwsh.exe` and `...\6-preview\pwsh.exe` are both on the PATH? |
| 64 | + Is it even desirable to put `...\6-preview\pwsh.exe` on the PATH? |
| 65 | +* Should an update install of stable PowerShell Core 6.0 to 6.1 also do a cleanup of any remaining preview 6.1 installs on the box? |
| 66 | + * I'd posit "no" because the stable vs. preview branches should be independent installations. |
| 67 | + E.g. I may want to immediately do an update of my preview 6.1 to 6.2, |
| 68 | + and maybe I have profiles or modules in that preview `$PSHOME` that I want specific to my preview install. |
0 commit comments