plover icon indicating copy to clipboard operation
plover copied to clipboard

Ask for a restart when Plover installs or when Plover is updated

Open Phorofor opened this issue 2 years ago • 7 comments

Is your feature request related to a problem? Please describe. For Windows: Users may see an unexpected error message with WinError 5 if Plover's already running as an administrator and attempting to launch the provided user mode shortcut in the start menu. Usually when the installer was run in administrative mode.

Plover runs as an administrator by default if the user is on an administrator account if Plover was selected to run after the install completes. At times, the misleading solution is to run Plover as an administrator with some users always running Plover in administrative mode when it isn't needed, only in certain cases.

This does not occur if Plover's installer is launched on a standard user account unless the Run as administrator option is chosen.

Possibly any platform: In addition, serial ports may be in use by other applications inadvertently.

Describe the solution you'd like

  • For Windows: Ask for a system restart when Plover is done installing. This ensures Plover runs in user mode (i.e. not as an administrator). The intended port is unlikely to be used by another application on a fresh restart.
  • (updated) For Windows: Remove the option to run Plover after installation completes. Place a shortcut on the desktop to make it obvious that Plover is installed. Currently shortcuts are only placed in the start menu by default.
  • For macOS: Ask for the Accessibility preferences in the Security & Privacy preference pane to be removed and added when on a newer version of Plover.
  • For macOS: Ask for a system restart when the Accessibility preferences are updated.
  • The user should be able to ignore restarting if they wish to. They should be warned that Plover may not function correctly if they do not wish to restart.

Describe alternatives you've considered

Additional context

Traceback (most recent call last):
File "build/windist/data\Lib\site-packages\plover\scripts\main.py", line 136, in main
File "build/windist/data\Lib\site-packages\plover\oslayer\controller.py", line 81, in send command
File "build/windist/data\Lib\site-packages\plover\oslayer\controller.py", line 74, in _send_message
File "multiprocessing\connection.py", line 505, in Client
File "multiprocessing\connection.py", line 708, in PipeClient
PermissionError: [WinError 5] Access is denied

See: PermissionError: (WinError 5) Access is denied when launching Plover

From the Plover Discord community: [User A] All of a sudden plover stopped working on my Mac OS machine. Even in keyboard mode.

[User A] I removed all input monitoring and assistive permissions and re-added them, and plover says that it’s connected, but nothing shows up on the paper tape.

[User A] Did Mac OS change their security model in the last update (big sur), or has anything else changed? [...] [User B] Have you double checked the port you have selected in plover is the right one? Don't trust it just because it says connected.

[User A] I’m trying with the keyboard just to make sure

[User A] Usually I use my own plover hid protocol, but I wanted to rule errors with that out

[User A] A reboot seemed to fix it

Phorofor avatar Mar 01 '22 15:03 Phorofor

How about removing the option in the installer that "wants" to run Plover after installing it. I'm not saying we should remove it, but we might want to discuss how to make people less likely to use the option, or maybe make it easier to close Plover once it is running ("I closed the main window and didn't realize the paper tape was still open")

SeaLiteral avatar Mar 01 '22 16:03 SeaLiteral

It definitely would make sense to remove the option to run Plover if the user is expected to restart the system. You can substitute removing it by putting a shortcut on the desktop since the start menu shortcuts may not be obvious to tell that Plover was installed (in the case of 'nexting' on the installer prompts).

Phorofor avatar Mar 01 '22 16:03 Phorofor

I haven't used Plover on Windows for a while, but I think the problem mostly appears when starting Plover from the installer. If you wait until the installer finishes and then start Plover manually, I think it doesn't cause any problems.

If I understand correctly what's going wrong, it's the issue that the installer itself is running as an administrator and when Plover gets started from the installer, it too ends up running as an administrator. And when you "exit" it by closing the main window, it's not exiting completely, which in turn means you can't start Plover afterwards as a normal user until something stops the instance that was started by the installer. And while that can be done manually, it might be a bit hard to find the right thing to click, so people suggest logging out and back in, or even restarting the computer.

