Skip to content

Conversation

@daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Oct 9, 2017

Fix #5029

The Fix

  • Remove the check for Visual C++ Redistributable
  • Add a precheck for WMF 4.0 on Win7.

pwrshplugin.dll has the following dependencies. All the api-ms-win-crt-* api sets are part of the Universal C Runtime. The plugin DLL doesn't depend on Visual C++ Redistributable.

    KERNEL32.dll
    ole32.dll
    WsmSvc.DLL
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    ADVAPI32.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-multibyte-l1-1-0.dll

On Win7, WMF 4.0 or higher version needs to be installed so that the WinRM can support the side-by-side remoting plugin. So I make the WMF 4.0 a prerequisite too.
The way to check PSv4 or above is to check the file version of \windows\system32\pwrshplugin.dll. The file version for in-box PSv4 is 6.3.9600.16384, for WMF 4.0 is 6.3.9600.16406, and for PSv5+ is 10.0.xxx. So we can check the MinVersion of the file pwrshplugin.dll to be 6.3.9600.16383 (means the version needs to be at least 6.3.9600.16384).

I have verified that on 2012R2, Win8.1 and Win7 once Universal C Runtime is installed (it requires a lot of other KB's to be installed) and PSv4 or WMF 4 is available, PowerShell remoting works.

Screenshot Examples

On a machine that doesn't have Universal C Runtime installed:
image

On Win7 that has Universal C Runtime installed but no WMF 4 or above
image

</DirectorySearch>
</Property>
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed to enable remoting over WinRM. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
Copy link
Member

Choose a reason for hiding this comment

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

That URL is too long. I created this you can use: http://aka.ms/pscore6-prereq

Copy link
Member Author

Choose a reason for hiding this comment

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

This is much better 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

</Property>
<Condition Message="$(env.ProductName) requires the Visual Studio 2015 C++ redistributables to be installed. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
<![CDATA[Installed OR VISUAL_CPP_RUNTIME_INSTALLED]]>
<Condition Message="$(env.ProductName) requires the Windows Management Framework 4.0 or above to be installed to enable remoting over WinRM. You can find download links here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
Copy link
Member

Choose a reason for hiding this comment

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

Update this URL as well: http://aka.ms/pscore6-prereq

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

Fully patched (including optional packages), supported systems will already have this installed.
* Install the [Visual C++ Redistributable](https://www.microsoft.com/download/details.aspx?id=48145) for VS2015.
* Install the Windows Management Framework (WMF) [4.0](https://www.microsoft.com/en-us/download/details.aspx?id=40855)
or above ([5.0](https://www.microsoft.com/en-us/download/details.aspx?id=50395),
Copy link
Member

Choose a reason for hiding this comment

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

change "above" to "newer"

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

</Property>
<Condition Message="$(env.ProductName) requires the Visual Studio 2015 C++ redistributables to be installed. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
<![CDATA[Installed OR VISUAL_CPP_RUNTIME_INSTALLED]]>
<Condition Message="$(env.ProductName) requires the Windows Management Framework 4.0 or newer to be installed to enable remoting over WinRM. You can find download links here: http://aka.ms/pscore6-prereq">
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if this check should be a notification during installation rather than a requirement. There is a strong desire from a few folks to have PowerShell Core installable on Win 7 SP1 without requiring a WMF installation. The point is to make PowerShell Core usable on those systems without requiring a reboot.

The open questions I have on this topic are:

  1. To what extent does PowerShell Core function on Win 7 SP1 without WMF 4.0+?
  2. Does outgoing remoting function without WMF 4.0 and UCRT?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think if people want to use powershell regardless of the prerequisites, then the zip package is the way to go -- no precheck. For msi package, it might be better to ensure everything works.

Those two are good open questions.
For UCRT, not sure if WMI/MI.NET would also depend on it.
For WMF 4.0, it's definitely required for making powershell core connectable as server side, but need to see if outgoing remoting needs it on win7.

Copy link
Member

Choose a reason for hiding this comment

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

I'm on the side that the MSI should be comprehensive and the zip for advanced deployments (users knows what they are doing). I think if we get a bunch of customer feedback on the pre-req, we can revisit this.

Copy link
Member Author

Choose a reason for hiding this comment

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

For UCRT, not sure if WMI/MI.NET would also depend on it.

I tried on Win8.1 and Win2012R2 that don't have UCRT installed, CIM cmdlets seem working fine. So it looks to me that UCRT is only required by pwrshplugin.dll.

Copy link
Member

Choose a reason for hiding this comment

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

OK, thanks for checking. If outgoing remoting works on Win 7 SP1 without WMF 4.0, then my concerns are covered.

Copy link
Member Author

@daxian-dbw daxian-dbw Oct 10, 2017

Choose a reason for hiding this comment

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

  1. Does outgoing remoting function without WMF 4.0 and UCRT?

UCRT is not required for outgoing remoting connection. I'm able to create a session in PowerShell core from a Win81 box without UCRT to another Win81 using the configuration created on the latter Win81.

However, it seems WMF 4 is required for outgoing connection. PowerShell core crashed when I tried to create a session from a Win7 box with PSv2 to a Win7 with WMF 5.1 using the configuration created on the latter Win7:

image

@iSazonov
Copy link
Collaborator

Interesting, can an user copy the link we show on error window? Can we do the link clickable?

@SteveL-MSFT
Copy link
Member

@iSazonov unfortunately, the text the installer displays is not clickable or copyable. Will have to research wix to figure out how to have a custom window that has a clickable link.

@daxian-dbw
Copy link
Member Author

@iSazonov it's good that we are now using the short URL "http://aka.ms/pscore6-prereq". It mitigates the problem to some extent.

@iSazonov
Copy link
Collaborator

iSazonov commented Oct 10, 2017

Can we use http://www.installsite.org/pages/en/msi/articles/careful-with-that-hyperlink-on-your-msi-dialog/index.htm ?
Another case is to create Open/Cancel buttons.

@SteveL-MSFT
Copy link
Member

Perhaps we should accept this PR as-is (barring any other concerns) and have a new PR/issue for the custom hyperlink control?

@iSazonov
Copy link
Collaborator

We can not rush to the next Beta.9 release.

</DirectorySearch>
</Property>
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed to enable remoting over WinRM. You can find a download link to it here: http://aka.ms/pscore6-prereq">
Copy link
Member

Choose a reason for hiding this comment

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

https?

Copy link
Contributor

@bergmeister bergmeister Oct 10, 2017

Choose a reason for hiding this comment

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

@daxian-dbw You also need to add or modify the link in the installer test here

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, will fix.

</Property>
<Condition Message="$(env.ProductName) requires the Visual Studio 2015 C++ redistributables to be installed. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
<![CDATA[Installed OR VISUAL_CPP_RUNTIME_INSTALLED]]>
<Condition Message="$(env.ProductName) requires the Windows Management Framework 4.0 or newer to be installed to enable remoting over WinRM. You can find download links here: http://aka.ms/pscore6-prereq">
Copy link
Member

Choose a reason for hiding this comment

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

https?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

</DirectorySearch>
</Property>
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed to enable remoting over WinRM. You can find a download link to it here: http://aka.ms/pscore6-prereq">
Copy link
Contributor

@bergmeister bergmeister Oct 10, 2017

Choose a reason for hiding this comment

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

@daxian-dbw You also need to add or modify the link in the installer test here

@bergmeister
Copy link
Contributor

bergmeister commented Oct 10, 2017

As far as I have seen the message dialog does not allow hyperlinks but the WiX Cookbook gives examples on how to deal with hyperlinks in chapter 11:

One could add a custom action that opens the browser if the installation failed due to the pre-requisite check or embed the hyperlink in a custom WiX exit dialogue in case of failure.

@daxian-dbw
Copy link
Member Author

@adityapatwardhan and @bergmeister Thanks for your feedback and I have addressed them. Please take another look.

Copy link
Member

@adityapatwardhan adityapatwardhan left a comment

Choose a reason for hiding this comment

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

LGTM

</UI>
<!-- Prerequisites -->
<Condition Message="Supported only on Win8 and above">
<Condition Message="Supported only on Win7 and above">
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor but should we maybe spell out Win7 completely as Windows 7 and add a full stop?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we should spell it out completely

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

It is available via direct download or Windows Update.
Fully patched (including optional packages), supported systems will already have this installed.
* Install the [Visual C++ Redistributable](https://www.microsoft.com/download/details.aspx?id=48145) for VS2015.
* Install the Windows Management Framework (WMF) [4.0](https://www.microsoft.com/en-us/download/details.aspx?id=40855)
Copy link
Contributor

Choose a reason for hiding this comment

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

The links should not contain the culture/language specific part en-us

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Fixed.

@bergmeister
Copy link
Contributor

bergmeister commented Oct 10, 2017

@daxian-dbw Should we also add the new WMF download URLS to the installer tests as their purpose is simply to check that links are still working?

@adityapatwardhan
Copy link
Member

@daxian-dbw Please use [Feature] in the last git commit message so that the modified test is executed.

@daxian-dbw
Copy link
Member Author

@bergmeister new tests are added to verify the WMF download URLs
@adityapatwardhan the latest commit was pushed with [Feature] tag.

@bergmeister
Copy link
Contributor

LGTM

@adityapatwardhan adityapatwardhan merged commit f7bab36 into PowerShell:master Oct 10, 2017
@daxian-dbw daxian-dbw deleted the fixmsi branch October 11, 2017 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants