BetterDiscord / Installer

A simple standalone program which automates the installation, removal and maintenance of BetterDiscord.

Home Page:https://betterdiscord.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails to kill discord: powershell.exe not on PATH

mattjoe480 opened this issue · comments

commented

BetterDiscord Installer stuck in loop

Installer stuck in a loop if Powershell is not set in the environment variable.

To Reproduce
Steps to reproduce the behavior:

  1. Remove Powershell from to environment variable.
  2. Run the installer till it reaches Attempting to kill Discord.

Expected behavior
Installer doesn't do anything after reaching Attempting to kill Discord.

Screenshots
BetterDiscord Installer
BetterDiscord Installer Console

System Information:

  • OS: Windows 11 Version 22H2
  • Discord Version: Stable 183813 (7a19dec)

Suggestion

  1. Letting the user know about this issue.
  2. This issue can be fixed by checking if Powershell is in their path, if not logging the error.
  3. This issue has somewhat been fixed in my version.
    fixed BetterDiscord Installer img1
    fixed BetterDiscord Installer img2

This is ultimately an issue with one of our dependencies, but we can definitely handle it more gracefully.

commented

I managed to solve this issue by checking if Powershell is in the users path.
Check if the user has Powershell in their path in kill.js If not going to else before try statment.
else { log("Shell not found"); log("Please restart discord manually"); progress.set(progress.value + progressPerLoop); return null; }
And adding this check to install.js
if (killErr || killErr == null) showRestartNotice();

can confirm this was still an issue for me with installer 1.3.0.

When i added "C:\Windows\System32\WindowsPowerShell\v1.0" to my PATH it started to work like advertised. but it took me a LONG long time to find this about it's being due to missing powershell PATH.

Also allegedly even if system32 is in PATH windows have issues finding stuff in it's own subfolders which i found here under cause: https://confluence.atlassian.com/bamkb/powershell-is-not-recognized-as-an-internal-or-external-command-1095246216.html

EDIT: This is on a Windows 10 Build 19045 if that's important

I also just had this problem and adding the path variable fixed it for me, would be nice if there could be some error displayed.