Restarting the computer feels similar to how you can remove an object from a box by turning it upside-down. The box contains all the applications that are running, and Plover is one of them. Turn it upside-down, and everything in the box, including Plover, falls out of it. You could have taken one thing out of the box, but emptying it is easier, all because Plover's close button doesn't work.

As for how to actually close Plover without "emptying the kitchen sink", assuming you're viewing the main window, you can use the "Quit Plover" option in its File menu. Or you could click on the main window and then press the keyboard shortcut control-q.

I'd think clicking the window's close button should maybe give users the option to actually close Plover, but I guess that's one of several things that could be done to make things more intuitive. But I thin removing the option to start Plover from the installer would probably be the easiest solution.

SeaLiteral avatar Mar 01 '22 16:03 SeaLiteral

So 3 separates issues:

  1. on macOS, the access to assistive devices is not optimally handled, duplicate of #701
  2. needing to restart on macOS: need more info, I don't understand why that would be needed
  3. on Windows, the installer will launch Plover as administrator when installing for all users: that's the real issue, there's no need for a restart, but we don't want the installer to launch Plover as administrator

benoit-pierre avatar Mar 01 '22 16:03 benoit-pierre

@SeaLiteral Part of the issue is that if you run Plover as admin, you also have to run a Plover shortcut as admin to bring the main Plover window in focus when it was already running as admin begin with which is why it is a 'solution' that some users will wind up doing. It works the other way around where if you run Plover in user mode then launch the shortcut as admin, it'll bring Plover into focus as expected. It doesn't launch it as an admin.

While restarting might seem the most inconvenient for load times, it weeds out two things:

  • the possibility of some serial port being in use by something else when a user wants to use it with Plover (i.e. they've tried the serial port for the device they want to use for steno and get a SerialException notification. The taskbar notification doesn't show in continuous builds but it does in dev10. This could be solved by having better wording. It does show in the debug log for either version. It should be a separate issue.)
  • running Plover as an administrator when not intended (this could be fixed without having the installer run Plover as an admin).

Plover does notify if it's still running in the background but it seems what's happening is that it's easy to miss that Plover is in the tray icon (it disappears and becomes a hidden icon that you have to expand in the taskbar) and also the notification is fairly easy to miss.

Restarting sounds like the easiest solution to the end user at the expense of waiting for things to reload since presumably it's more inconvenient to deal with following steps from a wiki page every time but you would want to anyways for things like being able to input text in applications running as an administrator but that's a whole other issue.

So:

  • restarting will weed out some questions and help narrow things down, 'Is Plover running as an admin?', 'Is there an application on startup using your serial port for steno?', 'Can you check your serial port settings again?', 'Do you have another application running as admin where steno isn't working?'. Let's hope the user notices that Plover is in the tray icon on the next restart. However, they might come back later on with another issue on hand and this assumes the user is using a default configuration.
  • doesn't address where Plover is in the tray since it will hide by default. It's back to informing the user where it is. At least clicking the Plover shortcut will bring the main window in focus.

on Windows, the installer will launch Plover as administrator when installing for all users: that's the real issue, there's no need for a restart, but we don't want the installer to launch Plover as administrator

@benoit-pierre It happens even when it's installed into the user's AppData folder; when the Plover installer executable is double-clicked on from administrator accounts. There's no way to run it in user mode from an admin account. I believe some installers do ask for administrative privileges only when you select an option that needs it but here it does it right away.

Phorofor avatar Mar 01 '22 17:03 Phorofor

Some many different issues... Let's split things up, and concentrate this issue on the Windows installer.

The taskbar notification doesn't show in continuous builds but it does in dev10.

What does that mean exactly?

benoit-pierre avatar Mar 01 '22 18:03 benoit-pierre

In #1495, the option to launch Plover once the install is done has been removed from the Windows installer.

benoit-pierre avatar Mar 01 '22 22:03 benoit-pierre