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

[Bug] pre_uninstall should be run before the "application is still running" checks #4961

Closed
beer-psi opened this issue Jun 2, 2022 · 3 comments · Fixed by #4960 or #4982
Closed

[Bug] pre_uninstall should be run before the "application is still running" checks #4961

beer-psi opened this issue Jun 2, 2022 · 3 comments · Fixed by #4960 or #4982
Labels

Comments

@beer-psi
Copy link
Contributor

beer-psi commented Jun 2, 2022

Bug Report

Current Behavior

Currently, pre_uninstall is run after test_running_process, which blocks the uninstallation if the app spawns any services.

Expected Behavior

I'd expect pre_uninstall to manage teardown work such as stopping services so that the uninstallation isn't blocked by running processes.

Additional context/output

An example of uninstalling itunes-np:

❯ sudo scoop uninstall -g itunes-np                  
Uninstalling 'itunes-np' (12.12.4.1).
WARN  Application "itunes-np" is still running. Scoop is configured to ignore this condition.
Running pre_uninstall script...
Running uninstaller script...
Removing shortcut C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Scoop Apps\iTunes.lnk
Unlinking C:\ProgramData\scoop\apps\itunes64-np\current
'itunes-np' was uninstalled.

As shown, pre_uninstall is run after test_running_processes, and so uninstallation would've been blocked if scoop config ignore_running_processes were False.

Possible Solution

Move pre_uninstall to before test_running_processes, to the very top, before any uninstalling prep work is run. This way, it also matches post_uninstall, which is run at the very end of the uninstall process.

System details

Windows version: 10.0.19041.1499

OS architecture: 64bit

PowerShell version: 7.2.2

Scoop Configuration

{
  "lastUpdate": "2022-06-02T12:19:59.4769844+07:00",
  "SCOOP_REPO": "https://github.com/ScoopInstaller/Scoop/",
  "SCOOP_BRANCH": "develop",
  "aria2-enabled": true,
  "MSIEXTRACT_USE_LESSMSI": true,
  "SCOOP_DEBUG": true,
  "cachePath": "D:\\Temp\\scoop\\cache",
  "aria2-warning-enabled": false,
  "aria2-split": 16,
  "aria2-max-connection-per-server": 16,
  "aria2-min-split-size": "1M",
  "ignore_running_processes": true,
  "alias": {
    "upgrade": "scoop-upgrade"
  }
}
@beer-psi beer-psi added the bug label Jun 2, 2022
@chawyehsu
Copy link
Member

Good catch, could you create a PR to fix it?

@beer-psi
Copy link
Contributor Author

beer-psi commented Jun 2, 2022

Good catch, could you create a PR to fix it?

Created #4962

@beer-psi
Copy link
Contributor Author

beer-psi commented Jun 3, 2022

Fixed by #4962.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants