Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn Windows 7 users when Powershell is the wrong version #1029

Closed
russlamb opened this issue Jul 17, 2019 · 7 comments · Fixed by #1139
Closed

Warn Windows 7 users when Powershell is the wrong version #1029

russlamb opened this issue Jul 17, 2019 · 7 comments · Fixed by #1139
Labels
enhancement Feature request help wanted Needs a contributor from the community

Comments

@russlamb
Copy link

Preflight Checklist

  • [X ] I have read the contribution documentation for this project.
  • [X ] I agree to follow the code of conduct that this project follows, as appropriate.
  • [X ] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

I would like an error message to be displayed when the wrong version of Powershell is detected.

Currently, electron-packager requires a powershell version of 3 or later. Yet all Windows 7 machines only have Powershell version 2 installed by default. If using the wrong version of Powershell, the electron-packager simply hangs at the extracting step without displaying any error or warning.

As such, the only way to find out the cause of the problem is to come to this forum.

Proposed Solution

I propose that electron packager check the Powershell version if on windows platform and throw an error if it detects the wrong version.

The powershell version can be detected by running the following command from the system command line:

powershell -Command "$PSVersionTable.PSVersion"

Alternatives Considered

Currently the README lists Powershell 3 as one of its dependencies, but Powershell version is not something most Windows users are aware of.

Additional Information

Judging by the number of related issues raised on this board, it seems this is a fairly common issue for people on Windows 7 machines. Here are some examples
Example 1
Example 2
Example 3

I had the same issue myself prior to coming to these boards. While I appreciate the effort the dev and support contributors have made to resolve and document these problems it would make electron packager easier for new developers to use if an error were thrown instead of just hanging.

While I understand that the README file lists dependencies, it would make electon-packager an all-around better experience if it throws errors when the Powershell dependency is missing rather than silently hanging. Powershell is not something many Windows users use and therefore may not be obvious what the problem is.

@russlamb russlamb added the enhancement Feature request label Jul 17, 2019
@welcome
Copy link

welcome bot commented Jul 17, 2019

👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@malept malept added the help wanted Needs a contributor from the community label Jul 17, 2019
@malept
Copy link
Member

malept commented Jul 17, 2019

I would be happy to review a pull request for this. I have a WIP branch to warn Windows 7 users. The main problem for me right now is writing tests for this.

Also, I don't have a Windows 7 instance to work with at the moment, so I'm kind of flying blind.

@malept malept changed the title Requested: warning when Powershell is wrong version Warn Windows 7 users when Powershell is wrong version Jul 17, 2019
@malept malept changed the title Warn Windows 7 users when Powershell is wrong version Warn Windows 7 users when Powershell is the wrong version Jul 17, 2019
@malept
Copy link
Member

malept commented Jul 17, 2019

I have a WIP branch to warn Windows 7 users.

See #1030 for a first draft.

@russlamb
Copy link
Author

russlamb commented Jul 17, 2019 via email

@malept
Copy link
Member

malept commented Jul 17, 2019

I would test for you but i just upgraded my powershell.

The first iteration doesn't check the Powershell version. It only warns Windows 7 users to make sure they have the right .NET Framework and Powershell versions installed. However, it also provides a better code location for a contributor with access to Windows 7 to work on another iteration that actually tests for .NET Framework and Powershell versions.

What's the best way to install the changed version?

In package.json devDependencies:

{
  "devDependencies": {
    "electron-packager": "electron-userland/electron-packager#warn-windows-7"
  }
}

See also: https://docs.npmjs.com/files/package.json#git-urls-as-dependencies

@russlamb
Copy link
Author

russlamb commented Jul 17, 2019 via email

@russlamb
Copy link
Author

russlamb commented Jul 17, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request help wanted Needs a contributor from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants